#include <stdio.h>
#include <ServiceClient.h>
#include <OMElement.h>
#include <iostream>
#include <AxisFault.h>
#include <Environment.h>
using namespace std;
using namespace wso2wsf;
int main(int argc, char *argv[])
{
Environment::initialize("hello.log", AXIS2_LOG_LEVEL_TRACE);
string end_point = "http://localhost:9090/axis2/services/hello";
ServiceClient sc(end_point);
OMElement * payload = new OMElement("greet");
payload->setText("Hello World!");
try
{
OMElement* response = sc.request(payload, "");
if (response)
{
cout << endl << "Response: " << response << endl;
}
}
catch (AxisFault & e)
{
if (sc.getLastSOAPFault())
{
cout << endl << "Fault: " << sc.getLastSOAPFault() << endl;
}
else
{
cout << endl << "Error: " << e << endl;
}
}
delete payload;
}