2013-05-20 42 views
1

所以我有一個web服務服務引用,它工作localhost,可以從它的生產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> 
+0

檢查終端設置是否在web.config上。另外,嘗試連接一個不同的工具,如SOAPUI。 –

+0

我確實在web.config中有我的端點設置。並糾正我,如果我錯了,但因爲我可以在瀏覽器中ping http:// [209.112.245.103] /Services/OfferService.asmx我不認爲SoapUI可以進一步幫助我... –

回答

0

您的配置是正確的。我只是訪問你的服務器,一切都很好(所以它不是代碼相關的)。由於網站和網站位於同一服務器,因此您可能需要使用不同的IP或地址才能訪問wcf(嘗試127.0.0.1,本地主機或內部服務器ip)。

+0

本地IP得到它非常感謝! –

+1

我也可以修改localhosts文件來解析dns名稱到本地ip ... –

+0

是的,將dns名稱添加到主機是一個不錯的選擇,因爲您可以在任何地方使用相同的配置。 – lstern