[英]WCF error - There was no endpoint listening at
我正在开发一个WCF服务,在Window server 2003上运行IIS6。我已经构建了一个测试客户端来与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>
您没有在服务的配置中定义绑定,因此您将获得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" />
然后,这将为您定义的绑定(使用传输安全性)分配给端点。
我遇到过同样的问题。 对我来说,我注意到https正在使用另一个证书,该证书在到期日期方面无效。 不知道为什么会这样。 我更改了Https端口号和一个新的自签名证书。 WCFtestClinet可以通过HTTPS连接到服务器!
在我的情况下
我的服务具有Upload Files
功能
并且在尝试上传Big Files
出现此错误
所以我在web.config
找到了将maxRequestLength
增加到所需值的答案
问题解决了
如果您不进行任何上传或下载操作,这个答案可能对您没有帮助
不同的情况,但可以帮助某人,
在我的情况下,在服务器上启用了Window防火墙,
两个人认为可以做到,
1)禁用Windows防火墙(你的风险,但它会让事情工作)
2)在入站规则中添加端口。
谢谢 。
我通过服务访问得到了同样的错误。 它在浏览器中工作,但是当我尝试在我的asp.net/c#应用程序中访问它时它没有工作。 我将应用程序池从appPoolIdentity更改为NetworkService,然后开始工作。 对我来说似乎是一个许可问题。
您可以通过清除web.config中endpoint标记中的address值来解决此问题:
<endpoint address="" name="wsHttpEndpoint" ....... />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.