2010-03-23 7 views
0

P2P 메시 (NetPeerTcpBinding)에 참여하기 때문에 Window Service에서 호스팅해야하는 WCF 서비스를 만들었습니다. IIS 서비스 컨테이너에서 NetPeerTcpBinding 끝점을 사용하여 WCF 서비스를 호스팅하려고하면 IIS에서 P2P 바인딩이 작동하지 않는다는 사실이 밝혀지기 때문에 서비스가 실행되지 않습니다.basicHttpBinding을 사용하는 Windows 서비스에서 호스팅되는 ISA 웹 팜과 WCF 서비스

Windows 서비스 컨테이너에서 호스팅되는 WCF 서비스에서 HTTP 끝점을 노출했으며 동일한 웹 서비스를 실행하는 두 대의 컴퓨터에서 http 끝점으로 트래픽을 라우팅하는 ISA 웹 팜을 만드는 방법이 있는지 알고 싶습니다. Windows 서비스 컨테이너의 WCF 서비스

+0

왜 'netPeerTcpBinding'을 드러내는 Windows 서비스가 있다고 말하는 동안 질문 제목이'basicHttpBinding'입니까? –

+0

wcf 서비스에는 둘 다 있습니다. 하나의 계약을 사용하는 메쉬에 참여하고보다 제한적인 다른 계약을 사용하여 basicHttpBinding 엔드 포인트를 노출합니다. –

답변

0

나는 이것을 끝내기 전에 알아 냈다. 미안하지만 답변을 올리려면 너무 오래 걸렸다.

IDefaultDocumentService라는 별도의 서비스 계약을 만들고 OperationContract 및 WebGet로 장식 된 하나의 메서드를 만듭니다. 이제

<OperationContract(), WebGet()> 
Function GetDefaultDocument() As System.ServiceModel.Channels.Message 

하면 Windows 서비스 후크까지 DefaultDocumentService에 대한 별도의 서비스에 대한 설정 파일에서 매우 간단한 DefaultDocumentService 클래스

Public Class DefaultDocumentService 
    Implements IDefaultDocumentService 

    Public Function GetDefaultDoc() As Message Implements IDefaultDocumentService.GetDefaultDocument 
     Return Message.CreateMessage(MessageVersion.None, "", "Hello!") 
    End Function 
End Class 

에서 해당 연락처를 구현하고 다른의 루트 디렉토리에 매핑 WCF 서비스. 이 서비스를 ISA의 웹 팜에 넣으면 기본 문서 서비스에 충돌하여 "Hello!" ISA 서버가 서비스가 살아 있음을 알기에 충분한 메시지.

<system.serviceModel> 
    <services> 
    <service name="YourMainService"> 
     <endpoint address="http://localhost:10000/YourMainService.svc" 
       binding="wsHttpBinding" 
       contract="IYourMainService" /> 
    </service> 

    <service name="DefaultDocumentService"> 
     <endpoint address="http://localhost:10000/" 
       binding="webHttpBinding" 
       behaviorConfiguration="DefaultDocumentEndpointBehavior" 
       contract="IDefaultDocumentService" /> 
    </service> 
    </services> 

    <behaviors> 
    <endpointBehaviors> 
     <behavior name="DefaultDocumentEndpointBehavior"> 
     <webHttp/> 
     </behavior> 
    </endpointBehaviors> 
    </behaviors> 
</system.serviceModel> 
관련 문제