1

最初に少し背景を説明します:

同じ ASP .NET アプリケーションの 4 つのインスタンスをそれぞれ異なるカルチャ (web.config で設定) で実行する Web サーバーがあります。文化は、英国 (GBR)、オーストラリア (AUS)、アイルランド (IRL)、およびニュージーランド (NZL) です。それらのそれぞれには、単一のスケジュールされたタスクを介して呼び出したいWebメソッド「DoWork」があります。4つのカルチャのそれぞれでこのメソッドを呼び出す単純なexe、単純化されたコードがあります。

Dim AUSclient As New AUSAutomated.AUSAutomatedClient()
AUSclient.DoWork
Dim GBRclient As New GBRAutomated.GBRAutomatedClient()
GBRclient.DoWork
Dim IRLclient As New IRLAutomated.IRLAutomatedClient()
IRLclient.DoWork
Dim NZLclient As New NZLAutomated.NZLAutomatedClient()
NZLclient.DoWork

メソッドを使用しているタスクでは、app.config は次のようになります。

        <endpoint address="net.pipe://localhost/Services/GBR/GBRAutomated.svc"
            binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IGBRAutomated"
            contract="GBRAutomated.IGBRAutomated" name="NetNamedPipeBinding_IGBRAutomated">
                </endpoint>

        <endpoint address="net.pipe://localhost/Services/IRL/IRLAutomated.svc"
 binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IIRLAutomated"
 contract="IRLAutomated.IIRLAutomated" name="NetNamedPipeBinding_IIRLAutomated">
                    </endpoint>

        <endpoint address="net.pipe://localhost/Services/NZL/NZLAutomated.svc"
            binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_INZLAutomated"
            contract="NZLAutomated.INZLAutomated" name="NetNamedPipeBinding_INZLAutomated">
                    </endpoint>

アプリケーションは、ネットの名前付きパイプ バインディングを使用して、WCF 経由で Web メソッドを公開します。各カルチャには、web.config に正しいサービスを指すエントリがあります。たとえば、アイルランドのものは次のとおりです。

<service name="Web.IRLAutomated">
            <endpoint address="net.pipe://localhost/Services/IRL/IRLAutomated.svc" binding="netNamedPipeBinding" contract="Web.IIRLAutomated" />
        </service>

したがって、各カルチャの公開メソッドには、異なるコントラクトとアドレスがあります。

タスクが実行されると、オーストラリア方式が 4 回すべて呼び出されます。web.configs の設定を無視し、最初のアプリケーションで正しいコントラクトでメソッドを呼び出すようです。だから私の質問は:

各カルチャでメソッドに一意のパイプ名を設定するにはどうすればよいですか?

バインディングで hostNameComparisonMode="Exact" を設定しようとしましたが、違いはないようです。

4

1 に答える 1