Reputation: 407
i'm kinda new to wcf, facing some issues that i wasn't able to find on the web or misunderstood.
<service name="Columba.Services.DataConnector.DataConnectorManager" behaviorConfiguration="ServiceBehavior">
<endpoint address="net.tcp://localhost:8888/IDataConnectorManager/" binding="netTcpBinding" contract="Columba.Services.Common.Contracts.DataConnector.IDataConnectorManager">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="net.msmq://./private/columba/IQueueItems" binding="netMsmqBinding" bindingConfiguration="MSMQBinding" contract="Columba.Services.Common.Contracts.Delivery.IQueueItems" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</service>
what i'm trying to achieve is to change the behaviorConfiguration="ServiceBehavior" to a different behaviorConfiguration (found at serviceBehaviors tag) for only the second endpoint. is it even possible to achieve such functionality?!
The new behavior is configuring serviceCredentials service certificate, but its only needed for the second endpoint.
Thanks in advance guys.
Upvotes: 3
Views: 467
Reputation: 1175
Create new interface and class from parents:
interface IDataConnectorManager2 : IDataConnectorManager
{}
public class DataConnectorManager2: DataConnectorManager, IDataConnectorManager2 {}
Then create second service in config with newly created class/interface and other behaviour:
<service name = "DataConnectorManager" behaviorConfiguration="behavior1">
<endpoint address="endpoint1">
<service>
<service name = "DataConnectorManager2" behaviorConfiguration="behavior2">
<endpoint address="endpoint2">
<service>
Upvotes: 5
Reputation: 31750
Short answer, no - service behavior operates at the service level only.
You can, however, implement an endpoint-level behavior by creating a behavior class direived from BehaviorExtensionElement, and implememting IEndpointBehavior, as described here.
Upvotes: 1