Click here to Skip to main content
15,885,855 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My current response is :

<?xml version="1.0" encoding="UTF-8"?>
 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://webservice.com/types/">
  <env:Body>
    <<i>ns0:ABCResponseElementResponse >
      Result
    </ns0:ABCResponseElementResponse>
  </env:Body>
</env:Envelope>


Required Output is :

<?xml version="1.0" encoding="UTF-8"?>
 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ">
  <env:Body>
    <ABCResponseElementResponse xmlns="http://webservice.com/types/>
      Result
    </ABCResponseElementResponse>
  </env:Body>
 </env:Envelope>


All I require is to remove the xmlns:ns0="http://webservice.com/types/" tag from the root and the prefix "ns0" from the response element and add a namespace tag to response output.

The WSDL I am using is :

<definitions
     name="WebService"
     targetNamespace="http://webservice.com/"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
     xmlns:tns="http://webservice.com/"
     xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
     xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
     xmlns:tns0="http://webservice.com/types/"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    >
    <types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://webservice.com/types/"
             elementFormDefault="qualified" xmlns:tns="http://webservice.com/types/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/">
            <element name="ABCResponseElementResponse" type="string" nillable="true" />
        </schema>
    </types>
.........


Kindly help me to know the changes I need to do in order to get desired response.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900