WST SOAP request body tuning

77 views
Skip to first unread message

Ренат Сулейманов

unread,
Feb 20, 2018, 5:18:05 AM2/20/18
to WST-LIST
Hi!
First of all, thanks for the cool library!
Can anyone advise me about the requests in the SOAP client? I would like to fine-tune SOAP requests from the client. I'll tell you what's the matter...

While executing requests, I get an error from the SOAP service.
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.    <S:Body>
  3.       <ns2:getAgentsResponse xmlns:ns2="http://ws.server.example.com/">
  4.          <return>
  5.             <messages>
  6.                <message>
  7.                   <message>Missing 'context' element</message>
  8.                   <type>ERROR</type>
  9.                </message>
  10.             </messages>
  11.          </return>
  12.       </ns2:getAgentsResponse>
  13.    </S:Body>
  14. </S:Envelope>

But this element exists in the request!
My SOAP request body (via WST) below:


  1. <?xml version="1.0" encoding="utf-8"?>
  2.   <SOAP-ENV:Body xmlns:ns1="http://ws.server.example.com/">
  3.     <ns1:getAgents>
  4.       <ns1:context>
  5.         <ns1:locale>ru</ns1:locale>
  6.         <ns1:loginName>user</ns1:loginName>
  7.         <ns1:password>pass</ns1:password>
  8.         <ns1:salesPointCode>WEB_SITE</ns1:salesPointCode>
  9.       </ns1:context>
  10.     </ns1:getAgents>
  11.   </SOAP-ENV:Body>
  12. </SOAP-ENV:Envelope>

If it look at the request examples in the documentation for this SOAP service, it turns out that the main difference is that the nested XML elements in them are not marked by the ns1 namespace, but only the root one!
Example SOAP request body from service document:


  1. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws.server.example.com/">
  2.   <SOAP-ENV:Body>
  3. <ns1:getAgents>
  4.   <context>
  5.     <locale>ru</locale>
  6.     <loginName>user</loginName>
  7.     <password>pass</password>
  8.     <salesPointCode>WEB_SITE</salesPointCode>
  9.   </context>
  10. </ns1:getAgents>
  11.   </SOAP-ENV:Body>
  12. </SOAP-ENV:Envelope>

Is it possible to somehow customize the SOAP request generation of WST, so that it corresponds to the example from the documentation for the service?


Thank you in advance for any advice and tips!

Reply all
Reply to author
Forward
0 new messages