1

First I have generated pojo class using jsonschema2pojo plugin using WSDL file.

My WSDL file contains Header and Body.

Body Root Pojo looks like this:

public class SubmitCustomerOrderRequest { 

    @XmlElement(required = true)
    protected List<Order> order;
 }

Header looks like this:

public class MessageHeader {
   .....
}

Now in a process class of camel i am putting SubmitCustomerOrderRequest (Here this pojo only consider body not header) into body like this:

submitCustomerOrderRequest.setOrder(orderList);
exchange.getIn().setBody(submitCustomerOrderRequest);

Now in the route i am marshalling using this concept

SoapJaxbDataFormat soapDF = new SoapJaxbDataFormat("org.com.model",
new ServiceInterfaceStrategy(order.class, true));

And marshalling into xml like this:

.marshal(soapDF)

Now here the problem here is, its generating xml but without header, how to include header also in the process class so that while converting into xml, its generates header also with body

Its generating like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Envelope xmlns:ns2="org.com" xmlns:ns3="org.com.something">
   <ns2:Body>
      <ns3:submitCustomerOrderV3Request>          
      </ns3:submitCustomerOrderV3Request>
   </ns2:Body>
</ns2:Envelope>

whereas i need like this with header:

<SOAP-ENV:Envelope xmlns:SOAP-ENV=org.com>
   <SOAP-ENV:Header>
      <messageHeader xmlns=org.om>
      </messageHeader>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <ns2:submitCustomerOrderV3Request xmlns:ns2=org.com>
      </ns2:submitCustomerOrderV3Request>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Any help would be appreciable.

Ken White
  • 123,280
  • 14
  • 225
  • 444
Sandeep
  • 11
  • 1

0 Answers0