Click here to Skip to main content
14,872,753 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai friends...

Can anybody help, i have a WCF Service with multiple bindings,Ex: basicHttpBinding and netTcpBinding, but my WCFService is supporting for basicHttpBinding only. I gave 2 BaseAddress in webconfig file 1 for baseAddress="http://localhost:8471/Design_Time_Addresses/WCFData/Service1" and 2 for baseAddress="net.tcp://localhost:8732/Design_Time_Addresses/WCFData/Service1"

But its showing compile error for 2 addresses, if i give http then working fine.
Posted

Hi,

One of the probable reason could be,since the service is configured for more than one binding(in this case http and tcp), The default constructor of the proxy ,In the generated code at the client wont work. you have to explicitly mention the name of the binding which you want to work with.


for ex:

This wont work when there are 2 bindings for a service
using( ServiceClient proxy = new ServiceClient())
{

}


you need to make use of

using( ServiceClient proxy = new ServiceClient("Give the name of the binding which u want to use"))
{

}


I hope this helps!.

Regards,
-Vinayak
   
If you are using Config file to configure multiples binding then please post here all elements of <system.serviceModel> section

OR
If you are using through code means without configuration file then please post here piece of code.

Also post here exception message which is you are getting.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900