Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Having two different topics within same windows server service bus namespace in WCF endpoint

$
0
0
I have two endpoints defined pointing to two different service bus topics. With same transportClientEndpointBehavior and on same service.



    <endpointBehaviors>
                <behavior name="securityBehavior">
             
              <transportClientEndpointBehavior>
                <tokenProvider>
                  <windowsAuthentication>
                    <stsUris>
                      <stsUri value="https://on-permises:9355/Namespace" />
                    </stsUris>
                  </windowsAuthentication>
                </tokenProvider>
              </transportClientEndpointBehavior>
    </endpointBehaviors>
    
    <customBinding>
            <binding name="messagingBinding" >
              <textMessageEncoding messageVersion="None" writeEncoding="utf-8"  >
                <readerQuotas maxStringContentLength="2147483647"/>
              </textMessageEncoding>
              <netMessagingTransport/>
            </binding>
    </customBinding>
    
    <endpoint name="endpoint1"
      address="sb://on-permises/Namespace/topic1"
                       listenUri="sb://on-permises/Namespace/topic1/subscriptions/sub"
                       binding="customBinding"
                       bindingConfiguration="messagingBinding"
                       contract="WCFService.IService1"
                       behaviorConfiguration="securityBehavior" />
    
            <endpoint name="endpoint2"
      address="sb://on-permises/Namespace/topic2"
                       listenUri="sb://on-permises/Namespace/topic2/subscriptions/sub"
                       binding="customBinding"
                       bindingConfiguration="messagingBinding"
                       contract="WCFService.IService2"
                       behaviorConfiguration="securityBehavior" />

Once i run the application, I get the error :
System.ArgumentException: 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.
Parameter name: item

I tried by defining two different endpoint behaviors, but get the same error.
any help here will be helpful. 



Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>