Multiple WCF windows services on the same box - endpoint configuration

Posted by David Belanger on Stack Overflow See other posts from Stack Overflow or by David Belanger
Published on 2010-04-19T23:28:53Z Indexed on 2010/04/19 23:33 UTC
Read the original article Hit count: 318

Hi,

I have 2 windows services installed on a machine with different service names, they install and start fine. What's happening is that they're both listening to the same endpoints and thus competing for messages. I've tried to change the baseAddress to be different for both services without success.

Here's my service host config:

<configuration>
 <appSettings>
    <add key="ServiceName" value="Service - Service Host 1"/>
</appSettings>
<system.serviceModel>
 <bindings>
  <wsHttpBinding>
    <binding name="NoSecurityBinding">
      <security mode="None">
        <message establishSecurityContext="false"/>
        <transport clientCredentialType="None"/>
      </security>
    </binding>
  </wsHttpBinding>
  <basicHttpBinding>
    <binding name="NoSecurityBinding">
      <security mode="None">
        <transport clientCredentialType="None"/>
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<services>
  <service name="Lib.Interface.Service" behaviorConfiguration="Lib.Interface.ServiceBehavior">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8000/Service"/>
      </baseAddresses>
    </host>
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="NoSecurityBinding" contract="Lib.Interface.IService"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="Lib.Interface.ServiceBehavior">
      <serviceMetadata httpGetEnabled="True" policyVersion="Policy12"/>
      <serviceDebug includeExceptionDetailInFaults="False"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

Any idea how I could set up the services (other than unique service names) so they're not conflicting with one another?

Thanks.

© Stack Overflow or respective owner

Related posts about wcfservice

Related posts about multiple-instances