You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Martin Swientek <ms...@gmx.de> on 2012/08/06 21:49:30 UTC
Using SoapJaxbDataFormat to marshal requests with document/literal
wrapped style
Hi,
I've got a problem calling an external CXF service with document/literal wrapped
binding style using the SoapJaxbDataFormat.
The SEI looks like this:
------------------------------------------------------------
@WebService
@SOAPBinding(style=Style.DOCUMENT, use=Use.LITERAL, parameterStyle=ParameterStyle.WRAPPED)
public interface MediationPortType {
@WebMethod(operationName="process")
@WebResult(name="processResult")
public SimpleCDR process(@WebParam(name="rawUsageEvent") RawUsageEvent rawUsageEvent);
}
------------------------------------------------------------
The SoapJaxbDataFormat is configured as follows:
------------------------------------------------------------
SoapJaxbDataFormat soap = new SoapJaxbDataFormat("com.jswiente.phd.prototype.domain",
new ServiceInterfaceStrategy(MediationPortType.class, true));
------------------------------------------------------------
The marshalled SOAP Request looks like this:
------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Envelope xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns3="com.jswiente.phd.prototype.domain">
<ns2:Body>
<rawUsageEvent>
<calledParty>+4901703097135</calledParty>
<callingParty>+4901703097135</callingParty>
<endDate>2012-08-05T21:30:57.806+02:00</endDate>
<eventSource>+496373730567643</eventSource>
<eventType>VOICE</eventType>
<flatEvent>false</flatEvent>
<recordId>10</recordId>
<sequenceNum>1</sequenceNum>
<startDate>2012-08-05T20:58:02.806+02:00</startDate>
</rawUsageEvent>
</ns2:Body>
</ns2:Envelope>
------------------------------------------------------------
The service expects the parameter wrapped, though. For example:
------------------------------------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ser="http://service.mediation.messaging.prototype.phd.jswiente.com/">
<soapenv:Header/>
<soapenv:Body>
<ser:process>
<rawUsageEvent>
<calledParty>+4901703097135</calledParty>
<callingParty>+4901703097135</callingParty>
<endDate>2012-08-05T20:20:37.505+02:00</endDate>
<eventSource>+496724224912805</eventSource>
<eventType>VOICE</eventType>
<flatEvent>false</flatEvent>
<recordId>1</recordId>
<sequenceNum>1</sequenceNum>
<startDate>2012-08-05T19:23:39.505+02:00</startDate>
</rawUsageEvent>
</ser:process>
</soapenv:Body>
</soapenv:Envelope>
------------------------------------------------------------
Is it possible to use SoapJaxbDataformat to generate a request in
document/literal wrapped style? Perhaps by adding some specific
JAX-WS annotations to the SEI?
I'm using camel 2.10.0.
Thanks in advance for your help.
Best regards
Martin Swientek