I have a WCF endpoint that I would like to subscribe to multiple topic/subscriptions with the same interface. Then once it gets to the .svc, route based on the brokered message properties. (This is sort of how we have it set up in Neuron ESB with service connectors). This is so we don’t need a .svc file for every subscription in our setup.
When I try to add 2 endpoints in the web config, it throws:
The value could not be added to the collection, as the collection already contains an item of the same type: 'Microsoft.ServiceBus.TransportClientEndpointBehavior'. This collection only supports one instance of each type.
Here is my config:
<servicename ="SBWcfService2.TopicService">
<endpointname ="TopicService"
listenUri="sb://localservicebus:10354/ServiceBusDefaultNamespace/wcftopic1/Subscriptions/Wcf2Sub"
address ="sb://localservicebus:10354/ServiceBusDefaultNamespace/wcftopic1"
binding="netMessagingBinding"
bindingConfiguration="messagingBinding"
contract="SBMessage.IMessageTopicContract"
behaviorConfiguration="endpointBehavior"/>
<endpointname ="TopicService2"
listenUri="sb://localservicebus:10354/ServiceBusDefaultNamespace/wcftopic2/Subscriptions/Wcf2Sub2"
address ="sb://localservicebus:10354/ServiceBusDefaultNamespace/wcftopic2"
binding="netMessagingBinding"
bindingConfiguration="messagingBinding"
contract="SBMessage.IMessageTopicContract"
behaviorConfiguration="endpointBehavior"/>
</service>
So I took out the behaviorConfiguration in 1 of the 2 endpoint configs, this allowed me to hit the endpoint like every other time.
When it doesn’t work it gave me a 404 server error saying resource cannot be found.
Event viewer shows:
There was no channel actively listening at 'http://{{ServerName}}/SBWcfService2/TopicService.svc'. This is often caused by an incorrect address URI
If I change localservicebus to my computer name, I can hit the endpoint without the resource failure, but I can’t receive messages.
Searching online I couldn’t find much, the below link it the closest I could find with a similar problem:
http://stackoverflow.com/questions/25668693/system-argumentexception-while-browsing-wcf-service-with-multiple-azure-service
Any help would be greatly appreciated
Thanks,
-Nick N