0

My SOAP server is returning the following response:

   <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://uws.provider.com/">
       <SOAP-ENV:Body>
          <ns1:PerformTransactionResult>
             <status>201</status>
          </ns1:PerformTransactionResult>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

But I need the following structure:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <ns2:PerformTransactionResult xmlns:ns2="http://uws.provider.com/">
         <status>0</status>
      </ns2:PerformTransactionResult>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope> 
Sarvar Nishonboyev
  • 12,262
  • 10
  • 69
  • 70
  • Can you show the code which is creating the response. – Nigel Ren Mar 25 '19 at 13:26
  • Are you certain that this is required? To any sane XML parser, those two responses are completely equivalent: the `xmlns:...` attribute defines a local alias which takes effect for all child nodes, so in both cases `PerformTransactionResult` is in the `http://uws.provider.com/` namespace, and `status` is in the null namespace. Forcing the different formatting may therefore require using string manipulation to avoid the XML generation code choosing the representation. – IMSoP Mar 25 '19 at 13:39

0 Answers0