2011-08-03 2 views
1

NetTcpBinding으로 변경하려는 WCF 서비스 WsHttpBinding에 문제가 있습니다. 이전에 IIS7 로컬 시스템에서 서비스를 설정했으며 WsHttpBinding과 함께 작동합니다.WCF 바인딩을 wsHttp에서 netTcp로 변경

이 서비스에 대한 프록시 내가 내 로그에 다음과 같은 예외를 얻을 NetTcpBinding 바인딩 변경하면 요청 메시지

를 전송하기 전에 두 개의 메시지 헤더를 추가하는 CustomBehavior를 ..했다

Exception: System.ServiceModel.ServiceActivationException: Service /ConsignmentService/Consignment.svc cannot be activated due to an exception during compilation. The exception message is: Exception has been thrown by the target of an invocation ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ServiceModel.MessageHeaderException: There is not a header with the name "ClientID" og namespace 'http://AmphoraExtension/Header' in the message. 
    ved System.ServiceModel.Channels.MessageHeaders.GetHeader[T](String name, String ns, XmlObjectSerializer serializer) 
    ved System.ServiceModel.Channels.MessageHeaders.GetHeader[T](String name, String ns) 

이것은 wsHttpBinding에서 잘 작동하지만 NetTcpBinding으로 전환 할 때 제대로 작동하지 않습니다. 여기에 무엇이 누락 되었습니까?

답변

0

직접 해결.

이것은 나빴습니다. 매개 변수와 헤더가있는 실제 요청이 있기 전에 WCF 서버에 요청되어 서비스 클래스를 인스턴스화해야했습니다. 그리고 생성자에는 거기에 있어야했던 헤더 데이터 주위에 논리가있었습니다. 이 문제를 해결했습니다.

1

CustomBehaviour에 대해서는 확실치 않지만 netTcp에서 IIS에서 실행되는 WCF 서비스를 얻는 것과 똑같은 문제가 발생했습니다. 여기에 내 질문에 체크 아웃 :

WCF netTcpBinding hosted on IIS7.5 Stops Working

을 많이 난 내 자신의 질문에 대답 결국 및 IIS에서 실행되는 netTcp 서비스를 취득하기위한 체크리스트를 게시에 대한 조롱 후.

관련 문제