-1
Web.config
Inside the tag add your new url to the Web Reference.
<appSettings>
<add key="urlWebService" value="http://www.google.com" />
</appSettings>
When you instantiate the proxy class of your Web Service, change the URL to the url registered on the web.config:
using (var webService = new Foo.WebService())
{
webService.Url = ConfigurationManager.AppSettings["urlWebService"];
}
Don’t forget that the names I used (google site, Foo.Webservice) are fictitious names, because I don’t know the name of your project’s templates.
What change ?
– Pedro
@Pedro, I added an image to make it easier to understand
– Harry
It wasn’t clear. What you specifically need ?
– Pedro
@Pedro, did you see the image? When you add a webservice with the add web add option, it already adds the path in Properties, I want to take the path of the web.config
– Harry
You need to create an instance of your Webreference class. Next you should use the Url property.
– Pedro
@Peter, when you have time, could post a practical example as an answer to this question, thank you
– Harry
posted an example. see if it’s useful for what you need.
– Pedro