2013-07-10 92 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)添加端口入站规则。

谢谢。

相关问题