I imported a WSDL schema into PostMan which generated the following in the Body page.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
</soap:Header>
<soap:Body>
<GetUserWSToken xmlns="http://tempuri.org/">
<request/>
</GetUserWSToken>
</soap:Body>
</soap:Envelope>
When I attempt to “Send” the SOAP call, I get the following error:
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode>
<faultstring xml:lang="en-AU">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:request. The InnerException message was 'Error in line 8 position 15. 'EndElement' 'request' from namespace 'http://tempuri.org/' is not expected. Expecting element 'Password'.'. Please see InnerException for more details.</faultstring>
Because it set it’s expecting the element password, I changed it to reflect the following with fake username/password to see if it got an authentication issue:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
</soap:Header>
<soap:Body>
<GetUserWSToken xmlns="http://tempuri.org/">
<UserName/>test</UserName>
<Password/>test</Password>
</GetUserWSToken>
</soap:Body>
</soap:Envelope>
It now fails with the below:
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode>
<faultstring xml:lang="en-AU">The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'GetUserWSToken'. End element 'GetUserWSToken' from namespace 'http://tempuri.org/' expected. Found text 'test'. Line 8, position 22.</faultstring>
I’m very new to SOAP and wonder if anyone knew what I was doing wrong here?