Code
Xmldocument vxmldoc = new xmldocument ();
Filestream vstream = new filestream (@ "Soap. xml", filemode. Open, fileaccess. Read );
Vxmldoc. Load (vstream );
String vpostdata = vxmldoc. outerxml;
Byte [] vpostbytes = system. Text. encoding. ASCII. getbytes (vpostdata );
Uri vuri = new uri(this.txt URI. Text );
Httpwebrequest vrequest = (httpwebrequest) httpwebrequest. Create (vuri );
Vrequest. method = "Post ";
Vrequest. contenttype = "text/XML; charset = UTF-8 ";
Vrequest. contentlength = vpostbytes. length;
Vrequest. headers. Add (string. Format ("soapaction: \" http://tempuri.org/%0%\ "", this.txt methodname. Text ));
Vrequest. Timeout = 5000;
Stream vrequeststream = vrequest. getrequeststream ();
Vrequeststream. Write (vpostbytes, 0, vpostbytes. Length );
Vrequeststream. Flush ();
Vrequeststream. Close ();
Httpwebresponse vresponse = (httpwebresponse) vrequest. getresponse ();
Stream vresponsestream = vresponse. getresponsestream ();
Streamreader vreader = new streamreader (vresponsestream );
String vresult = vreader. readtoend ();
Vreader. Close ();
Vresponsestream. Close ();
Vresponse. Close ();
MessageBox. Show (vresult );
Soap. xml
Code
<? XML version = "1.0" encoding = "UTF-8"?>
<Soap: envelope xmlns: xsi = "The http://www.w3.org/2001/XMLSchema-instance" xmlns: XSD = "The http://www.w3.org/2001/XMLSchema" xmlns: Soap = "The http://schemas.xmlsoap.org/soap/envelope/">
<Soap: Body>
<Gethello xmlns = "http://tempuri.org/">
<Pword> string </pword>
</Gethello>
</Soap: Body>
</Soap: envelope>