What should be modified to change the URL of a web service in C#?

醉酒当歌 提交于 2019-11-27 15:48:12

You should change the URL using web.config. If you go to the properties of the web reference added, you should see a property named "'URL Behavior'". Set the value of that to "dynamic" and supply the URL. That would make an entry in the web.config and whenever you change that entry, that URL will be taken. More info here.

If it´s a generated asmx webservice proxy the proxy class have a property - URL.
You can set the URL property where you create the proxy object or you can hard code it into the proxy class.
By default a generated proxy class have code in the constructor to set the URL property from application settings.

Use the URL property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!