I have a problem. I try to build a WCF Communication with multiple entpoints. But it never works and it displays a ErrorMessage like this:
- The contract name '{0}' could not be found in the list of contracts implemented by the service '{1}'.
And this is my Config-File:
*
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
<service name="MwWcfLibrary.Service">
<endpoint address="net.tcp://localhost:8733"
binding="netTcpBinding"
bindingConfiguration=""
bindingName="Action"
name="ActionInterface"
contract="MwWcfLibrary.Actions.Interfaces.IAction">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexTcpBinding"
bindingConfiguration=""
name="Mex"
contract="IMetadataExchange" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint binding="netTcpBinding"
address="net.tcp://localhost:8733"
bindingConfiguration=""
name="LifeSignInterface"
bindingName="LifeSign"
contract="MwWcfLibrary.LifeSign.Interfaces.ILifeSign" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint binding="netTcpBinding"
address="net.tcp://localhost:8733"
bindingConfiguration=""
name="DataInterface"
bindingName="Data"
contract="MwWcfLibrary.Notification.Interfaces.IData">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint binding="netTcpBinding"
address="net.tcp://localhost:8733"
bindingConfiguration=""
name="PublicDataInterface"
bindingName="PublicData"
contract="MwWcfLibrary.PublicData.Interfaces.IPublicData" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint binding="netTcpBinding"
address="net.tcp://localhost:8733"
bindingConfiguration=""
name="PublicStateInterface"
bindingName="PublicState"
contract="MwWcfLibrary.PublicState.Interfaces.IPublicState" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8733//MwWcfLibrary" />
</baseAddresses>
<timeouts closeTimeout="00:00:30" />
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
*
Does someone figure out if i configured something wrong?
Kind Regards.
EDIT
You either haven't implemented one of these interfaces:
MwWcfLibrary.Actions.Interfaces.IAction,MwWcfLibrary.LifeSign.Interfaces.ILifeSign,MwWcfLibrary.PublicData.Interfaces.IPublicDataandMwWcfLibrary.PublicState.Interfaces.IPublicStateor one or more of them is not decorated with the
[ServiceContract]attributeInclude the actual error in your question instead of '{0}', you'll see that some of your contracts have not been implemented by the class
Servicewhich should look like this (at least):Also, your address attributes don't appear to be correct, since you've defined a base address ending with a segment //Mww... yet in your endpoints the address is shorter than the base address. The endpoint addresses can just be relative like
"Service".Previously
The
Serviceelement refers to a class that's an implementation of aServiceContractinterface, which is what goes into theendpointcontract attribute. Verify the fully qualified names of your interfaces and classes in theses attributes.From looking at your configuration file, you are saying that the class
MwWcfLibrary.Serviceimplements the ([ServiceContract]decorated) interfaces calledMwWcfLibrary.Actions.Interfaces.IAction,MwWcfLibrary.LifeSign.Interfaces.ILifeSign,MwWcfLibrary.PublicData.Interfaces.IPublicDataandMwWcfLibrary.PublicState.Interfaces.IPublicStateThat seems to be in error. Do you mean to have two services, each with a separate endpoint?