Home:ALL Converter>How to remove specific xmlns:ns from SOAP response

How to remove specific xmlns:ns from SOAP response

Ask Time:2018-05-31T18:24:57         Author:Vijay

Json Formatter

Below is my sample SOAP response.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns4:createReservationResponse xmlns:ns2="http://www.xyz2.com/documentation/createEnvironment/input" xmlns:ns3="http://webservices.xyz.com/documentation/reservations/createReservation/output" xmlns:ns4="http://webservices.xyz.com/documentation/reservations/createReservation/input" xmlns:ns5="http://webservices.xyz.com/documentation/reservations/cancelReservation/input" xmlns:ns6="http://webservices.xyz.com/documentation/reservations/cancelReservation/output">
 <return>
<!-- response data -->
</return>
 </ns4:createReservationResponse>
   </soap:Body>
</soap:Envelope>

How do i remove unwanted namespaces here in my case xmlns:ns2, xmlns:ns4, xmlns:ns5 and xmlns:ns6. I should only keep xmlns:ns3 in the response.

What should i change in my wsdl so that i can get the expected response as below.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
          <ns4:createReservationResponse xmlns:ns3="http://webservices.xyz.com/documentation/reservations/createReservation/output">
     <return>
    <!-- response data -->
    </return>
     </ns4:createReservationResponse>
       </soap:Body>
    </soap:Envelope>

Please help me out from this.

Thanks in adv.

Author:Vijay,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50622071/how-to-remove-specific-xmlnsns-from-soap-response
yy