WCF Net.TCP服务引发模糊错误
我正在尝试为现有的WCF服务启用额外的net.tcp端点(它使用用户名认证)。该服务托管在IIS7中。WCF Net.TCP服务引发模糊错误
针对服务执行客户端会返回套接字连接中止的错误。启用跟踪对服务发现以下异常被抛出:
System.ArgumentOutOfRangeException
这个参数的值必须为正。
参数名:maxAccepts
实际值是0
我很困惑,因为最好的,我可以告诉端口共享应由配置被禁用(见下文),但它仍然通过端口共享调用代码(再次,尽我所知)。无论如何,我找不到任何方法来指定此maxAccepts值; Google不知道任何关于它的信息,并且maxPendingAccepts值似乎没有做到。我该如何解决错误?
服务的配置文件中包含的net.tcp终结点以下:
<bindings>
<customBinding>
<binding name="netTcp">
<security authenticationMode="UserNameOverTransport" />
<windowsStreamSecurity />
<tcpTransport portSharingEnabled="false" listenBacklog="10" maxPendingAccepts="10" maxPendingConnections="10" />
</binding>
</customBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="netTcp">
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceMetadata/>
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Asi.Soa.ServiceModelEx.NullUserNamePasswordValidator, Asi.Soa.ServiceModelEx" />
<clientCertificate>
<authentication certificateValidationMode="None"/>
</clientCertificate>
</serviceCredentials>
<serviceAuthorization principalPermissionMode="Custom">
<authorizationPolicies>
<add policyType="Asi.Soa.ServiceModelEx.ClaimsAuthorizationPolicy, Asi.Soa.ServiceModelEx" />
</authorizationPolicies>
</serviceAuthorization>
</behavior>
</serviceBehaviors>
</behaviors>
完整的异常堆栈跟踪是:
System.ServiceModel.Channels.ConnectionAcceptor..ctor(IConnectionListener listener, Int32 maxAccepts, Int32 maxPendingConnections, ConnectionAvailableCallback callback, ErrorCallback errorCallback)
System.ServiceModel.Channels.ConnectionDemuxer..ctor(IConnectionListener listener, Int32 maxAccepts, Int32 maxPendingConnections, TimeSpan channelInitializationTimeout, TimeSpan idleTimeout, Int32 maxPooledConnections, TransportSettingsCallback transportSettingsCallback, SingletonPreambleDemuxCallback singletonPreambleCallback, ServerSessionPreambleDemuxCallback serverSessionPreambleCallback, ErrorCallback errorCallback)
System.ServiceModel.Channels.SharedTcpTransportManager.CreateConnectionDemuxer()
System.ServiceModel.Channels.SharedTcpTransportManager.OnDuplicatedVia(Uri via, Int32& connectionBufferSize)
System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.HandleOnVia(DuplicateContext duplicateContext)
System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.System.ServiceModel.Activation.IConnectionDuplicator.BeginDuplicate(DuplicateContext duplicateContext, AsyncCallback callback, Object state)
AsyncInvokeBeginBeginDuplicate(Object , Object[] , AsyncCallback , Object)
System.ServiceModel.Dispatcher.AsyncMethodInvoker.InvokeBegin(Object instance, Object[] inputs, AsyncCallback callback, Object state)
System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Dispatch(MessageRpc& rpc, Boolean isOperationContextSet)
System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)
System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
System.ServiceModel.Channels.FramingDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)
System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
System.ServiceModel.AsyncResult.Complete(Boolean completedSynchronously)
System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state)
System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)
System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback()
System.ServiceModel.Channels.TracingConnection.WaitCallback(Object state)
System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error, Int32 numBytes)
System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32 error, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
编辑:我已经安装了非HTTP WCF激活组件,运行ServiceModelReg.exe,将net.tcp和net.pipe添加到IIS管理器中已启用的协议列表等。没有喜悦。
我也写一个快速的Windows服务来托管服务(不是我们理想的长期解决方案),以及网络TCP连接的工作原理有细,所以不会出现任何东西在我的配置或代码,这意味着有些东西在IIS中不正确。应用程序的应用程序池是否必须在集成模式下运行?我尝试了两种方式,它似乎没有什么区别,但我们的应用程序目前安装在经典模式。
,尽我所能决定,这个问题很简单,.NET不喜欢在同一个IIS应用程序托管两种服务时,一个是Soap11端点,一个是NetTcp终点。删除Soap11端点允许NetTcp端点无误地工作。
我们移动到我们使用的是Windows服务来托管NetTcp端点的模型,并在IIS离开Soap11端点。
如果有人数字如何同时托管在IIS同一应用程序NetTcp和Soap11服务,我很乐意听到它。
的net.tcp不上IIS7工作外的开箱,也有一些需要被激活的东西。
不幸的是,我已经完成了那篇文章中列出的所有内容,而且我仍然遇到了错误。 – technophile 2010-02-16 21:11:30
对于同一个IIS主机中的SOAP端点和net.pipe端点似乎也有问题。 – Polyfun 2014-05-27 14:45:42