Adding web service ref

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am having a web application developed with me which contains a reference to a web service which is on the local network.Now I am creating the setup project for the web application. I will be deploying the application on another machine and I want to change the web reference that I have added.

As we do it for the database connection string which we put in the we.config file and could be changed later at any time. Is there any such method for changing the web reference??

Thanks in advance
 
There is something called a "dynamic URL"

try this
http://msdn.microsoft.com/library/en-us/vbcon/html/vblrfUrlBehaviorPropertyProjectItemObject.asp

To do this in VS, in Solution Explorer, highlight the Web reference in the
Properties window and change the URL behavior property from static to
dynamic. Now a corresponding appSettings section will be added to your
Web.config


Kshitij said:
Hi,

I am having a web application developed with me which contains a reference
to a web service which is on the local network.Now I am creating the setup
project for the web application. I will be deploying the application on
another machine and I want to change the web reference that I have added.
As we do it for the database connection string which we put in the
we.config file and could be changed later at any time. Is there any such
method for changing the web reference??
 
You can change the URL Property of your webservice reference object to the desired value.

MyWS ows = new MyWs();
ows.Url = ConfigurationSettings.AppSettings["MyWSURL"].ToString();

You can place the url in your web.config
 
Back
Top