0

P2P メッシュ (NetPeerTcpBinding) に参加しているため、ウィンドウ サービスでホストする必要がある WCF サービスを作成しました。IIS サービス コンテナで NetPeerTcpBinding エンドポイントを使用して WCF サービスをホストしようとしたところ、P2P バインディングが IIS で機能しないことが判明したため、サービスが実行されませんでした。

Windows サービス コンテナーでホストされている WCF サービスから HTTP エンドポイントを公開しました。それぞれが同じ WCF サービスを実行している 2 台のマシン上の http エンドポイントにトラフィックをルーティングする ISA Web ファームを作成する方法があるかどうかを知りたいです。 Windows サービス コンテナー。

4

1 に答える 1

0

私はこれがかなり前に終了したことを理解しました。申し訳ありませんが、回答を投稿するのに時間がかかりました。

OperationContract と WebGet の両方で装飾された 1 つのメソッドを含む、IDefaultDocumentService という別のサービス コントラクトを作成します。

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

その連絡先を非常に単純な DefaultDocumentService クラスに実装します

Public Class DefaultDocumentService
    Implements IDefaultDocumentService

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

Windows サービスの構成ファイルで、DefaultDocumentService の別のサービスをフックし、それを他の WCF サービスのルート ディレクトリにマップします。これらのサービスを ISA の Web ファームに配置すると、既定のドキュメント サービスにヒットし、"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>
于 2010-07-10T19:30:39.717 に答える