我应该进行修改,以改变在C#中的Web服务的URL? [英] What should be modified to change the URL of a web service in C#?

查看:599
本文介绍了我应该进行修改,以改变在C#中的Web服务的URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,这是前一段时间我已经通过复制生成的所有code增加了一个web服务代理类为我的应用程序(复制粘贴的.cs内容的文本)。

I have one problem and it is some time ago I have added a Webservice proxy class into my application by copying all the generated code (copy paste the text of the .cs content).

和它的工作!

但现在我需要改变这个Web服务代理类使用的网址,我不知道什么,在哪里在code改变。

But now I need to change the URL used by this web-service proxy class and I am not sure what and where to change in the code.

我AP preciate如果你可以给我一个线索,可以引导我找到合适的地方,这样我可以更新Web服务的URL。

I would appreciate if you can give me a clue that can guide me to find the right place so that I can update the url of the web service.

推荐答案

您使用的web.config应该更改URL。
如果你去添加的Web引用的属性,你会看到一个名为'URL行为属性。设置的,为动态的值,并提供该URL。这将使在web.config中的条目,只要更改的条目,该URL将采取。
更多信息这里

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.

这篇关于我应该进行修改,以改变在C#中的Web服务的URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆