Calling a WCF service in a custom tool in ArcMap

Discussion created by patton44 on Aug 1, 2011
I have created a WCF service in Visual Studio 2008 and tested it in a client project and it works fine. The service is using wsHttpBinding. Now, I have created a new VS solution that contains an ArcMap tool. I want to call my service from the newly created tool. In the tool's project I have added a service reference to my WCF service. Next, I have created code to call the service and pass some parameters to it.

                IdTool.CogIdToolClient MyClient = new CogIdToolWeb.IdTool.CogIdToolClient();
                IdTool.CogIdTool MyReturn = (IdTool.CogIdTool)MyClient.retValues(2264, x, y);

When I test my tool in ArcMap I get the error "Could not find default endpoint element that references contract...."

I have tried many different things and cannot get the service to work with the custom tool. Is it possible for a WCF service to be called from a desktop application? If so, how does it need to be referenced?

Thanks in advance for the help.