You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by geecxf <am...@ge.com> on 2013/04/19 19:02:38 UTC

SOAP body is always empty when making a call using invoke

I've been struggling for the past day with an issue where when I call
client.invoke() my soap envelope and headers look good but the body is empty
even though I am passing a parameter. I've stepped through the code like
crazy and I can see where opportunities to write the body are missed.

For example, my WSDL is generating an operation with no message parts.
Here's the relevant part of the WSDL which is from WSO2's super-crappy STS
(sorry WSO2 guys but it's true, your supposedly "WS-Trust" compliant STS is
really quite pitiful--end rant).

<wsdl:binding name="wso2carbon-stsSoap12Binding"
type="tns:wso2carbon-stsPortType">
 <wsp:PolicyReference URI="#UTOverTransport"/>
 <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/> 
 <wsdl:operation name="IssueToken">
  <soap12:operation soapAction="" style="document"/>
   <wsdl:input><soap12:body use="literal"/></wsdl:input>
   <wsdl:output><soap12:body use="literal"/></wsdl:output>
  </wsdl:operation>
 </wsdl:binding>

I believe this sorry excuse for a SOAP operation expects me to include the
RST in the body. I've constructed my client from the WSDL. However, when I
inspect the client, the binding info shows an OperationInfo called
IssueToken, a MessageInfo of type INPUT called IssueTokenRequest but the
MessageInfo has no message parts....

I construct my RST as a DOMSource object instance.

Finally, I call:

client.invoke("IssueToken", document);

However, the request has nothing in the body:

---------------------------
ID: 1
Address:
https://3.39.65.51:9443/services/wso2carbon-sts.wso2carbon-stsHttpsSoap12Endpoint/
Encoding: UTF-8
Http-Method: POST
Content-Type: application/soap+xml; action="IssueToken"
Headers: {Accept=[*/*]}
Payload: <soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
soap:mustUnderstand="true"><wsu:Timestamp
wsu:Id="TS-1"><wsu:Created>2013-04-19T16:44:10.633Z</wsu:Created><wsu:Expires>2013-04-19T17:44:10.633Z</wsu:Expires></wsu:Timestamp><wsse:UsernameToken
wsu:Id="UsernameToken-2"><wsse:Username>sos</wsse:Username><wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">yourmother</wsse:Password></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body/></soap:Envelope>
--------------------------------------

I put a breakpoint in getcontent and various other places to try to
understand what is going on. I can see where
AbstractOutDatabindingInterceptor has a chance to write to the body but the
fact that the MessageInfo had no message parts means nothing is ever written
there.

What am I doing wrong?

Am I using the wrong type for the parameters? Hopefully it's something
obvious. 







--
View this message in context: http://cxf.547215.n5.nabble.com/SOAP-body-is-always-empty-when-making-a-call-using-invoke-tp5726547.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SOAP body is always empty when making a call using invoke

Posted by geecxf <am...@ge.com>.
Just an update to this:

I was able to get a response from the WSO2 STS by essentially injecting
MessagePartInfo object instances into the BindingOperationInfo instance
created from the WSDL.

Still this seems like a hack to me and I'm sure there must be an easier way
to do this and I'm simply missing it because it's far too obvious.



--
View this message in context: http://cxf.547215.n5.nabble.com/SOAP-body-is-always-empty-when-making-a-call-using-invoke-tp5726547p5726548.html
Sent from the cxf-user mailing list archive at Nabble.com.