2

I am using Camel-CXF to call a third party web-service in PAYLOAD format (xml).
Is it not possible to use remote wsdlURL. During deployment i am getting this error (OSGI bundle). Due to limited java knowledge, i would prefer to stick to xml based approach.

Karaf version: 2.3 camel version: 2.12 (fuse 6.1)

  1. My CXF end point definition (am using remote wsdl)
<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>
  1. Route invoking web-service
<route>           
  <from uri="activemq:xxxxxxxxxxxxxx"/>
  <to uri="cxf:bean:serviceEndpoint"/>
<route>

Error message:

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:
Kenster
  • 23,465
  • 21
  • 80
  • 106
Abhishek C
  • 63
  • 5
  • 1
    Does your third party url `https://example.com/abc/extension/Service?wsdl` answer with a valid WSDL? Do you need to login before getting the WSDL? You could, for example, download the WSDL and [embed it in your jar](http://stackoverflow.com/q/4455195/423955) – Alessandro Da Rugna Mar 29 '16 at 08:05
  • I am able to open this wsdl on the browser. The code above works on one machine (Windows) but does not get deployed to my client machine which is on UNIX. Also, How do I embed it as a jar within fuse project – Abhishek C Mar 29 '16 at 10:08
  • 1
    Does your client UNIX machine have internet access? If it's behind some proxy/firewall maybe it can't reach the WSDL url. This could be the cause. About the deployment: I strongly suggest to read [JBoss Fuse Getting Started guide](https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2/html/Getting_Started/). When you have the jar you copy it in **deploy** folder or install from the console using `install -s mvn:yourGroupId/yourArtifactId/yourVersion`. – Alessandro Da Rugna Mar 29 '16 at 10:47
  • Sorry, I probably misread your comment. To embed the WSDL you download it with your browser, save it in the project under `src/main/resources` folder, Maven will do the rest. To load the WSDL in the application, please refer to the examples in the link provided. – Alessandro Da Rugna Mar 29 '16 at 10:53
  • Thanks Alessandro for your response, I am checking on the firewall criteria. On a separate note, do u know how can I call a specific operation of a web service in fuse . My web service has more than one operation – Abhishek C Mar 29 '16 at 11:13
  • 1
    You can use the "OperationName" header to specify the operation per call. – Ramin Arabbagheri Apr 02 '16 at 23:20
  • Thanks , it worked – Abhishek C Apr 09 '16 at 22:23
  • @AlessandroDaRugna thanks it was indeed a firewall issue – Abhishek C Apr 09 '16 at 22:24

0 Answers0