Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Multiple contracts with duplicate method names
    primarykey
    data
    text
    <p>I have a service with multiple contracts like so.</p> <pre><code>[ServiceContract] public partial interface IBusinessFunctionDAO { [OperationContract] BusinessFunction GetBusinessFunction(Int32 businessFunctionRefID); [OperationContract] IEnumerable&lt;Project&gt; GetProjects(Int32 businessFunctionRefID); } [ServiceContract] public partial interface IBusinessUnitDAO { [OperationContract] BusinessUnit GetBusinessUnit(Int32 businessUnitRefID); [OperationContract] IEnumerable&lt;Project&gt; GetProjects(Int32 businessUnitRefID); } </code></pre> <p>I then explicitly implemented each one of the interfaces like so.</p> <pre><code>public class TrackingTool : IBusinessFunctionDAO, IBusinessUnitDAO { BusinessFunction IBusinessFunctionDAO.GetBusinessFunction(Int32 businessFunctionRefID) { // implementation } IEnumerable&lt;Project&gt; IBusinessFunctionDAO.GetProjects(Int32 businessFunctionRefID) { // implementation } BusinessUnit IBusinessUnitDAO.GetBusinessUnit(Int32 businessUnitRefID) { // implementation } IEnumerable&lt;Project&gt; IBusinessUnitDAO.GetProjects(Int32 businessUnitRefID) { // implementation } } </code></pre> <p>As you can see I have two GetProjects(int) methods, but each one is implemented explicitly so this compiles just fine and is perfectly valid. The problem arises when I actually start this as a service. It gives me an error staying that TrackingTool already contains a definition GetProject. While it is true, it is part of a different service contract. Does WCF not distinguish between service contracts when generating the method names ? Is there a way to get it to distinguish between the service contracts ?</p> <p>My App.Config looks like this</p> <pre><code>&lt;service name="TrackingTool"&gt; &lt;endpoint address="BusinessUnit" contract="IBusinessUnitDAO" /&gt; &lt;endpoint address="BusinessFunction" contract="IBusinessFunctionDAO" /&gt; &lt;/service&gt; </code></pre> <p>Any help would be appreciated.</p> <p>Thanks, Raul</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload