J
Jerry Nettleton
I have a web client with a reference to a WCF service (added using 'add
service reference...'). During development, I want to use localhost and then
later deploy it to another web server. So I created multiple endpoints as
shown:
<system.serviceModel>
<client>
<endpoint address="http://myapp_dev/SoaServices/MyService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IMyService"
contract="MyServiceReference.IMyService" name="webMyService" />
<endpoint address="http://localhost:3885/MyService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IMyService"
contract="MyServiceReference.IMyService" name="localMyService" />
</client>
</system.serviceModel>
When I add code to use the local endpoint:
MyServiceClient psc = new MyServiceClient("localMyService");
I always get an error message:
"Could not find endpoint element with name 'localMyService' and contract
'MyServiceReference.IMyService' in the ServiceModel client configuration
section. This might be because no configuration file was found for your
application, or because no endpoint element matching this name could be found
in the client element."
I have tried using the full name (including the namespace) but that doesn't
work.
Any other thoughts on how to resolve this error?
Can you recommend another way to debug/develop the client and service using
VS 2008 and then later build the code for deployment?
Thanks,
Jerry
service reference...'). During development, I want to use localhost and then
later deploy it to another web server. So I created multiple endpoints as
shown:
<system.serviceModel>
<client>
<endpoint address="http://myapp_dev/SoaServices/MyService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IMyService"
contract="MyServiceReference.IMyService" name="webMyService" />
<endpoint address="http://localhost:3885/MyService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IMyService"
contract="MyServiceReference.IMyService" name="localMyService" />
</client>
</system.serviceModel>
When I add code to use the local endpoint:
MyServiceClient psc = new MyServiceClient("localMyService");
I always get an error message:
"Could not find endpoint element with name 'localMyService' and contract
'MyServiceReference.IMyService' in the ServiceModel client configuration
section. This might be because no configuration file was found for your
application, or because no endpoint element matching this name could be found
in the client element."
I have tried using the full name (including the namespace) but that doesn't
work.
Any other thoughts on how to resolve this error?
Can you recommend another way to debug/develop the client and service using
VS 2008 and then later build the code for deployment?
Thanks,
Jerry