Hi 

i doin't understand why it fail :
i have an xsd file
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; >
        <xsd:complexType name="PersonType">
        <xsd:sequence>
            <xsd:element name="firstName" type="xsd:string"/>
            <xsd:element name="lastName" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="Person" type="PersonType"/>              

                        
                <xsd:complexType name="GreetingRequestType">
                                <xsd:sequence>
                                        <xsd:element name="name" 
type="xsd:string" />
                                </xsd:sequence> 
                </xsd:complexType>

        <xsd:element name="GreetingRequest" type="GreetingRequestType"/>        
        
        
        <xsd:complexType name="GreetingResponseType">
                <xsd:sequence>
                        <xsd:element name="welcome" type="xsd:string" />
                </xsd:sequence>
        </xsd:complexType>
        <xsd:element name="GreetingResponse" type="GreetingResponseType"/>
</xsd:schema>


i use xjc to produce the java file


i have this route
          <route>
            <from
uri="restlet:http://127.0.0.1:9090/greeting?restletMethods=POST,GET"/>
                <unmarshal>
                                <jaxb ignoreJAXBElement="false" 
prettyPrint="true"
contextPath="poc.camel.echange"/>
                </unmarshal>

                <process ref="greeting"></process>
                        <marshal>
                <jaxb ignoreJAXBElement="false" prettyPrint="true"
contextPath="poc.camel.echange" />
                </marshal>
          </route>

This process failed
   public void process(Exchange exchange) throws Exception {
      GreetingRequestType user = (GreetingRequestType)
exchange.getIn().getBody(GreetingRequestType.class);


// 

        GreetingResponseType gr = new GreetingResponseType();
         gr.setWelcome(user.getName());
        exchange.getOut().setBody( gr );
}

the user is always nill, how to retrieve the instance ? (present in the
echange value see in debug mode)


but not this one
   public void process(Exchange exchange) throws Exception {
// nothing
    }
the incoming request is well unmarshall and marshall in the response
why ?


Thx
Bruno
-- 
View this message in context: 
http://old.nabble.com/xsd%2C-unmarshal-and-getBody-tp27540894p27540894.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to