Hi:
I am trying to make a call to a WS using the Client approach
http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html
http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html (I have used
wsdl2java to generate the service classes)
However, when I see the SOAP Message generated by CXF, it is wrapping the
request, which causes the WS being called to not accept the request. How can
I tell the client to use BARE as the SOAP Parameter style either
programmatically or using the Spring configuration?
Using CXF 2.1.3, JSE 1.5
<!-- CSM Web Service Client -->
<jaxws:client id="csmService"
serviceClass="com.areva.csm.schema.ICsmService"
address="http://localhost:8080/csmMockup/UpdateImportExportRequestTargetStatus"
username="mmi"
password="mmi">
<jaxws:binding>
<soap:soapBinding mtomEnabled="false" version="1.2"/>
</jaxws:binding>
</jaxws:client>
URL url = CSMService.class.getClassLoader().getResource("csm.wsdl");
CSMService csmService = new CSMService(url);
ICsmService csmPort = csmService.getCSMPort();
BindingProvider portBP = (BindingProvider) csmPort;
portBP.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
"mmi");
portBP.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
"mmi");
portBP.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:8080/csmMockup/UpdateImportExportRequestTargetStatus");
final ObjectFactory of = new ObjectFactory();
final UpdateImportExportRequestTargetStatus status =
new UpdateImportExportRequestTargetStatus();
status.setRequestId(new BigDecimal("123"));
status.setSequenceId(of.createUpdateImportExportRequestTargetStatusSequenceId("456"));
status.setTargetId(of.createUpdateImportExportRequestTargetStatusTargetId("789"));
status.setTargetStatus(ImportExportTargetStatus.SUCCESSFUL);
status.setTypeId(of.createUpdateImportExportRequestTargetStatusTypeId("012"));
// Make the CSM WS Client call
final SubmitResponse response =
csmPort.updateImportExportRequestTargetStatus(status);
SOAP Message generated by CXF
POST /csmMockup/UpdateImportExportRequestTargetStatus HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Connection: Keep-Alive
Authorization: Basic bW1pOm1taQ==
Accept: *
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.5.0_15
Host: 127.0.0.1:8082
Content-Length: 707
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<ns2:UpdateImportExportRequestTargetStatus
xmlns="http://schemas.datacontract.org/2004/07/Areva.Csm.Service.DC"
xmlns:ns2="http://areva.com/2008/11/19/001/Csm"
xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/"> <!--
This is the extra element, wrapping the request which causes the problem -->
<ns2:request>
<RequestId>123</RequestId>
<SequenceId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true"/>
<TargetId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true"/>
<TargetStatus>Successful</TargetStatus>
<TypeId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true"/>
</ns2:request>
</ns2:UpdateImportExportRequestTargetStatus>
</soap:Body>
</soap:Envelope>
--
View this message in context:
http://www.nabble.com/How-to-set-the-SOAP-style-programmatically-when-using-CXF-to-make-a-call-to-a-WS--tp21407235p21407235.html
Sent from the cxf-user mailing list archive at Nabble.com.