【问题标题】:Change default axis2 Webservice call from Websphere?从 Websphere 更改默认的axis2 Webservice 调用?
【发布时间】:2016-02-21 01:36:37
【问题描述】:

嗨,我想使用cxf 调用 web 服务,因为我在编码时将所有与 cxf 相关的 jar 添加到项目构建路径中。在 websphere 中部署时,在 SupportingJars 文件夹中添加了所有 jar,并将其设置为 Reference Shared Libraries of my ear。

请在下面找到调用webservice的代码

Dispatch disp = service.createDispatch( portName, jaxbContext,Service.Mode.PAYLOAD ); Object jaxbResObject = (Object) disp.invoke( jaxbReqObject );

此代码在 Weblogic 中作为 org.apache.cxf.jaxws.DispatchImpl disp 对象运行良好。但在 webshpere 中,它返回 org.apache.axis2.jaxws.client.dispatch.JAXBDispatch 作为 disp 对象并从axis2 获取 javax.xml.ws.soap.SOAPFaultExceptioninvoke

我知道 websphere 插件文件夹包含axis2 jars。作为使用此 jar 的 javax 的默认 createDispatch 方法。我如何更改类加载策略或说 javax createDispatch 以使用我的cxf jars in ref shared lib folder ??

【问题讨论】:

  • 对于 CXF,您需要禁用注释扫描并更改类加载器。查看此post 了解更多详情。
  • 谢谢加斯。事情是我从 ejb jar 调用 webservice,它还包含 EAR 的其他组件使用的一些实用方法。现在如何为 EJB jar 设置父级最后一个选项??
  • 然后尝试在应用程序级别将父级设置为最后。
  • EAR 未启动 :-(
  • 你有什么错误?

标签: java web-services websphere cxf axis2


【解决方案1】:

WebSphere Application Server 使用基于 Axis2 的 Web 服务引擎,当您想使用 CXF 时,请按照此文档禁用 Axis2 引擎以避免任何 Jar 冲突问题。 https://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/twbs_thirdparty.html?lang=en

问候 杨

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多