[ 
https://issues.apache.org/activemq/browse/CAMEL-723?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Willem Jiang resolved CAMEL-723.
--------------------------------

    Resolution: Fixed

Please check out the 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/non_wrapper/PersonProcessor.java?view=markup&pathrev=687273

You can handle get the request message object by using the below code by 
turning off the wrapper style parameter mapping in WSDL2Java processing.

{code:language=java}

public class PersonProcessor implements Processor {

    private static final transient Log LOG = 
LogFactory.getLog(PersonProcessor.class);

    public void process(Exchange exchange) throws Exception {
        LOG.info("processing exchange in camel");

       GetPerson person =  exchange.getIn().getBody(GetPerson.class);
        String personId = person.getPersonId();
        GetPersonResponse response = new GetPersonResponse();

        if (personId == null || personId.length() == 0) {
            LOG.info("person id 123, so throwing exception");
            // Try to throw out the soap fault message
            org.apache.camel.non_wrapper.types.UnknownPersonFault personFault =
                new org.apache.camel.non_wrapper.types.UnknownPersonFault();
            personFault.setPersonId("");
            org.apache.camel.non_wrapper.UnknownPersonFault fault =
                new org.apache.camel.non_wrapper.UnknownPersonFault("Get the 
null value of person name", personFault);
            // Since camel has its own exception handler framework, we can't 
throw the exception to trigger it
            // We just set the fault message in the exchange for camel-cxf 
component handling
            exchange.getFault().setBody(fault);
        }
        response.setPersonId(personId);
        response.setName("Bonjour");
        response.setSsn("123");
        LOG.info("setting Bonjour as the response");
        // Set the response message, first element is the return value of the 
operation,
        // the others are the holders of method parameters
        exchange.getOut().setBody(new Object[] {response});
    }

}

{code}



> 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