CurrencyConvertor - How use gSOAP and WebServices - Part 2 Doing the first WS client.
Introduction
This is the second of two articles where I explain building a web service client from wsdl file. With Part One, I explained how to get the class from the wsdl file to be used in VC++ 6. In Part Two, I will show you how to use the classes generated with gSOAP in Part One.
Using the code
Usually in the file soap*****************SoapProxy.h we can find the class definition of generic WS. In this case, soapCurrencyConvertorSoapProxy.h, I have already included it in Part One.

//soapCurrencyConvertorSoapProxy.h
#ifndef soapCurrencyConvertorSoap_H
#define soapCurrencyConvertorSoap_H
#include "soapH.h"
class CurrencyConvertorSoap
{ public:
struct soap *soap;
const char *endpoint;
CurrencyConvertorSoap()
{ soap = soap_new(); endpoint =
"http://www.webservicex.net/CurrencyConvertor.asmx";
if (soap && !soap->namespaces)
{ static const struct Namespace namespaces[] =
{
{
"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/",
"http://www.w3.org/*/soap-envelope", NULL},
{
"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/",
"http://www.w3.org/*/soap-encoding", NULL},
{
"xsi", "http://www.w3.org/2001/XMLSchema-instance",
"http://www.w3.org/*/XMLSchema-instance", NULL},
{
"xsd", "http://www.w3.org/2001/XMLSchema",
"http://www.w3.org/*/XMLSchema", NULL},
{
"ns1", "http://www.webserviceX.NET/", NULL, NULL},
{NULL, NULL, NULL, NULL}
};
soap->namespaces = namespaces; } };
virtual ~CurrencyConvertorSoap() { if (soap) { soap_destroy(soap);
soap_end(soap); soap_done(soap); soap_del(soap); } };
virtual int __ns1__ConversionRate(_ns1__