-
Notifications
You must be signed in to change notification settings - Fork 6
/
soapcalculatorProxy.h
executable file
·38 lines (37 loc) · 2.12 KB
/
soapcalculatorProxy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* soapcalculatorProxy.h
Generated by gSOAP 2.7.10 from calc.h
Copyright(C) 2000-2008, Robert van Engelen, Genivia Inc. All Rights Reserved.
This part of the software is released under one of the following licenses:
GPL, the gSOAP public license, or Genivia's license for commercial use.
*/
#ifndef soapcalculatorProxy_H
#define soapcalculatorProxy_H
#include "soapH.h"
class calculator
{ public:
/// Runtime engine context allocated in constructor
struct soap *soap;
/// Endpoint URL of service 'calculator' (change as needed)
const char *endpoint;
/// Constructor allocates soap engine context, sets default endpoint URL, and sets namespace mapping table
calculator()
{ soap = soap_new(); endpoint = "http://192.168.0.131:1234"; 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},
{"ns", "calculator", NULL, NULL},
{NULL, NULL, NULL, NULL}
};
soap->namespaces = namespaces; } };
/// Destructor frees deserialized data and soap engine context
virtual ~calculator() { if (soap) { soap_destroy(soap); soap_end(soap); soap_free(soap); } };
/// Invoke 'add' of service 'calculator' and return error code (or SOAP_OK)
virtual int ns__add(int a, int b, int &result) { return soap ? soap_call_ns__add(soap, endpoint, NULL, a, b, result) : SOAP_EOM; };
/// Invoke 'test' of service 'calculator' and return error code (or SOAP_OK)
virtual int ns__test(char *a, char **result) { return soap ? soap_call_ns__test(soap, endpoint, NULL, a, result) : SOAP_EOM; };
/// Invoke 'sub' of service 'calculator' and return error code (or SOAP_OK)
virtual int ns__sub(double a, double b, double &result) { return soap ? soap_call_ns__sub(soap, endpoint, NULL, a, b, result) : SOAP_EOM; };
};
#endif