1

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.

user1069816
  • 2,763
  • 2
  • 26
  • 43

1 Answers1

0

You Can't

After some searching I found a similiar question on StackOverflow here:

controlling the name of a named pipe when hosting WCF net.pipe binding in IIS

As no one has answered the above question in 2 years I'm assuming what am I trying to do is impossible.

If anyone else is struggling with this sort of problem I found this blog entry very helpful in helping me understand:

http://blogs.charteris.com/blogs/chrisdi/archive/2008/05/19/exploring-the-wcf-named-pipe-binding-part-1.aspx

I am going to change the binding to http which will solve my problem.

Community
  • 1
  • 1
user1069816
  • 2,763
  • 2
  • 26
  • 43