【问题标题】:Deploy time Webservice location部署时间 Webservice 位置
【发布时间】:2008-10-15 12:52:11
【问题描述】:

在我的 Visual Studio Web 应用程序项目中,我正在添加对 Web 服务的引用。当我添加 Web 引用时,会生成以下文件列表。

  • Reference.map
  • Reference.vb
  • Reference.disco
  • Reference.wsdl

所有这些文件都包含指向 Web 服务的 url。即使我将它移到没有视觉工作室的机器上,它也能正常工作。但是如果我打算更改 Web 服务的 url,我需要通过使用记事本编辑它们来修改 所有这四个文件

除此之外,有没有什么办法可以让我在配置文件中拥有 url,只需在一个地方更改它,网络服务就会指向新位置。

我正在使用框架 1.1。

【问题讨论】:

    标签: vb.net web-services url web-application-project


    【解决方案1】:

    将Web服务引用“Url Behaviour”属性设置为Dynamic,地址将在您的app.config文件中配置......

    app.config 文件应该包含类似

    的内容
        <applicationSettings>
            <Exceptions.Properties.Settings>
                <setting name="Exceptions_CentreService_CentreService" serializeAs="String">
                    <value>http://localhost/CentreServiceCompatibility/CentreService.asmx</value>
                </setting>
            </Exceptions.Properties.Settings>
        </applicationSettings>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-24
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多