M_Dec
November 17th, 2008, 09:56 PM
Hi,
I need to build a SOAP request from C# to access a web service.
Following is a sample request that I have to build.
POST /gwy/test.asmx HTTP/1.1
Host: test.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://test.com/gwy/getdata"
<?xml version="1.0" encoding="utf-8"?>
<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>
<OriginatorHeader xmlns="http://test.com/gwy/">
<OriginatorId>int</OriginatorId>
</OriginatorHeader>
</soap:Header>
<soap:Body>
<getdata xmlns="http://test.com/gwy/">
<Id>int</Id>
<Name>string</Name>
</getdata>
</soap:Body>
</soap:Envelope>
Can you please let me know how to write code in C# to build the request for the above format. Appreciate if someone can help me with this.
Thanks in Advance!
I need to build a SOAP request from C# to access a web service.
Following is a sample request that I have to build.
POST /gwy/test.asmx HTTP/1.1
Host: test.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://test.com/gwy/getdata"
<?xml version="1.0" encoding="utf-8"?>
<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>
<OriginatorHeader xmlns="http://test.com/gwy/">
<OriginatorId>int</OriginatorId>
</OriginatorHeader>
</soap:Header>
<soap:Body>
<getdata xmlns="http://test.com/gwy/">
<Id>int</Id>
<Name>string</Name>
</getdata>
</soap:Body>
</soap:Envelope>
Can you please let me know how to write code in C# to build the request for the above format. Appreciate if someone can help me with this.
Thanks in Advance!