camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Shakirin <ashaki...@talend.com>
Subject RE: Camel CXF generic producer before 2.8.0
Date Tue, 04 Oct 2011 14:25:00 GMT
Hi William,

Just short answers:

> If you do not specify both service class and WSDL in the endpoint, the validation is
bypassed

it was my first try, but it seems to be not the case for Camel 2.7.3: if I do not specify
WSDL location and serviceClass I either receive an exception: "java.lang.IllegalArgumentException:
serviceClass must be specified and not empty" or 
"java.lang.NullPointerException
at org.apache.cxf.transport.TransportURIResolver.resolve(TransportURIResolver.java:66)
at org.apache.cxf.catalog.CatalogWSDLLocator.getBaseInputSource(CatalogWSDLLocator.java:72)
"
dependent on message format.
It works only in Camel 2.8.0 (as I can see skipPayloadMessagePartCheck was introduced also
in 2.8.0).

> Otherwise, message will be checked to make sure required body parts are provided for
making the invocation according to WSDL or service class'

It is ok, sorry, my mistake.
My concern was that if @WebParam annotation is missing in java interface (in case of using
serviceClass), MessagePartInfo.getConcreteName() has name and namespace of the operation itself.
In this case validation can failed when name of message root element is not the same as operation
name.
But if @WebParam annotation is correctly defined in java interface or wsdl is used, message
is successfully validated.
So, no problems with it.

Regards,
Andrei.

-----Original Message-----
From: William Tam [mailto:email.wtam@gmail.com] 
Sent: 02 October 2011 16:55
To: users@camel.apache.org
Subject: Re: Camel CXF generic producer before 2.8.0

Andrei,

If you do not specify both service class and WSDL in the endpoint, the validation is bypassed.
 (The "skipPayloadMessagePartCheck" flag is not a user settable option).  You can send any
XML payload you wish.  
Otherwise, message will be checked to make sure required body parts are provided for making
the invocation according to WSDL or service class' 
specifications.   There is also a "wrappedStyle" option you can set and 
have effect on the format of the message.  If your message payload needs to be arbitrary,
I am not sure why WSDL or service class should be specified.  I am also not sure why ws-addressing
would make the payload arbitrary but I don't know.

Thanks.

On 10/02/2011 08:01 AM, Andrei Shakirin wrote:
> Hi Claus,
>
> Yep, it is possible way.
> Another possibility is using java CXF client with dispatch interface and integrate it
with my route via bean component.
>
> Do you have any ideas why Camel CXF code makes this validation at all? Basically root
payload element can be not the same as web service method name. It is required only for wrapped
style, but in case of using ws-addressing they can be different.
>
> Regards,
> Andrei.
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: 02 October 2011 09:36
> To: users@camel.apache.org
> Subject: Re: Camel CXF generic producer before 2.8.0
>
> Hi
>
> You can use plain HTTP component to forward a web service call.
>
>
> On Fri, Sep 30, 2011 at 5:54 PM, Andrei Shakirin<ashakirin@talend.com>  wrote:
>> Hi,
>>
>> Is there any way to avoid expected message part checking (CxfEndpoint.java) in 2.7.3?
>> skipPayloadMessagePartCheck option was introduced in 2.8.0:
>> https://issues.apache.org/jira/browse/CAMEL-3778
>>
>> Anyway, just it means that there is no way to implement universal CXF producer in
Camel before 2.8.0 (analog to CXF Dispatch interface)?
>>
>> The use case is following: I need generic Camel CXF producer, that can speak with
any external web service.
>>
>> I defined a generic interface:
>> @WebServiceProvider()
>> @ServiceMode(value = Service.Mode.PAYLOAD) public interface 
>> WebServiceFacade extends Provider<Source>  {
>>     public StreamSource invoke(Source message); }
>>
>> and specify route:
>> <camelContext xmlns="http://camel.apache.org/schema/spring">
>>   <camel:route>
>>    <camel:from
>> uri="cxf://http://localhost:8197/FlightReservationService/?dataFormat
>> = PAYLOAD&amp;serviceClass=de.camel.test.WebServiceFacadeClass"/>
>>    <camel:to uri="log:TestLogger"/>
>>    <camel:to
>> uri="cxf://http://localhost:8080/sbb/services/Invoke?dataFormat=PAYLO
>> A D&amp;serviceClass=de.camel.test.WebServiceFacade "/>  
>> </camel:route> </camelContext>
>>
>> Camel successfully receives incoming message and logs it. After it, before sending,
 Camel tries to compare message parts from the incoming message with MessagePartInfo from
the WebServiceFacade interface. Of course they have different names : {http://test.camel.de/}invoke
from interface and {xxxx}yyy from message.
>> Therefore Camel throws exception: The PayLoad elements cannot fit with the message
parts of the BindingOperation. Please check the BindingOperation and PayLoadMessage.
>> Questions:
>> 1) what is the reason of this validation? Basically root payload element can be not
the same as web service method name (it is required only for wrapped style, but in case of
using ws-addressing they can be different).
>> 2) is there any other possibility to provide universal CXF producer in Camel before
skipPayloadMessagePartCheck was introduced (analog to CXF Dispatch interface)?
>>
>> Regards,
>> Andrei.
>>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message