Apache camel CAMEL-CXF调用远程SOAP服务错误
我正在使用Camel-CXF以有效负载格式(xml)调用第三方web服务。Apache camel CAMEL-CXF调用远程SOAP服务错误,apache-camel,cxf,jbossfuse,Apache Camel,Cxf,Jbossfuse,我正在使用Camel-CXF以有效负载格式(xml)调用第三方web服务。 无法使用远程wsdlURL。在部署期间,我遇到了这个错误(OSGI包)。由于java知识有限,我宁愿坚持使用基于xml的方法 卡拉夫版本:2.3 驼峰型:2.12(保险丝6.1) 我的CXF端点定义(使用远程wsdl) 您的第三方urlhttps://example.com/abc/extension/Service?wsdl是否使用有效的WSDL回答?您需要在获取WSDL之前登录吗?例如,您可以下载WSDL,我可以在浏
无法使用远程wsdlURL。在部署期间,我遇到了这个错误(OSGI包)。由于java知识有限,我宁愿坚持使用基于xml的方法 卡拉夫版本:2.3 驼峰型:2.12(保险丝6.1)
您的第三方url
https://example.com/abc/extension/Service?wsdl
是否使用有效的WSDL回答?您需要在获取WSDL之前登录吗?例如,您可以下载WSDL,我可以在浏览器上打开此WSDL。上面的代码可以在一台计算机(Windows)上运行,但不能部署到UNIX上的客户机上。另外,如何将其作为jar嵌入到fuse Projects中您的客户端UNIX计算机是否可以访问internet?如果它位于某个代理/防火墙后面,则可能无法访问WSDL url。这可能是原因。关于部署:我强烈建议阅读。当您拥有jar时,您可以将其复制到部署文件夹中,或者使用install-s mvn:yourGroupId/yourArtifactId/yourVersion
从控制台进行安装。对不起,我可能误读了您的评论。要嵌入您用浏览器下载的WSDL,请将其保存在src/main/resources
文件夹下的项目中,Maven将完成其余工作。要在应用程序中加载WSDL,请参考提供的链接中的示例。您可以使用“OperationName”头指定每次调用的操作。
<cxf:cxfEndpoint id="serviceEndpoint"
address="https://example.com/abc/extension/Service"
wsdlURL="https://example.com/abc/extension/Service?wsdl"
endpointName="abc:LWPort"
serviceName="abc:LWUpdateService"
xmlns:abc="http://www.example.com/LW/ws/LWUpdateService">
<cxf:properties>
<entry key="dataFormat" value="PAYLOAD"/>
<entry key="username" value="xxxxxxx"/>
<entry key="password" value="xxxxxxx"/>
</cxf:properties>
</cxf:cxfEndpoint>
<route>
<from uri="activemq:xxxxxxxxxxxxxx"/>
<to uri="cxf:bean:serviceEndpoint"/>
<route>
JBossFuse:example@root> Exception in thread
"SpringOsgiExtenderThread-7"
org.apache.camel.FailedToCreateProducerException:
**Failed to create Producer for endpoint: Endpoint[cxf://bean:serviceEndpoint].
Reason: org.apache.cxf.service.factory.ServiceConstructionException:**
No valid WSDL https://example.com/abc/extension/Service?wsdl nor service class is specified.
at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:409)
at org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:123)
at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:191)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:79)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1154)
at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:41)
at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:28)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.interceptor.DefaultChannel.doStart(DefaultChannel.java:153)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:61)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.MulticastProcessor.doStart(MulticastProcessor.java:994)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:89)
at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:79)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)
at org.apache.camel.impl.RouteService.startChildService(RouteService.java:329)
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)
at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:2150)
at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:2080)
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1868)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1740)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1579)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1547)
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:221)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:303)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: