Click here to Skip to main content
16,018,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Below is my complete SOAP Fromat. How can i make request to Webservice method and read response. Iam able to call the method but unable to read the response.


The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /RechargeAll.asmx HTTP/1.1
Host: myserverAPI.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://myserverAPI.net/RechargeMobile"


<soap:envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:header>
    <mobilesoapheader xmlns="http://myserverAPI.net/">
      <strusername>string</strusername>
      <strpassword>string</strpassword>
      <strcode>string</strcode>
    </mobilesoapheader>
  </soap:header>
  <soap:body>
    <rechargemobile xmlns="http://myserverAPI.net/">
      <refnumber>string</refnumber>
      <custmobilenumber>string</custmobilenumber>
      <rechargetype>string</rechargetype>
      <opearatoralias>string</opearatoralias>
      <regionalias>string</regionalias>
      <amount>double</amount>
      <ipaddress>string</ipaddress>
    </rechargemobile>
  </soap:body>
</soap:envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length


<soap:envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:body>
    <rechargemobileresponse xmlns="http://myserverAPI.net/">
      <rechargemobileresult>string</rechargemobileresult>
    </rechargemobileresponse>
  </soap:body>
</soap:envelope>




Help me, Thanks in advance..
Posted
Updated 9-Aug-13 2:27am
v2

 
Share this answer
 
// create web service object.
WebService ws = new WebService();

// create Data Set object.
DataSet ds = new DataSet();

// call to the web service method and that returns the xml output and store in xml element object.
XmlElement xE = ws.EmployeeList();

XmlNodeReader xNR = new XmlNodeReader(xE);

// the xml data store in dataset.
ds.ReadXml(xNR);


You can use dataset in a web page.
 
Share this answer
 

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