1

因此,我有一个可以在 localhost 工作的 Web 服务引用,并且可以从其生产 url ping 通,但我无法通过生产中的 Service Reference 调用访问它。我相信问题是我的防火墙。我在同一台服务器上有两个网站,每个网站都有自己的专用 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>
4

1 回答 1

0

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

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

于 2013-05-20T04:00:30.693 回答