【问题标题】:Internal Webservice IIS .NET内部 Web 服务 IIS .NET
【发布时间】:2015-08-04 14:43:17
【问题描述】:

我们在一台 IIS 7.5 服务器上有两个站点。站点 B 需要通过 SOAP 服务与站点 A 通信(站点 B 曾经是外部的,因此使用 SOAP,但现在它们在同一台服务器上)。

如何在站点 B 的网络配置中引用站点 A 而无需通过绝对路径 http://www.example.com/webservice/endpoint.asmx 进行往返?

基本上我想要

      <endpoint address="foolocalhost/webservice/endpoint.asmx"
    binding="basicHttpBinding" bindingConfiguration="WebServiceSoap"
    contract="Reference.WebServiceSoap" name="WebServiceSoap" />

而不是

      <endpoint address="http://www.example.com/webservice/endpoint.asmx"
    binding="basicHttpBinding" bindingConfiguration="WebServiceSoap"
    contract="Reference.WebServiceSoap" name="WebServiceSoap" />

我是否需要更改我的主机文件以将 foolocalhost 设置为绑定?或者有没有更简单的方法,只使用 IIS GUI?

【问题讨论】:

    标签: .net web-services iis soap internal


    【解决方案1】:

    设置主机记录似乎是最简单的方法。 IIS 7.5 不需要重新启动来获取更改,因此是否有其他解决方案可以忽略不计。此方法不会破坏任何生产环境。

    在本例中要在主机中输入的记录是

    127.0.0.1 foolocalhost
    

    然后您将进入 IIS 中的绑定并输入绑定,例如

    类型 - http 主机名 - foolocalhost 端口 - 80 IP 地址 - *

    现在,当站点 B 尝试与站点 A 通信时,它不应离开网络,因为它会解析回自身。

    进一步阅读如何编辑主机:https://www.youtube.com/watch?feature=player_embedded&v=5d4GykliBEw

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-22
      • 1970-01-01
      • 2010-12-01
      • 1970-01-01
      • 2012-09-21
      • 2020-11-16
      • 2013-11-26
      • 1970-01-01
      相关资源
      最近更新 更多