Leverage Pocketsoap Links WebService (1)---. net

Source: Internet
Author: User
Tags soap soap client xml parser
web| Link Pocketsoap
This is a SOAP client COM component for the Windows family, originally targeted in PocketPC (hence the name), there is ALS o A Win32 version this works on Windows 95/98/me/nt4/2000/xp. The package includes a HTTP transport for making HTTP based SOAP requests, however the transport was separate from the main SOAP core, so no other transports can is easily added. James Clark ' s excellent Expat XML Parser is used for parsing the response SOAP messages.
If you want to perform the code given in the article you need to download and install Pocketsoap
As for how to build webservice, I'm not going to bother to say that the main purpose of today is to use pocketsoap to make things easier.
1. Using Pocketsoap in. Net
If you are using the system default option during POCKETSOAP installation, you will find psoap32.dll files in the C:\Program Files\simonfell\pocketsoap1.2\.
We need to import this pocketsoap NAMESPACE
For example:
Using pocketsoap;using system;public class test{    public static void Main (string[] args)  & Nbsp;  {        console.writeline ("Starting C # PocketSOAP for Echostring ");         coenvelope soap=new CoEnvelope ();         httptransport h=new HTTPTransport ();         soap. Methodname= "echostring";         soap. Uri= "Urn:xmethodsinterop";         soap. Parameters.create ("InputString", "Hello World", "", NULL, NULL);         h. SOAPAction = "http://soapinterop.org/";         h.send ("http:// WWW.WHITEMESA.NET/INTEROP/STD ", soap. Serialize ());         soap. Parse (h, null);        &nbsP Console.WriteLine (soap. Parameters.get_item (0). Value);     }}
 add PocketSOAP.dll 
csc test.cs/r:pocketsoap.dll
Example 2:
Using pocketsoap;using system;public class test{    public static void Main (string[] args)  & Nbsp;  {        console.writeline ("Starting C # PocketSOAP for Echostringarray ");         coenvelope soap = new Coenvelope ();         httptransport h = new HTTPTransport ();         soap. methodname = "Echostringarray";         soap. uri        = "http://soapinterop.org/";                 object[] sa = new object[2];         sa[0] = "Hello";         sa[1] = "Goodbye";         soap. Parameters.create ("Inputstringarray", SA, "" ", Null,null);        console.writeline ("Encoding style:" +soap.) Encodingstyle);         console.writeline ("Method Name:" +soap.) methodname);         console.writeline ("URI:" +soap.) URI);         console.writeline (soap. Serialize ())         h.soapaction = "http://soapinterop.org/";         h.send ("HTTP://WWW.WHITEMESA.NET/INTEROP/STD", soap. Serialize ());         soap. Parse (h, null);         object[] res = (object[]) soap. Parameters.get_item (0). Value;        console.writeline (Res[0]);         console.writeline (Res[1]);    &nbsp}} Example 3:
Using system;using system.collections;using pocketsoap; public class Xmlistings{    public static void Main ()     {         coenvelope soap=new coenvelope ();         httptransport h=new HTTPTransport ();         h.soapaction= "";         soap. Methodname= "Getallsoapservices";         soap. Uri= "Urn:xmethodsservicesmanager";         h.send ("http:// Www.xmethods.net/soap/servlet/rpcrouter ", soap. Serialize ());                 Soap. Parse (h, null);         object[] U = (object[]) soap. Parameters.get_item (0). Value;        foreach (Isoapnode x in U)         {             Console.WriteLine (X.nodes.get_itembyname ("name", ""). Value);             console.writeline (x.Nodes.get_ Itembyname ("owner", ""). Value);             console.writeline (x.Nodes.get_ Itembyname ("Serverimplementation", ""). Value);             console.writeline ("------------ -------------------");        }         RETURN;   &NBSP}}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.