/* soapBasicHttpBinding_USCOREICalculatorProxy.cpp
   Generated by gSOAP 2.8.48 for calculator.h

gSOAP XML Web services tools
Copyright (C) 2000-2017, Robert van Engelen, Genivia Inc. All Rights Reserved.
The soapcpp2 tool and its generated software are released under the GPL.
This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
--------------------------------------------------------------------------------
A commercial use license is available from Genivia Inc., contact@genivia.com
--------------------------------------------------------------------------------
*/

#include "soapBasicHttpBinding_USCOREICalculatorProxy.h"

BasicHttpBinding_USCOREICalculatorProxy::BasicHttpBinding_USCOREICalculatorProxy()
{	this->soap = soap_new();
	this->soap_own = true;
	BasicHttpBinding_USCOREICalculatorProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
}

BasicHttpBinding_USCOREICalculatorProxy::BasicHttpBinding_USCOREICalculatorProxy(const BasicHttpBinding_USCOREICalculatorProxy& rhs)
{	this->soap = rhs.soap;
	this->soap_own = false;
	this->soap_endpoint = rhs.soap_endpoint;
}

BasicHttpBinding_USCOREICalculatorProxy::BasicHttpBinding_USCOREICalculatorProxy(struct soap *_soap)
{	this->soap = _soap;
	this->soap_own = false;
	BasicHttpBinding_USCOREICalculatorProxy_init(_soap->imode, _soap->omode);
}

BasicHttpBinding_USCOREICalculatorProxy::BasicHttpBinding_USCOREICalculatorProxy(const char *endpoint)
{	this->soap = soap_new();
	this->soap_own = true;
	BasicHttpBinding_USCOREICalculatorProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
	soap_endpoint = endpoint;
}

BasicHttpBinding_USCOREICalculatorProxy::BasicHttpBinding_USCOREICalculatorProxy(soap_mode iomode)
{	this->soap = soap_new();
	this->soap_own = true;
	BasicHttpBinding_USCOREICalculatorProxy_init(iomode, iomode);
}

BasicHttpBinding_USCOREICalculatorProxy::BasicHttpBinding_USCOREICalculatorProxy(const char *endpoint, soap_mode iomode)
{	this->soap = soap_new();
	this->soap_own = true;
	BasicHttpBinding_USCOREICalculatorProxy_init(iomode, iomode);
	soap_endpoint = endpoint;
}

BasicHttpBinding_USCOREICalculatorProxy::BasicHttpBinding_USCOREICalculatorProxy(soap_mode imode, soap_mode omode)
{	this->soap = soap_new();
	this->soap_own = true;
	BasicHttpBinding_USCOREICalculatorProxy_init(imode, omode);
}

BasicHttpBinding_USCOREICalculatorProxy::~BasicHttpBinding_USCOREICalculatorProxy()
{	if (this->soap_own)
		soap_free(this->soap);
}

void BasicHttpBinding_USCOREICalculatorProxy::BasicHttpBinding_USCOREICalculatorProxy_init(soap_mode imode, soap_mode omode)
{	soap_imode(this->soap, imode);
	soap_omode(this->soap, omode);
	soap_endpoint = NULL;
	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},
        {"tempuri", "http://tempuri.org/", NULL, NULL},
        {"mssamt", "http://Microsoft.Samples.TransportSecurity", NULL, NULL},
        {NULL, NULL, NULL, NULL}
    };
	soap_set_namespaces(this->soap, namespaces);
}

#ifndef WITH_PURE_VIRTUAL
BasicHttpBinding_USCOREICalculatorProxy *BasicHttpBinding_USCOREICalculatorProxy::copy()
{	BasicHttpBinding_USCOREICalculatorProxy *dup = SOAP_NEW_COPY(BasicHttpBinding_USCOREICalculatorProxy);
	if (dup)
		soap_copy_context(dup->soap, this->soap);
	return dup;
}
#endif

BasicHttpBinding_USCOREICalculatorProxy& BasicHttpBinding_USCOREICalculatorProxy::operator=(const BasicHttpBinding_USCOREICalculatorProxy& rhs)
{	if (this->soap_own)
		soap_free(this->soap);
	this->soap = rhs.soap;
	this->soap_own = false;
	this->soap_endpoint = rhs.soap_endpoint;
	return *this;
}

void BasicHttpBinding_USCOREICalculatorProxy::destroy()
{	soap_destroy(this->soap);
	soap_end(this->soap);
}

void BasicHttpBinding_USCOREICalculatorProxy::reset()
{	this->destroy();
	soap_done(this->soap);
	soap_initialize(this->soap);
	BasicHttpBinding_USCOREICalculatorProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
}

void BasicHttpBinding_USCOREICalculatorProxy::soap_noheader()
{	this->soap->header = NULL;
}

::SOAP_ENV__Header *BasicHttpBinding_USCOREICalculatorProxy::soap_header()
{	return this->soap->header;
}

::SOAP_ENV__Fault *BasicHttpBinding_USCOREICalculatorProxy::soap_fault()
{	return this->soap->fault;
}

const char *BasicHttpBinding_USCOREICalculatorProxy::soap_fault_string()
{	return *soap_faultstring(this->soap);
}

const char *BasicHttpBinding_USCOREICalculatorProxy::soap_fault_detail()
{	return *soap_faultdetail(this->soap);
}

int BasicHttpBinding_USCOREICalculatorProxy::soap_close_socket()
{	return soap_closesock(this->soap);
}

int BasicHttpBinding_USCOREICalculatorProxy::soap_force_close_socket()
{	return soap_force_closesock(this->soap);
}

void BasicHttpBinding_USCOREICalculatorProxy::soap_print_fault(FILE *fd)
{	::soap_print_fault(this->soap, fd);
}

#ifndef WITH_LEAN
#ifndef WITH_COMPAT
void BasicHttpBinding_USCOREICalculatorProxy::soap_stream_fault(std::ostream& os)
{	::soap_stream_fault(this->soap, os);
}
#endif

char *BasicHttpBinding_USCOREICalculatorProxy::soap_sprint_fault(char *buf, size_t len)
{	return ::soap_sprint_fault(this->soap, buf, len);
}
#endif

int BasicHttpBinding_USCOREICalculatorProxy::Add(const char *endpoint, const char *soap_action, _mssamt__Add *mssamt__Add, _mssamt__AddResponse *mssamt__AddResponse)
{	struct soap *soap = this->soap;
	struct __tempuri__Add soap_tmp___tempuri__Add;
	if (endpoint)
		soap_endpoint = endpoint;
	if (soap_endpoint == NULL)
		soap_endpoint = "https://192.168.2.2:8000/ServiceModelSamples/service";
	if (soap_action == NULL)
		soap_action = "http://Microsoft.Samples.TransportSecurity/ICalculator/Add";
	soap_tmp___tempuri__Add.mssamt__Add = mssamt__Add;
	soap_begin(soap);
	soap->encodingStyle = NULL;
	soap_serializeheader(soap);
	soap_serialize___tempuri__Add(soap, &soap_tmp___tempuri__Add);
	if (soap_begin_count(soap))
		return soap->error;
	if (soap->mode & SOAP_IO_LENGTH)
	{	if (soap_envelope_begin_out(soap)
		 || soap_putheader(soap)
		 || soap_body_begin_out(soap)
		 || soap_put___tempuri__Add(soap, &soap_tmp___tempuri__Add, "-tempuri:Add", "")
		 || soap_body_end_out(soap)
		 || soap_envelope_end_out(soap))
			 return soap->error;
	}
	if (soap_end_count(soap))
		return soap->error;
	if (soap_connect(soap, soap_endpoint, soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___tempuri__Add(soap, &soap_tmp___tempuri__Add, "-tempuri:Add", "")
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!mssamt__AddResponse)
		return soap_closesock(soap);
	mssamt__AddResponse->soap_default(soap);
	if (soap_begin_recv(soap)
	 || soap_envelope_begin_in(soap)
	 || soap_recv_header(soap)
	 || soap_body_begin_in(soap))
		return soap_closesock(soap);
	mssamt__AddResponse->soap_get(soap, "mssamt:AddResponse", NULL);
	if (soap->error)
		return soap_recv_fault(soap, 0);
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap_closesock(soap);
	return soap_closesock(soap);
}

int BasicHttpBinding_USCOREICalculatorProxy::Subtract(const char *endpoint, const char *soap_action, _mssamt__Subtract *mssamt__Subtract, _mssamt__SubtractResponse *mssamt__SubtractResponse)
{	struct soap *soap = this->soap;
	struct __tempuri__Subtract soap_tmp___tempuri__Subtract;
	if (endpoint)
		soap_endpoint = endpoint;
	if (soap_endpoint == NULL)
		soap_endpoint = "https://192.168.2.2:8000/ServiceModelSamples/service";
	if (soap_action == NULL)
		soap_action = "http://Microsoft.Samples.TransportSecurity/ICalculator/Subtract";
	soap_tmp___tempuri__Subtract.mssamt__Subtract = mssamt__Subtract;
	soap_begin(soap);
	soap->encodingStyle = NULL;
	soap_serializeheader(soap);
	soap_serialize___tempuri__Subtract(soap, &soap_tmp___tempuri__Subtract);
	if (soap_begin_count(soap))
		return soap->error;
	if (soap->mode & SOAP_IO_LENGTH)
	{	if (soap_envelope_begin_out(soap)
		 || soap_putheader(soap)
		 || soap_body_begin_out(soap)
		 || soap_put___tempuri__Subtract(soap, &soap_tmp___tempuri__Subtract, "-tempuri:Subtract", "")
		 || soap_body_end_out(soap)
		 || soap_envelope_end_out(soap))
			 return soap->error;
	}
	if (soap_end_count(soap))
		return soap->error;
	if (soap_connect(soap, soap_endpoint, soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___tempuri__Subtract(soap, &soap_tmp___tempuri__Subtract, "-tempuri:Subtract", "")
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!mssamt__SubtractResponse)
		return soap_closesock(soap);
	mssamt__SubtractResponse->soap_default(soap);
	if (soap_begin_recv(soap)
	 || soap_envelope_begin_in(soap)
	 || soap_recv_header(soap)
	 || soap_body_begin_in(soap))
		return soap_closesock(soap);
	mssamt__SubtractResponse->soap_get(soap, "mssamt:SubtractResponse", NULL);
	if (soap->error)
		return soap_recv_fault(soap, 0);
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap_closesock(soap);
	return soap_closesock(soap);
}

int BasicHttpBinding_USCOREICalculatorProxy::Multiply(const char *endpoint, const char *soap_action, _mssamt__Multiply *mssamt__Multiply, _mssamt__MultiplyResponse *mssamt__MultiplyResponse)
{	struct soap *soap = this->soap;
	struct __tempuri__Multiply soap_tmp___tempuri__Multiply;
	if (endpoint)
		soap_endpoint = endpoint;
	if (soap_endpoint == NULL)
		soap_endpoint = "https://192.168.2.2:8000/ServiceModelSamples/service";
	if (soap_action == NULL)
		soap_action = "http://Microsoft.Samples.TransportSecurity/ICalculator/Multiply";
	soap_tmp___tempuri__Multiply.mssamt__Multiply = mssamt__Multiply;
	soap_begin(soap);
	soap->encodingStyle = NULL;
	soap_serializeheader(soap);
	soap_serialize___tempuri__Multiply(soap, &soap_tmp___tempuri__Multiply);
	if (soap_begin_count(soap))
		return soap->error;
	if (soap->mode & SOAP_IO_LENGTH)
	{	if (soap_envelope_begin_out(soap)
		 || soap_putheader(soap)
		 || soap_body_begin_out(soap)
		 || soap_put___tempuri__Multiply(soap, &soap_tmp___tempuri__Multiply, "-tempuri:Multiply", "")
		 || soap_body_end_out(soap)
		 || soap_envelope_end_out(soap))
			 return soap->error;
	}
	if (soap_end_count(soap))
		return soap->error;
	if (soap_connect(soap, soap_endpoint, soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___tempuri__Multiply(soap, &soap_tmp___tempuri__Multiply, "-tempuri:Multiply", "")
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!mssamt__MultiplyResponse)
		return soap_closesock(soap);
	mssamt__MultiplyResponse->soap_default(soap);
	if (soap_begin_recv(soap)
	 || soap_envelope_begin_in(soap)
	 || soap_recv_header(soap)
	 || soap_body_begin_in(soap))
		return soap_closesock(soap);
	mssamt__MultiplyResponse->soap_get(soap, "mssamt:MultiplyResponse", NULL);
	if (soap->error)
		return soap_recv_fault(soap, 0);
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap_closesock(soap);
	return soap_closesock(soap);
}

int BasicHttpBinding_USCOREICalculatorProxy::Divide(const char *endpoint, const char *soap_action, _mssamt__Divide *mssamt__Divide, _mssamt__DivideResponse *mssamt__DivideResponse)
{	struct soap *soap = this->soap;
	struct __tempuri__Divide soap_tmp___tempuri__Divide;
	if (endpoint)
		soap_endpoint = endpoint;
	if (soap_endpoint == NULL)
		soap_endpoint = "https://192.168.2.2:8000/ServiceModelSamples/service";
	if (soap_action == NULL)
		soap_action = "http://Microsoft.Samples.TransportSecurity/ICalculator/Divide";
	soap_tmp___tempuri__Divide.mssamt__Divide = mssamt__Divide;
	soap_begin(soap);
	soap->encodingStyle = NULL;
	soap_serializeheader(soap);
	soap_serialize___tempuri__Divide(soap, &soap_tmp___tempuri__Divide);
	if (soap_begin_count(soap))
		return soap->error;
	if (soap->mode & SOAP_IO_LENGTH)
	{	if (soap_envelope_begin_out(soap)
		 || soap_putheader(soap)
		 || soap_body_begin_out(soap)
		 || soap_put___tempuri__Divide(soap, &soap_tmp___tempuri__Divide, "-tempuri:Divide", "")
		 || soap_body_end_out(soap)
		 || soap_envelope_end_out(soap))
			 return soap->error;
	}
	if (soap_end_count(soap))
		return soap->error;
	if (soap_connect(soap, soap_endpoint, soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___tempuri__Divide(soap, &soap_tmp___tempuri__Divide, "-tempuri:Divide", "")
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!mssamt__DivideResponse)
		return soap_closesock(soap);
	mssamt__DivideResponse->soap_default(soap);
	if (soap_begin_recv(soap)
	 || soap_envelope_begin_in(soap)
	 || soap_recv_header(soap)
	 || soap_body_begin_in(soap))
		return soap_closesock(soap);
	mssamt__DivideResponse->soap_get(soap, "mssamt:DivideResponse", NULL);
	if (soap->error)
		return soap_recv_fault(soap, 0);
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap_closesock(soap);
	return soap_closesock(soap);
}
/* End of client proxy code */
