Consuming a WCF Service using wshttp binding from a C++ client
Recently I have been testing the interoperability of our WCF services. Our services use wshttp bindings, custom security and some WCF extensions. My first target language is C++ and I’m starting off with VC++ in VS2005 with .net 3.0 on the machine.
VC++ does not have the same options for generating service references as C#. There seems to just be one method “Add Web Reference” that uses sproxy.exe behind the scenes. I tried this method first and ran into some problems. I then tried a rather interesting method where the proxy is generated as a C# class library that the C++ client uses to communicate with the web service.
- Create your C++ client in VS2005
- Add a new project to the solution of type C# class library
- In the C# project add a service reference to your web service
- in the C++ project add a reference to the C# project
- in the C++ project add an app.config file
- copy all the gubbins from the C# app.config into the C++ app.config
- follow this guidance to make your C++ client use the app.config
1 comment so far
Leave a reply
Hello,
I have vc++ application using vs2005. I may need it to connect as a client to a WCF service. What is the best approach for me within vs2005 to approach this? Your instructions seem very relevant to what I need to do. Can you make any further suggestions to help get us going?
Thanks for a good post!
Robin