服务端点绑定不使用HTTP协议? [英] service endpoint binding not using the HTTP protocol?
问题描述
我有一个托管/正在运行的WCF服务以及一个用于连接它的应用程序.我将WCF移到Windows Server 2003 SP1计算机上,并根据管理员的话说它正在运行IIS 6.0,它可能是IIS 5.0,而不是100%确定.
I had a WCF service hosted/working plus a application to connecting to it. I moved the WCF to Windows Server 2003 SP1 computer, and according to the admin its running IIS 6.0, it could be IIS 5.0, not 100% sure.
尝试连接测试应用程序时出现此错误.
And I get this error when trying to connect with my test application.
System.ServiceModel.CommunicationException was unhandled
Message="An error occurred while receiving the HTTP response to http://blabla:8843/Service.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details."
Source="mscorlib"
StackTrace:
Server stack trace:
at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)
at System.ServiceModel.Security.TlsnegoTokenProvider.OnOpen(TimeSpan timeout)
at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout)
at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout)
at System.ServiceModel.Security.SecurityUtils.OpenTokenProviderIfRequired(SecurityTokenProvider tokenProvider, TimeSpan timeout)
at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Security.SecurityProtocol.Open(TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
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 System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.ClientBase`1.Open()
at ConsoleApplication1.Program.Main(String[] args) in C:\Users\timo\Documents\Visual Studio 2008\Projects\TestNewService\TestNewService\Program.cs:line 39
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Net.WebException
Message="The underlying connection was closed: An unexpected error occurred on a receive."
Source="System"
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
InnerException: System.IO.IOException
Message="Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
Source="System"
StackTrace:
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
InnerException: System.Net.Sockets.SocketException
Message="An existing connection was forcibly closed by the remote host"
Source="System"
ErrorCode=10054
NativeErrorCode=10054
StackTrace:
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
InnerException:
----------------------------------- ----------------------------
这是我在应用程序上的端点:
This is my endpoints on the application:
< bindings>
< wsHttpBinding>
< binding name =``WSHttpBinding_IService''; closeTimeout ="00:10:00"
openTimeout ="00:10:00" receiveTimeout ="00:10:00" sendTimeout ="00:10:00"
bypassProxyOnLocal ="false" transactionFlow =假". hostNameComparisonMode ="StrongWildcard"
maxBufferPoolSize ="524288" maxReceivedMessageSize ="65536";
messageEncoding =文字"; textEncoding ="utf-8"; useDefaultWebProxy ="true"
allowCookies ="false">"
.< reliableSessionordered ="true"; inactivityTimeout ="00:10:00"
enabled ="false"; />
<安全模式=消息">
< transport clientCredentialType ="Windows" proxyCredentialType =无"
realm =" />
.< message clientCredentialType ="UserName"; consultantServiceCredential ="true"
algorithmSuite ="Default";建立安全性上下文=真". />
</security>
</binding>
</wsHttpBinding>
</bindings>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IService" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10: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="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<端点地址=" http://blabla:8843/Service.svc "
" binding ="wsHttpBinding" bindingConfiguration ="WSHttpBinding_IService"
合约="IService"; name =" WSHttpBinding_IService">
<endpoint address="http://blabla:8843/Service.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService"
contract="IService" name="WSHttpBinding_IService">
< identity>
< certificate encodeValue = blablaenc
<identity>
<certificate encodedValue=blablaenc
</identity>
</identity>
</endpoint>
</endpoint>
服务的终点
< bindings>
< wsHttpBinding>
消息clientCredentialType ="UserName"; />
</security>
</binding>
</wsHttpBinding>
</bindings>
<服务>
<服务名称=服务" behaviorConfiguration =" defaultProfile">
< ;!-服务端点-<< endpoint address ="" binding ="wsHttpBinding" bindingConfiguration ="mySecureBinding";合约="IService",身份","<身份","dns值=" blabla:8843","/身份",端点",身份",端点",身份",端点",身份",端点",身份",端点". ><端点地址="mex"; binding ="mexHttpBinding" contract ="IMetadataExchange"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="mySecureBinding">
<security mode="Message">
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="Service" behaviorConfiguration="defaultProfile">
<!-- Service Endpoints -->
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="mySecureBinding" contract="IService">
<identity>
<dns value="blabla:8843"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
您知道我的端点出了什么问题吗?还是其他地方出了问题?
Any idea what is wrong with my endpoints or is the issue somewhere else?
谢谢
推荐答案
这可能是由于服务器端出现错误(这也可能是由于服务器中止了HTTP请求上下文(可能是由于服务关闭所致).是否可以启用跟踪功能(
This is likely due to an error at the server side (This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). Can you enable tracing (http://msdn2.microsoft.com/en-us/library/ms733025.aspx) at the server side to see if there is an error in that location that would explain this?
这篇关于服务端点绑定不使用HTTP协议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!