This should be a straightforward question.
I am unable to connect to a specific endpoint using WCFTestClient tool. I have a service config. like this:
<service name="CO.Services.SvcTest">
<endpoint address="ep1" binding="basicHttpBinding" bindingConfiguration=""
bindingNamespace="http://api.CO.com/Services/Tester/ep1"
contract="CO.Services.ISvcTest" />
<endpoint address="ep2" binding="basicHttpBinding" bindingConfiguration=""
bindingNamespace="http://api.CO.com/Services/Tester/ep2"
contract="CO.Services.ISvcTest_v2" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
name="" contract="IMetadataExchange" />
</service>
If I pass 'http://localhost:2659/Tester.svc/ep1' or 'http://localhost:2659/Tester.svc/ep2' I get "Cannot obtain Metadata from..." but if I pass 'http://localhost:2659/Tester.svc it works and shows me both endpoints.
Does anyone know what am I missing?
EDIT1: Is this even possible?
That's the correct behavior.
In WCF a service's metadata is served at the service's base address by default.
If you're hosting your service in a custom process, you can customize the URL of the base address or even add new ones using the baseAddresses configuration section. If you're hosting the service in IIS, which seems to be your case, then the base address is always the URL of the .svc
file.
EDIT: If you want two completely separate endpoints, then you will have to create two service implementations, one for each contract, and configure them with different elements in your configuration file. As long as the endpoints are part of the same service, you will only be able to retrieve the metadata from the service's base address, which in your case is the URL of the .svc file.