|
Location: Desktop development - C/C++ License: The Intelliproject Open License (IPOL) Building A SOAP Client With Visual C++Posted by Caragea SilviuA simple way to create a SOAP client using C++ |
Skill: AdvancedPosted: 04/10/2008Views: 160Rating: 5.00 /5Popularity: 0.00 |
| Sign Up to vote for this article |
SOAP is an acronym that comes from "Simple Object Access Protocol". It's used for exchanging XML-based messages over computer networks, normally using HTTP/HTTPS. SOAP forms the foundation layer of the web services protocol stack providing a basic messaging framework upon which abstract layers can be built.
If you want to build a SOAP client you can choose to use different open source solutions available on internet. Also you can opt for Microsoft SOAP Toolkit which is a set of DLLs which can be exploited from an any language within the COM (Component Object Model) family (as long, of course, as the executable is running on a Win32 system).
In this article I will show you a more simple method (in my opinion) based on IXMLHTTPRequest which provides client-side protocol support for communication with HTTP servers.
The above class is a very useful wrapper for IXMLHTTPRequestPtr. It has just two methods:
HRESULT Connect(char *szServer , char * szAction) used to initialize the connection.HRESULT SendXMLConntent(_bstr_t xmlContent , _bstr_t &respond) used to send and receive the xml content.Before creating any CSoapBase instance do not forget to initialize the COM library using CoInitialize or CoInitializeEx.
In the source code attached to this article you can find an example which use CSoapBase to login on www.betfair.com using Betfair API SOAP server.
After you receive the xml content you can use any XML parser available on internet to parse it.
This article, along with any associated source code and files, is licensed under The Intelliproject Open License (IPOL)
| Caragea Silviu
| Caragea Silviu is the Fondator, Administrator and Chief Editor who wrote and runs The IntelliProject. He's been programming since 2000 and now he's student at The Faculty of Economic Cybernetics, Statistics and Informatics from Bucharest. In the same time he's working as software developer at Cratima Software, a Romanian software and web design company that activates both on the local and foreign market, providing its customers with software development services, internet and intranet solutions, web design, graphic design and IT consultancy. His programming experience includes: - C,C++, Visual C++(Win32 API, MFC, ADO, STL, DAO, ODBC, ATL, COM, DirectShow, DirectDraw, WTL) - Open Source libraries :CURL & Boost - HTML, CSS - Java (SE,ME) - JavaScript, Ajax, Google Web Toolkit (GWT) - Php, MySQL -Oracle, PL SQL - C# .NET -Objective C, IPhone SDK, Cocoa Location: |
Sign up to post message on the article message board!