views:

30

answers:

2

I have a solution with a number of projects in.. One of these projects is a web application, another is a web service. The web app references the web service, and uses the methods in there.

In production, the web application will be hosted on one server, while the xml web service will be on another.

My question is, how do i deploy this? I've "published" the application to the correct server, however what do i do with the xml web service? and how can i configure my web application to point to the other server, rather than try and use localhost....

+1  A: 

When you add the proxy to you web application, you can set it to be dynamic url. This will create a config file entry that can be set during your deployment. Click on the Web Reference in the Solution Explorer, change the URL Behavior from Static to Dynamic from properties. An app.config file will be created with a key.

CodeToGlory
+1  A: 

You generally won't leave your web service proxy classes with their default URL in production code. You can configure the production web service url in your web.config class and then have something like

MyWebService svc = new MyWebService();
svc.Url = WebConfigurationManager.AppSettings["MyWebService"];

Something along those lines should get you what you need.

Clyde