|
-
November 17th, 2008, 10:56 PM
#1
Regarding Making a SOAP request
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!
-
November 18th, 2008, 12:40 AM
#2
Re: Regarding Making a SOAP request
May be you could just get the refrence of the web service you want to access in your project.
OR,
Create a proxy class and access the methods of the web service.
Regards,
MMH
Rate my post if you find it usefull. 
-
November 18th, 2008, 06:30 AM
#3
Re: Regarding Making a SOAP request
if you want to write code from scratch to access a web services yoy shoud deal with SOAP, WSDL, UDDI, DISCO and XML all by yuorself;so let the visual stadion .net (if you use it) do the hard part for you and save your time then focus on the logic of your program.
tale a look at this article:
http://www.codeproject.com/KB/webser...myservice.aspx
Please rate my post if it was helpful for you.  Java, C#, C++, PHP, ASP.NET
SQL Server, MySQL
DirectX
MATH Touraj Ebrahimi
[toraj_e] [at] [yahoo] [dot] [com]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|