[ 
https://issues.apache.org/activemq/browse/CAMEL-2025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54347#action_54347
 ] 

William Tam commented on CAMEL-2025:
------------------------------------

Hi Stan, thanks for the report and the patch.   The problem is specifically for 
non-spring created endpoint.   I applied your patch and also fixed the same 
issue on the producer side.   We actually have a test/wsdl (for this feature 
but for spring created endpoint) we can reuse.  So, I reused it instead.

> serviceClass needs to be specified for PAYLOAD or MESSAGE mode even though 
> it's documented as not being required.
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2025
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2025
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.0.0
>            Reporter: Stan Lewis
>            Assignee: William Tam
>             Fix For: 2.1.0
>
>         Attachments: patch.txt
>
>
> According to http://camel.apache.org/cxf.html if you specify PAYLOAD or 
> MESSAGE mode you don't need to specify the serviceClass parameter if wsdlUrl 
> is provided. However this isn't the case, with a route like:
> cxf://localhost:8080/blah?wsdlURL=classpath:hello/HelloWorld-DOC.wsdl&dataFormat=PAYLOAD
> The following exception is thrown:
> {code}
> java.lang.IllegalArgumentException: serviceClass must be specified and not 
> empty
>       at org.apache.camel.util.ObjectHelper.notEmpty(ObjectHelper.java:271)
>       at 
> org.apache.camel.component.cxf.CxfEndpoint.createServerFactoryBean(CxfEndpoint.java:303)
>       at 
> org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java:47)
>       at 
> org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.java:97)
>       at 
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:59)
>       at 
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>       at org.apache.camel.impl.RouteService.doStart(RouteService.java:94)
>       at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
>       at 
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:843)
>       at 
> org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:147)
>       at 
> org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:100)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:616)
> {code}
> as the code doesn't check what mode is being used before testing if 
> serviceClass is set or not.
> Attached patch adds a test that reproduces this and also fixes the issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to