Invoke web service with Http Get : SOAP Serialization « Network « C# / CSharp Tutorial






using System;
using System.IO;
using System.Net;
using System.Xml.XPath;

public class GetNumberInStockHttpGet {

  public static void Main(string [] args) {
    WebRequest request = WebRequest.Create("http://127.0.0.1/Query.asmx/GetNumber?pCode=1111");
    request.Method = "GET";

    WebResponse response = request.GetResponse( );
    Stream stream = response.GetResponseStream( );

    XPathDocument document = new XPathDocument(stream);
    XPathNavigator nav = document.CreateNavigator( );
    XPathNodeIterator nodes = nav.Select("//int");
    Console.WriteLine(nodes.Current);
  }
}








33.31.SOAP Serialization
33.31.1.Serializes a class with Soap
33.31.2.Serialize object to SOAP message
33.31.3.Serialization of an object list in SOAP
33.31.4.Soap Custom Serialization
33.31.5.Invoke web service with Http Get
33.31.6.Call Soap service
33.31.7.Use SoapAttributeOverrides
33.31.8.Deserialize Soap type xml