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

Claus Ibsen commented on CAMEL-723:
-----------------------------------

Willem what about adding an option to camel-cxf where you can specify that you 
want either behaviour?

Look what Hadrian had to do for a Camel introduction presentation in the route:
{code:java}
public void configure() throws Exception {
        // direct:start is a internal queue to kick-start the routing in our 
example
        // we use this as the starting point where you can send messages to 
direct:start
        
from("cxf:http://localhost:9090/unittest?serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint";)
            .process(new Processor() {
                public void process(final Exchange exchange) {
                        Message in = exchange.getIn();
                        // Get the parameter list
                        List parameter = in.getBody(List.class);
                        // Put the result back
                        exchange.getOut().setBody(parameter.get(0));
                    }
            })
            .setHeader("subject", el("${in.body.incidentId}"))
            .filter(header("subject").isEqualTo("Hadrian"))
            .to("velocity:MailBody.vm")
            .to("file://target/subfolder?delete=false&consumer.delay=1000")
            .to("smtp://[EMAIL PROTECTED]&[EMAIL PROTECTED]");
    }
{code}

This is very "ugly" and I was hoping that Camel would be smarter here as what 
Hadrian does in the inner processor is just plain plumming code that Camel 
could figure out to do itself.

Hadrian didn't know about the fact that you can do a explicit convertBodyTo to 
the POJO class:
.convertBodyTo(InputReportIncident.class) instead of the inner processor.

This new flag could then be default on for the most common style of webservice: 
document, litteral, wrapped, contract first.
And then you can turn the flag off for those "Greeter" RPC stylish webservices, 
and for end-users who prefer for some obsure reason to use the Holder objects.

In my world we develop webservices using document litteral, wrapped using 
contract first. And nothing else.

I would love Camel and CXF to support this as a first class citizen.

New users to Camel and CXF already have a hard time to figure out CXF comming 
from a AXIS land where they just get the code generated from a .wsdl and then 
they are ready to go.
Okay sorry, rant is over and I have only started to boil the water for my 
morning coffeee.

> CXF - wrapper/unwrapper - camel-cxf should be smarter
> -----------------------------------------------------
>
>                 Key: CAMEL-723
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-723
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>
> Willem knows what this is. See chat log on the july-15-2008.
> Basically getBody() should be smart in what kind of situation you are using 
> CXF.

-- 
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