I cant activate a service that is exposed by two different relay endpoints in the same NAMESPACE but with different addresses. If i delete one of them the service activates fine, so the configuration is fine. I tried changing the type of the binding, changing the namespace, adding two behavior configuration instead of only one but i get always the same error (at the bottom).
Anybody knows if i am missing something? Can i have two relay endpoints in the same namespace?
<service name="Service">
<endpoint contract="IService" binding="basicHttpRelayBinding" name="b1 "
address="http://**NAMESPACE**.servicebus.windows.net/s1" behaviorConfiguration="credentials"/>
<endpoint contract="IService" binding="webHttpRelayBinding" name="wh1"
address="https://**NAMESPACE**.servicebus.windows.net/s2" behaviorConfiguration="credentials"/>
</service>
<behavior name="credentials">
<serviceRegistrySettings discoveryMode="Public" displayName="Auxiliar" />
<transportClientEndpointBehavior>
<tokenProvider>
<sharedSecret issuerName="owner" issuerSecret="**KEY**" />
</tokenProvider>
</transportClientEndpointBehavior>
</behavior>
The error is:
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.ArgumentException: The value could not be added to the collection, as the collection already contains an item of the same type: 'Microsoft.ServiceBus.NameSettings'. This collection only supports one instance of each type. Parameter name: item at System.Collections.Generic.KeyedByTypeCollection
1.InsertItem(Int32 index, TItem item) at Microsoft.ServiceBus.ServiceRegistrySettings.System.ServiceModel.Description.IEndpointBehavior.AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) at System.ServiceModel.Description.DispatcherBuilder.AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection parameters) at System.ServiceModel.Description.DispatcherBuilder.GetBindingParameters(ServiceHostBase serviceHost, Collection
1 endpoints) at System.ServiceModel.Description.ServiceMetadataBehavior.MetadataExtensionInitializer.GenerateMetadata() at System.ServiceModel.Description.ServiceMetadataExtension.EnsureInitialized() at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.InitializationData.InitializeFrom(ServiceMetadataExtension extension) at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.GetInitData() at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleDocumentationRequest(Message httpGetRequest, String[] queries, Message& replyMessage) at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(Message httpGetRequest) at SyncInvokeGet(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
WebServiceHost
? You need to use that forWebHttpRelayBinding
. – TheDude