【问题标题】:Web Service Error "There was no endpoint listening at..." Firewall ConcernWeb 服务错误“没有端点正在侦听...”防火墙问题
【发布时间】:2013-05-20 00:48:24
【问题描述】:

所以我有一个在本地主机上工作的 Web 服务服务引用,可以从其生产 url ping,但我无法通过生产中的服务引用调用访问它。我相信问题是我的防火墙。我在同一台服务器上有两个网站,每个网站都有自己的专用 IP 地址。我正在尝试从第一个网站调用第二个网站上的 Web 服务。如果我在生产服务器上打开浏览器,我无法导航到任何一个网站。

错误描述:在 http://[209.112.245.103]/Services/OfferService.asmx 上没有可以接受消息的端点侦听。这通常是由不正确的地址或 SOAP 操作引起的。有关详细信息,请参阅 InnerException(如果存在)。

内部异常:无法连接到远程服务器

调用网站在同一台服务器上(当然是不同的 IP),并通过服务引用调用 Web 服务:

 Dim offerService As New ServiceReferenceOffer.OfferServiceSoapClient("OfferServiceSoap")

offerService.BroadcastOfferChange(offer.PropertyID, offer.OfferID, offer.ResultResponse)

而我的 web.config 包含以下服务端点信息:

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="OfferServiceSoap" />
                <binding name="ConversationServiceSoap" />
            </basicHttpBinding>
            <customBinding>
                <binding name="OfferServiceSoap12">
                    <textMessageEncoding messageVersion="Soap12" />
                    <httpTransport />
                </binding>
                <binding name="ConversationServiceSoap12">
                    <textMessageEncoding messageVersion="Soap12" />
                    <httpTransport />
                </binding>
            </customBinding>
        </bindings>
        <client>
            <endpoint address="http://209.112.245.103/Services/ConversationService.asmx"
                binding="basicHttpBinding" bindingConfiguration="ConversationServiceSoap"
                contract="ServiceReferenceConversation.ConversationServiceSoap"
                name="ConversationServiceSoap" />
            <endpoint address="http://209.112.245.103/Services/ConversationService.asmx"
                binding="customBinding" bindingConfiguration="ConversationServiceSoap12"
                contract="ServiceReferenceConversation.ConversationServiceSoap"
                name="ConversationServiceSoap12" />
            <endpoint address="http://209.112.245.103/Services/OfferService.asmx"
                binding="basicHttpBinding" bindingConfiguration="OfferServiceSoap"
                contract="ServiceReferenceOffer.OfferServiceSoap" name="OfferServiceSoap" />
            <endpoint address="http://209.112.245.103/Services/OfferService.asmx"
                binding="customBinding" bindingConfiguration="OfferServiceSoap12"
                contract="ServiceReferenceOffer.OfferServiceSoap" name="OfferServiceSoap12" />
        </client>
    </system.serviceModel>

【问题讨论】:

  • 检查端点设置是否在 web.config 上。另外,请尝试使用其他工具进行连接,例如 SOAPUI。
  • 我在 web.config 中有我的端点设置。而且,如果我错了,请纠正我,但由于我可以在浏览器中 ping http://[209.112.245.103]/Services/OfferService.asmx,我认为 SoapUI 无法进一步帮助我......

标签: asp.net web-services firewall


【解决方案1】:

您的配置正确。我刚刚访问了您的服务器,一切正常(因此与代码无关)。

由于站点和网站在同一个服务器,你可能需要使用不同的 IP 或地址来访问 wcf(尝试 127.0.0.1、localhost 或内部服务器 ip)。

【讨论】:

  • 我也可以修改 localhosts 文件以将 dns 名称解析为本地 ip...
  • 是的,将 dns 名称添加到主机是一个不错的选择,因为您可以在任何地方使用相同的配置。
猜你喜欢
  • 2015-07-08
  • 2021-11-15
  • 2012-08-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-30
相关资源
最近更新 更多