Hi Raju,
There is another way of calling a web service without adding a reference. But you need to create a proxy object to call that web service. Here's a sample I take from MSDN Library (Communicating with Web Services Asynchronously)
public class PrimeFactorizer : System.Web.Services.Protocols.SoapHttpClientProtocol {
public PrimeFactorizer(string strURL) { this.URL = strURL; }
public long[] Factorize(long factorizableNum) {
object[] results = this.Invoke("Factorize", new object[] {
factorizableNum});
return ((long[])(results[0]));
}
public System.IAsyncResult BeginFactorize(long factorizableNum, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Factorize", new object[] {
factorizableNum}, callback, asyncState);
}
public long[] EndFactorize(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((long[])(results[0]));
}
}
Note that if you created your own web service, it is best to use WSDL.EXE from Visual Studio to generate the proxy object.
Your c
Enter your message below
Sign in or Join us (it's free).