如何更改我的Web服务的URL?

时间:2022-11-29 07:28:47

If I change the url in the web.config file will the change be reflected in the .disco, .discomap, and .wsdl files that are in the WebReferences folder?

如果我更改web.config文件中的url,更改是否会反映在WebReferences文件夹中的.disco,.discomap和.wsdl文件中?

[Edit]

I'm using asp.net 2005

我正在使用asp.net 2005

3 个解决方案

#1


2  

The change will not, as far as I'm aware, be reflected in all the other files. However, if you change the URL in web.config, your application will call the web service from the new URL at run-time. Check out this blog entry. (No, it's not one of mine!)

据我所知,改变不会反映在所有其他文件中。但是,如果更改web.config中的URL,则应用程序将在运行时从新URL调用Web服务。查看此博客条目。 (不,这不是我的!)

#2


1  

Assuming you mean in the client, set the Url property at execution time. You can configure this from anywhere you want, so long as you have access to the value at the appropriate time.

假设您在客户端中表示,请在执行时设置Url属性。只要您可以在适当的时间访问该值,就可以从任何您想要的地方进行配置。

#3


0  

As I can remember WSDL file contains the binding(s) (URL mappings) of your WS. So if you change the URL on your machine (in WSDL, Disco, etc.) that's enough.

我记得WSDL文件包含WS的绑定(URL映射)。因此,如果您更改机器上的URL(在WSDL,Disco等中)就足够了。

On the other hand don't forget to regenerate client proxies. They have to reflect WSDL changes.

另一方面,不要忘记重新生成客户端代理。他们必须反映WSDL的变化。

#1


2  

The change will not, as far as I'm aware, be reflected in all the other files. However, if you change the URL in web.config, your application will call the web service from the new URL at run-time. Check out this blog entry. (No, it's not one of mine!)

据我所知,改变不会反映在所有其他文件中。但是,如果更改web.config中的URL,则应用程序将在运行时从新URL调用Web服务。查看此博客条目。 (不,这不是我的!)

#2


1  

Assuming you mean in the client, set the Url property at execution time. You can configure this from anywhere you want, so long as you have access to the value at the appropriate time.

假设您在客户端中表示,请在执行时设置Url属性。只要您可以在适当的时间访问该值,就可以从任何您想要的地方进行配置。

#3


0  

As I can remember WSDL file contains the binding(s) (URL mappings) of your WS. So if you change the URL on your machine (in WSDL, Disco, etc.) that's enough.

我记得WSDL文件包含WS的绑定(URL映射)。因此,如果您更改机器上的URL(在WSDL,Disco等中)就足够了。

On the other hand don't forget to regenerate client proxies. They have to reflect WSDL changes.

另一方面,不要忘记重新生成客户端代理。他们必须反映WSDL的变化。