2013-07-10 90 views
27

我正在開發一個WCF服務,在Window server 2003上運行IIS6。我構建了一個測試客戶端來與WCF服務進行通信,並且我得到下面的錯誤。我一直在尋找這個錯誤幾天,並通過人們對論壇的建議,但沒有運氣。任何幫助將不勝感激,非常感謝WCF錯誤 - 沒有端點偵聽

沒有端點收聽https://webbooking.infodata.uk.com/Synxis/Synxis.svc可以接受的消息。這通常是由不正確的地址或SOAP操作引起的。有關更多詳細信息,請參閱InnerException(如果存在)。

System.Net.WebException: The remote server returned an error: (404) Not Found. 
    at System.Net.HttpWebRequest.GetResponse() 
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 

Server stack trace: 
    at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) 
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 
    at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) 
    at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 

Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    at IOta2010A.ReservationSynch_SubmitRequest(ReservationSynchRequest request) 
    at Ota2010AClient.IOta2010A.ReservationSynch_SubmitRequest(ReservationSynchRequest request) in c:\Development\WorkingFolder\Webservices\SynxisNew\App_Code\OTA2010A.cs:line 57589 
    at Ota2010AClient.ReservationSynch_SubmitRequest(Security Security, DateTime& TimeStamp, String CorrelationID, String RelatesToCorrelationID, ReplyTo ReplyTo, OTA_HotelResNotifRQ OTA_HotelResNotifRQ) in c:\Development\WorkingFolder\Webservices\SynxisNew\App_Code\OTA2010A.cs:line 57601 
    at Update.Page_Load(Object sender, EventArgs e) in c:\Development\WorkingFolder\Webservices\SynxisNew\Update.aspx.cs:line 72 

客戶端配置

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.web> 
    <compilation debug="true"/> 
    </system.web> 
    <system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
      <binding name="ota2010AEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" 
       receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" 
       transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
       maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
       messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 
       allowCookies="false"> 
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
        maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
       <reliableSession ordered="true" inactivityTimeout="00:10:00" 
        enabled="false" /> 
       <security mode="Transport"> 
        <transport clientCredentialType="None" proxyCredentialType="None" 
         realm="" /> 
        <message clientCredentialType="Windows" negotiateServiceCredential="true" 
         establishSecurityContext="true" /> 
       </security> 
      </binding> 
     </wsHttpBinding> 
     </bindings> 
     <client> 
      <endpoint address="https://webbooking.infodata.uk.com/synxis/synxis.svc" 
       binding="wsHttpBinding" bindingConfiguration="ota2010AEndpoint" 
       contract="IOta2010A" name="ota2010AEndpoint" /> 
     </client> 
    </system.serviceModel> 
</configuration> 

服務配置

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 
     <add assembly="Pervasive.Data.SqlClient, Version=2.10.0.34, Culture=neutral, PublicKeyToken=C84CD5C63851E072"/> 
     </assemblies> 
    </compilation> 
    <authentication mode="Windows"/> 
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/> 
    </system.web> 
    <system.serviceModel> 
    <services> 
     <service name="Synxis" behaviorConfiguration="SynxisWCF"> 
     <endpoint address="" name="wsHttpEndpoint" binding="wsHttpBinding" contract="Synxis" /> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <diagnostics> 
     <messageLogging logEntireMessage="true" logMalformedMessages="true" 
     logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" 
     maxMessagesToLog="300" /> 
    </diagnostics> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="SynxisWCF" > 
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" externalMetadataLocation="https://webbooking.infodata.uk.com/synxis/Synxis.svc.wsdl" /> 
      <serviceDebug includeExceptionDetailInFaults="true" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 
+0

當您直接從瀏覽器打開服務URL時,您會看到什麼? – Mayo

+0

當我打開服務URL鏈接時,如預期的那樣,我看到「您已創建服務」頁面。 –

+0

在您的服務配置中,您有一個端點元素,其合約屬性值只是類/接口名稱,而它應該是一個完全限定的名稱,即namespace.Synxis – Rajesh

回答

12

你不定義服務的配置的綁定,所以你得到的默認值wsHttpBinding ,並且默認值爲securityMode\transport對於該綁定是Message

嘗試複製從客戶端的配置您綁定的配置爲您服務的配置並分配通過bindingConfiguration屬性綁定到端點:

<bindings> 
    <wsHttpBinding> 
    <binding name="ota2010AEndpoint" 
      .......> 
     <readerQuotas maxDepth="32" ... /> 
     <reliableSession ordered="true" .... /> 
      <security mode="Transport"> 
      <transport clientCredentialType="None" proxyCredentialType="None" 
         realm="" /> 
      <message clientCredentialType="Windows" negotiateServiceCredential="true" 
        establishSecurityContext="true" /> 
      </security> 
    </binding> 
    </wsHttpBinding> 
</bindings>  

(該配置的剪斷的部分以節省空間的答案)。

<service name="Synxis" behaviorConfiguration="SynxisWCF"> 
    <endpoint address="" name="wsHttpEndpoint" 
       binding="wsHttpBinding" 
       bindingConfiguration="ota2010AEndpoint" 
       contract="Synxis" /> 

然後,這會將您定義的綁定(帶有傳輸安全性)分配給端點。

+0

這是我的問題的解決方案!謝謝! –

+0

我爲您的問題測試您的解決方案,但我沒有得到答案! http://stackoverflow.com/questions/38856971/wcf-http-binding – Farshid

2

我有同樣的問題。對我來說,我注意到https使用另一個證書,該證書在到期日期方面無效。不知道爲什麼發生。我更改了Https端口號和一個新的自簽名證書。 WCFtestClinet可以通過HTTPS連接到服務器!

0

我得到了與服務訪問相同的錯誤。它在瀏覽器中工作,但當我嘗試在我的asp.net/c#應用程序中訪問它時沒有工作。我將應用程序池從appPoolIdentity更改爲NetworkService,並開始工作。看起來像是一個權限問題給我。

1
在我的情況

我的服務有功能Upload Files

,但此錯誤只顯示了在試圖上傳Big Files

所以我發現this answer以增加maxRequestLength所需值web.config

並解決問題

,如果你不進行任何上傳或下載操作,也許這個答案不會幫助你

+0

投票下來,,,你有上傳或下載操作? –

0

不同的情況,但可以幫助別人,

在我來說,窗口的防火牆是服務器上啓用,

兩個認爲可以做,

1)禁用Windows防火牆(您的風險,但它會得到的東西的工作)

2)添加端口入站規則。

謝謝。

相關問題