Posted by: R Manimaran | July 7, 2008

Selecting the Webservice location at runtime

We can use the Asp.net config file to store the location of out web service. Later we can use this value at the runtime to connect to the web service 

Ex. 

 

 

Configuration file setting

Configuration file setting

Client side Calling

 

public void btn_CallWebService(Object sender, EventArgs e)

{

    HelloWordService service=new HelloWorldService( );

    service.Url=System.Configuration.ConfigurationSettings.AppSettings[“WSUrl”];

    Lable1.Text=service.HelloWorld( );

}

 

 

 

 


Responses

  1. hmm, now i see the code u write for your company ;)


Leave a response

Your response:

Categories