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

}

 

 

 

 

Advertisements

Responses

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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: