WCFヘルプ、HTTPを介してサービスを公開するにはどうすればよいですか。

StackOverflow https://stackoverflow.com/questions/2952467

質問

IISでホストされているWCF .SVCファイルがあります。 basichttpバインディングを使用したいです。このサービスジョブは、実際にNet.tcpを介して別のサービスを呼び出すことです。すべてがローカルで正常に動作しますが、展開すると、このエラーが発生しています。

提供されたURIスキーム「HTTP」は無効です。予想される「net.tcp」。パラメーター名:via

これがサーバー構成です

<client>
  <endpoint address="net.tcp://localhost:9300/InternalInterfaceService"
      binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IInternalInterfaceService"
      contract="IInternalInterfaceService" name="NetTcpBinding_IInternalInterfaceService">
    <identity>
      <servicePrincipalName value="localhost" />
    </identity>
  </endpoint>
</client>
<services>
<service name="MyExternalService">
<endpoint address="" binding="basicHttpBinding" contract="IMyExternalService" />
</service>
</services>

そして、SVCutilが生成する構成は次のとおりです

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IMyExternalService" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://myserver.somesdomain.com/Services/MyExternalService.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyExternalService"
            contract="IMyInternalService" name="BasicHttpBinding_IMyExternalService" />
    </client>
</system.serviceModel>

これを正しく配線するために何をする必要がありますか。 HTTPを介してinternal interfaceserviceを公開したくありません。ここで何をしているのですか?ヒントや提案は確かに高く評価されています。

ありがとう、
〜CK

役に立ちましたか?

解決

ルーティングサービスが必要です。これは、HTTPエンドポイントを世界に公開し、NetTCPを内部で使用するサービスが必要です。

基本的に、外向きのHTTPサービスは、内部NetTCPサービスを呼び出すためにクライアントになる必要があります。

あなたは間違いなく.NET 3.5でこれを少し努力して行うことができます:

または、.NET 4 / VS 2010で新しいWCF 4ルーティングサービスを使用することもできます。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top