I've got this WCF service contract (heavily simplified, but pay attention to the namespace it's in):
namespace Foo.Services.BarService
{
[ServiceContract]
interface BarContract {... }
}
In my app.config
(client side), I configure an endpoint for some service:
<endpoint address="..."
binding="..."
contract="Foo.Services.BarService.BarContract" />
However, this results in an error saying that no endpoint was found in the client's configuration that supports BarService.BarContract
. I can only get rid of this error by changing the contract
attribute value to BarService.BarContract
(i.e. by removing the namespace).
Why is that? Where could this error come from? Why must I not mention the namespace part of a contract type? Shouldn't that result even more in WCF not finding a matching endpoint?
Reply to the questions in @Ladislav Mrnka's comment below:
I am talking about the client side. (I forgot to mention this bit; sorry for that.) Can this error possibly come from the server side?
I generated the above service contract, along with a
BarClient
class that implements it, via Visual Studio's Add Service Reference facility. I specified the URL of theBarService
, which is run by someone else. That's where I also specified that the service should be put in theFoo.Services.BarService
namespace.I was going to use the service directly via the
BarClient
class auto-generated for me, not via aChannelFactory<BarContract>
.