Reputation: 65
I'm trying to bind an asp.net page to wcf service hosted by another website,
the web.config file for the client has the code:
<endpoint address="http://localhost:1670/webhost/CustomersService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_ICustomersService" contract="CustomersService.ICustomersService" name="BasicHttpBinding_ICustomersService"/>
</client>
the web.config file for the service has the code:
<endpoint address="" binding="wsHttpBinding" contract="CustomerServiceLibrary1.ICustomersService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
and the error is :
Error 1 Reference.svcmap: The binding at system.serviceModel/bindings/wsHttpBinding does not have a configured binding named 'wsHttpBinding_ICustomersService'. This is an invalid value for bindingConfiguration. (C:\Users\Lara\Documents\Visual Studio 2010\Projects\CustomerServiceDemo\WebClient\web.config line 25) App_WebReferences/CustomersService/.
Upvotes: 1
Views: 5895
Reputation: 1289
I was getting the same exception
"The binding at system.serviceModel/bindings/basicHttpBinding does not have a configured binding named 'BasicHttpBinding_ITestService'. This is an invalid value for bindingConfiguration."
My Issue was solved when i specified and added the name of the endpoint having basicHttpBinding in the client side in code
TestServiceClient obj = new TestServiceClient("BasicHttpBinding_ITestService");
Upvotes: 0
Reputation: 1996
The following part of your client configuration bindingConfiguration="wsHttpBinding_ICustomersService"
tells that it should use a binding configuration with the name "wsHttpBinding_ICustomersService" do you have a binding configuration in your client web.config with that name?
The following article explains WCF and bindings http://msdn.microsoft.com/en-us/magazine/cc163394.aspx
But this part should be what your looking for
<configuration>
<system.serviceModel>
<services>
<service name=”ChatService”>
<endpoint address=”http://localhost:8080/chat”
binding=”basicHttpBinding”
bindingConfiguration=”basicConfig”
contract=”ChatLibrary.IChat” />
...
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name=”basicConfig” messageEncoding=”Mtom”>
<security mode=”Transport”/>
</binding>
</basicHttpBinding>
...
</bindings>
</system.serviceModel>
</configuration>
Notice the "bindings" section
Upvotes: 1