You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Willem Jiang <wi...@gmail.com> on 2011/05/10 02:11:28 UTC

Re: Serving up a JAX-WS service in Camel-CXF

Hi

If you are using the POJO dataformat, you don't need ot use the 
SoapJaxbDataFormat, as the camel-cxf endpoint will marshal and unmarsha 
the data for you.

You can find some example about how to use POJO dataformat here.

[1]http://camel.apache.org/cxf.html#CXF-HowtoconsumeamessagefromacamelcxfendpointinPOJOdataformat


On 5/10/11 2:42 PM, Chris Richmond wrote:
>
> String WEB_SERVICES_URL =
> "cxf://http://myhost:9999/MyServiceName?dataFormat=POJO&serviceName=
> <http://myhost:9999/MyServiceName?dataFormat=POJO&serviceName=>{http://my.name.space}MyServiceName&serviceClass=my.service.MyServiceInterface";
>
>
>    SoapJaxbDataFormat soapDF = new
> SoapJaxbDataFormat("my.service.MyServiceInterface", new
> ServiceInterfaceStrategy(MyServiceInterface.class, false));
>
> MyServiceInterface serverBean = new MyServiceInterfaceImpl();
>
>          from(WEB_SERVICES_URL)
>            .onException(Exception.class)
>            .handled(true)
>            .marshal(soapDF)
>            .end()
>            .unmarshal(soapDF)
>            .bean(serverBean)
>            .marshal(soapDF);
>
> MyServiceInterface is my JAX-WS annotated service defintion
> and MyServiceInterfaceImpl is the implementation obviously.


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com

Re: Serving up a JAX-WS service in Camel-CXF

Posted by Chris Richmond <cr...@referentia.com>.
Yes, I have seen this example.  My problem with this approach is that it 
is written to handle one pre-set hard coded method and it is all 
manually written code to handle the requests/responses instead of simply 
relying on the standard CXF inteface(with annotations)/implementations.  
This means my service that has 50 methods or so would be a lot of work 
using this approach.  Do you agree or am I missing something?

Thanks....

On 5/9/2011 2:11 PM, Willem Jiang wrote:
> Hi
>
> If you are using the POJO dataformat, you don't need ot use the 
> SoapJaxbDataFormat, as the camel-cxf endpoint will marshal and 
> unmarsha the data for you.
>
> You can find some example about how to use POJO dataformat here.
>
> [1]http://camel.apache.org/cxf.html#CXF-HowtoconsumeamessagefromacamelcxfendpointinPOJOdataformat 
>
>
>
> On 5/10/11 2:42 PM, Chris Richmond wrote:
>>
>> String WEB_SERVICES_URL =
>> "cxf://http://myhost:9999/MyServiceName?dataFormat=POJO&serviceName=
>> <http://myhost:9999/MyServiceName?dataFormat=POJO&serviceName=>{http://my.name.space}MyServiceName&serviceClass=my.service.MyServiceInterface"; 
>>
>>
>>
>>    SoapJaxbDataFormat soapDF = new
>> SoapJaxbDataFormat("my.service.MyServiceInterface", new
>> ServiceInterfaceStrategy(MyServiceInterface.class, false));
>>
>> MyServiceInterface serverBean = new MyServiceInterfaceImpl();
>>
>>          from(WEB_SERVICES_URL)
>>            .onException(Exception.class)
>>            .handled(true)
>>            .marshal(soapDF)
>>            .end()
>>            .unmarshal(soapDF)
>>            .bean(serverBean)
>>            .marshal(soapDF);
>>
>> MyServiceInterface is my JAX-WS annotated service defintion
>> and MyServiceInterfaceImpl is the implementation obviously.
>
>