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);
}
}
|