代码之家  ›  专栏  ›  技术社区  ›  IrishChieftain

将Web服务部署到生产服务器

  •  0
  • IrishChieftain  · 技术社区  · 6 年前

    我的本地计算机上有一个旧式的.NET Web服务在IIS中正确运行:

    http://localhost/MyService/MyService/Service1.asmx

    我添加了一个Web引用,并将其属性设置为dynamic,这样就可以简单地更改Web.config文件中的URL。在部署到暂存服务器之前,我对其进行了如下配置:

    <client>
      <endpoint address="http://staging.myserver.net/WSTest/WSTest/Service1.asmx"
        binding="basicHttpBinding" bindingConfiguration="Service1Soap"
        contract="ServiceReference1.Service1Soap" name="Service1Soap" />
    </client>
    

    http://staging.myserver.net/MyService/service1.asmx

    但是,我需要解决如下问题,因为这是外部客户端访问它的方式:

    http://staging.myserver.net/MyService/MyService/service1.asmx

    我看不出我的临时服务器上的IIS配置设置有什么问题。我错过什么了吗?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Lex Li    6 年前

    一般来说,您可以在网站下自由设置应用程序,即使是嵌套方式。

    Website
    |
    --Application MyService
      |
      --Application MyService (here you host the .asmx)
    

    就像你发现的,这很容易实现。

    不过,也有一些危险信号,

    1. .asmx太旧了,大多数人都升级到基于REST/图形的web API。