2010-02-16 4 views
4

기존 WCF 서비스에 추가 net.tcp 끝점 (사용자 이름 인증 사용)을 사용하려고합니다. 이 서비스는 IIS7에서 호스팅됩니다.WCF Net.TCP 서비스에서 모호한 오류가 발생했습니다.

서비스에 대해 클라이언트를 실행하면 소켓 연결이 중단되었다는 오류가 반환됩니다. 서비스에 대한 추적하면 다음과 같은 예외가 발생 계시 활성화 :

System.ArgumentOutOfRangeException이
이 인수의 값은 양수 여야합니다.
매개 변수 이름 : 최선 I (아래 참조) 포트 공유가 구성에 의해 비활성화해야 알 수 있습니다,하지만 여전히 포트 공유를 통해 호출 있기 때문에 maxAccepts는
실제 값은

내가 혼란 스러워요 0이었다 코드 (다시, 내가 말할 수있는 한). 어쨌든이 maxAccepts 값을 지정하는 방법을 찾을 수 없습니다. Google은 그것에 대해 아무 것도 모르고 있으며 maxPendingAccepts 값은 그렇게하지 않는 것으로 보입니다. 오류를 어떻게 해결합니까?

서비스의 config 파일하여 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&amp; 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&amp; rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc) 
System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) 
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Dispatch(MessageRpc&amp; 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 관리자의 활성화 된 프로토콜 목록에 추가했습니다.

나는 또한 서비스 (하지 말라고을위한 이상적인 장기적인 해결책) 및 인터넷 TCP 연결을 호스트하는 빠른 Windows 서비스를 작성했습니다

는, 잘가 작동 내 구성에서 아무것도 것으로 나타나지 않도록 또는 코드, 즉 뭔가가 IIS에서 /와 함께 올바르지 않음을 의미합니다. 응용 프로그램 풀이 통합 모드에서 실행되어야합니까? 나는 그것을 두 가지 방법으로 시도했지만, 차이를 만들지는 못했지만, 현재 우리의 앱은 클래식 모드로 설치되어 있습니다. Net.tcp는 IIS7에서 작동하지 않습니다

답변

2

가 가장 잘 내가 결정할 수있다, 문제는 단순히 .NET이 하나가 SOAP11 엔드 포인트이고 하나는 NetTcp 엔드 포인트 때 같은 IIS 응용 프로그램에서이 개 서비스를 호스팅 좋아하지 않는 것입니다. Soap11 엔드 포인트를 제거하면 NetTcp 엔드 포인트가 오류없이 작동합니다.

우리는 우리가 NetTcp 엔드 포인트를 호스트하는 Windows 서비스를 사용하는 모델로 이동하고 IIS에서 SOAP11 끝점을 떠 났어요. 누군가가 IIS에서 동일한 응용 프로그램에서 NetTcp 및 SOAP11 서비스를 모두 개최하는 방법을 파악 경우

, 나는 그것에 대해 듣고 싶어요.

+0

또한 동일한 IIS 호스트에서 SOAP 끝점과 net.pipe 끝점에 문제가있는 것으로 보입니다. – Polyfun