求教通过修改web.config而修改webservice服务器url的例子。

liyin_first 2003-01-05 11:19:00
如题。谢谢!
...全文
851 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lin9703 2003-01-27
  • 打赏
  • 举报
回复
很好呀 !其实有两种方法呀!·
saucer 2003-01-06
  • 打赏
  • 举报
回复
try something like

web.config:
<configuration>
<appSettings>
<add key="wsURL" value="http://....." />
</appSettings>
</configuration>


in your code:
YourWebService.Url = ConfigurationSettings.AppSettings["wsURL"];


also
"Simply choose the properties of the web service and change the "Url Behavior" from "Static" to "Dynamic". This will automatically create an entry in the <appSettings> section of the Web.Config file that contains the Url string. The constructor of the Web Service proxy class is automatically changed to set the Url property to the value stored in Web.Config.
"
see
Setting Web Service References Dynamically
http://www.aspalliance.com/shark/articles/WSDL/Wsdl.aspx
liyin_first 2003-01-06
  • 打赏
  • 举报
回复
3ks saucer(思归, MS .NET MVP)
liyin_first 2003-01-05
  • 打赏
  • 举报
回复
hlep

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧