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.ib...@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<ashaki...@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=PAYLOA
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: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to