First a bit of background:
I have a web server which runs 4 instances of the same ASP .NET application each one in a different culture (set in the web.config). The cultures are British (GBR), Australian (AUS), Irish (IRL), and New Zealander (NZL). Each of them has a webmethod "DoWork" which I would like to call via a single scheduled task. I have a simple exe which calls this method on each of the four cultures, simplified code:
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
In the task which is consuming the methods the app.config looks like this:
<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>
The application exposes the web method via WCF using a net named pipes binding. Each of the cultures has an entry in the web.config to point to the correct service. For example the Ireland one is:
<service name="Web.IRLAutomated">
<endpoint address="net.pipe://localhost/Services/IRL/IRLAutomated.svc" binding="netNamedPipeBinding" contract="Web.IIRLAutomated" />
</service>
So the exposed method for each culture has a different contract and address.
When the task runs it calls the Australian Method all 4 times. It seems to ignore the settings in the web.configs and call the method with the correct contract on the first application. So my question is:
How can I set a unique pipe name for the method in each culture?
I tried setting hostNameComparisonMode="Exact" on the binding but this doesn't seem to have made any difference.