By default IIS 7 Web site has net.tcp binding with "808:" binding information string. If i add another net.tcp binding with "xxx:" exception occurs:
This collection already contains an address with scheme net.tcp. There can be at most one address per scheme in this collection.
Parameter name: item
How can i solve this problem and listen my service at TWO ports?
Best Answer
Basically, in your service, you should be able to define any number of service endpoints on any number of ports.
There's two ways to do this:
If you do option #1, you'll have something like this:
So in this case, you have two service endpoints for the same contract, and they'll be listening on URLs
and
You can have mulitple service endpoints, but only one base address.
The other option is to specify no base addresses and specify your full service address in the endpoint directly:
In this case, since you're defining the whole address in the endpoint, you can pick two different TCP ports, one for each endpoint. This should work with no problem at all. You have two separate endpoints on two separate ports, both listening and being serviced by the same service class in the background.
Marc