2013-07-24 2 views
2

IIS에서 로컬로 호스팅되는 WCF WebService에 대해 netTcp를 구성하는 데 문제가 있습니다. DotNet 4.0 (VS2012)이 설치된 Windows 7 및 IIS 7에서 방화벽을 사용할 수 없습니다. net.tcp (808)에 대한 사이트 바인딩을 IIS에서WCF NetTcp 구성 문제

  1. 설정 : * 기본 웹 사이트에 대한 IIS에서
  2. 를 사용할 수있는 프로토콜은 웹 서비스에 대해 우리는 netTcp를 구성하려면 다음 단계를 수행 한

    "HTTP, net.tcp"(공백 없음)

  3. 검증 net.Tcp Listener 어댑터 우리는 우리가 할 NETSTAT -ONa을 실행할 때 net.Tcp 포트 공유 서비스는 이제

(뿐만 아니라 그들을 재활용) 실행 아무 것도 보이지 않는다. 127.0.0.1:808에 대한 목록 - 우리가해야합니까 ??? 의 App.config

<system.web> 
<customErrors mode="Off"></customErrors> 
<compilation debug="true" targetFramework="4.0"></compilation> 
    <identity impersonate="false" /> 
</system.web> 
<system.serviceModel> 
<diagnostics> 
    <messageLogging logMalformedMessages="false" logMessagesAtServiceLevel="false" 
    logMessagesAtTransportLevel="false" /> 
</diagnostics> 
<bindings> 
    <netTcpBinding> 
    <binding name="XxxxxxxCommonServiceBinding" /> 
    </netTcpBinding> 
</bindings> 
<services> 
    <service behaviorConfiguration="XxxxxxxCommonService_Behavior" name="CS.WebService.Xxxxxxx.Common.XxxxxxxCommonService"> 
    <endpoint address="net.tcp://localhost:808/CS.WebService.Xxxxxxx.Common.XxxxxxxCommonService/XxxxxxxCommonService.svc" binding="netTcpBinding" 
       bindingConfiguration="XxxxxxxCommonServiceBinding" name="XxxxxxxCommonNetTcpBinding" 
       contract="CS.ServiceContracts.Xxxxxxx.Common.IXxxxxxxCommonService" /> 
    <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />  
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="XxxxxxxCommonService_Behavior"> 
     <serviceMetadata httpGetEnabled="false" /> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<serviceHostingEnvironment multipleSiteBindingsEnabled="false">  
</serviceHostingEnvironment> 
</system.serviceModel> 
<system.webServer> 
<modules runAllManagedModulesForAllRequests="true" /> 
</system.webServer> 

그리고 여기에 있습니다 : : 여기

내의 Web.config입니다

:

여기
<system.serviceModel> 
<client> 
    <endpoint name="CS.WebService.Xxxxxxx.Common.XxxxxxxCommonService" 
      address="net.tcp://localhost/CS.WebService.Xxxxxxx.Common.XxxxxxxCommonService/XxxxxxxCommonService.svc" 
      binding="netTcpBinding" 
      bindingConfiguration="XxxxxxxCommonNetTcpBinding" 
      contract="CS.ServiceContracts.Xxxxxxx.Common.IXxxxxxxCommonService"/> 
</client>  
</system.serviceModel> 

내가 서비스를 호출하려고 내 클라이언트 코드는

var endPoint = new EndpointAddress(
      "net.tcp://127.0.0.1:809/CS.WebService.Xxxxxx.Common.XxxxxxCommonService/XxxxxxCommonService.svc"); 
var binding = new NetTcpBinding { TransferMode = TransferMode.Streamed, SendTimeout = TimeSpan.MaxValue }; 
var channel = new ChannelFactory<IXxxxxxCommonService>(binding, endPoint); 
var proxy = channel.CreateChannel() 
var request = new GetDataRequest(); 
var response = proxy.GetData(request); 

다음과 같은 오류가 발생했습니다.

net.tcp : //127.0.0.1 : 809/CS.WebService.Xxxxxx.Common.XxxxxxCommonService/XxxxxxCommonService.svc에 연결할 수 없습니다. 연결 시도는 00:00:00의 시간 동안 지속되었습니다. TCP 오류 코드 10061 : 대상 컴퓨터가 127.0.0.1:809를 적극적으로 거부했기 때문에 연결할 수 없습니다.

나는 우리가 다음 오류 얻을 808 코드와 WebConfig에서 포트를 변경하는 경우 :

가 net.tcp에서 듣기에는 엔드 포인트가 없었다 : //127.0.0.1/CS.WebService.Xxxxxx.Common합니다. 메시지를 수락 할 수있는 XxxxxxCommonService/XxxxxxCommonService.svc. 이것은 종종 잘못된 주소 또는 SOAP 조치로 인해 발생합니다. 자세한 내용은 InnerException을 참조하십시오. (참고로, 내부 예외는 없었습니다.)

netstat -ona는 127.0.0.1:808을 표시하지 않기 때문에 제대로 설정되어 있지 않은 것으로 보입니다. 하지만 다시 Net.Tcp 서비스가 실행 중이고 재활용되어 IIS가 올바르게 설정되어 있으므로 어디서부터 돌릴 지 잘 모릅니다.

+0

WCF 추적을 구성한 것처럼 보입니다.나는 클라이언트와 서비스 모두가 추적을 가능하게하고 클라이언트 추적 파일로 시작하여 예외가 던져지는 곳을 확인해야한다. 또한 [간단한 netHttpBinding 샘플] (http://msdn.microsoft.com/en-us/library/ms752250.aspx)을 실행하여 실제 구성과 구성을 비교하십시오. –

답변

1

제어판> 프로그램 및 기능> Windows 기능 켜기 또는 끄기로 이동하십시오. 다음 대화 상자에서 Microsoft .NET Framework 3.5.1 항목으로 이동하고 Windows Communication Foundation Non-HTTP Activation을 사용 가능하게 설정하십시오. (비록 그것이 프레임 워크에 내장 된 3.5.1 - 어떤 Win7 이건 - 4.0도 마찬가지입니다).

netstat 출력에 0.0.0.0:808이 표시되어야합니다.

+0

클라이언트 코드에 endpointAddress 유형이 있습니다. 나는 그것을 고쳤고 지금 나는 다른 오류를 범하고있다. 나는 soo 0.0.0.0:808을 수행하므로 괜찮아 보인다. – 77vetter

+0

내 오류 이제 계약은 세션을 허용하지 않지만 바인딩 'NetTcpBinding'은 데이터 그램을 지원하지 않습니다. 그래서 channel.Endpoint.Contract.SessionMode = SessionMode.Allowed를 변경했지만 여전히 동일한 오류가 발생합니다. – 77vetter

+0

@ 77vetter : SessionMode를 변경하려면 클라이언트와 서버 모두에서 SessionMode를 변경해야합니다. 그러나, 그게 당신의 문제를 해결할 수 있을지 모르겠다. 당신이 그것을 고칠 수 없다면, 당신은 새로운 문제를 설명하는 새로운 질문을 게시해야합니다. – YK1

1

클라이언트와 서버 모두에서 변경된 SessionMode.Allowed가 작동하기 시작했습니다. 내 컴퓨터에서 메모리 문제가 발생하여 메모리를 비우고 sessionMode가 모두 올바른 경우 문제가 발생했습니다. 추적을 켜면 올바른 방향으로 나를 가리킨 것입니다.