/* soapXmlaWebServiceSoapProxy.cpp
   Generated by gSOAP 2.8.15 from xmlaWSDL.h

Copyright(C) 2000-2013, Robert van Engelen, Genivia Inc. All Rights Reserved.
The generated code is released under ONE of the following licenses:
GPL or Genivia's license for commercial use.
This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
*/

#include "soapXmlaWebServiceSoapProxy.h"

XmlaWebServiceSoapProxy::XmlaWebServiceSoapProxy()
{	XmlaWebServiceSoapProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
}

XmlaWebServiceSoapProxy::XmlaWebServiceSoapProxy(const struct soap &_soap) : soap(_soap)
{ }

XmlaWebServiceSoapProxy::XmlaWebServiceSoapProxy(const char *url)
{	XmlaWebServiceSoapProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
	soap_endpoint = url;
}

XmlaWebServiceSoapProxy::XmlaWebServiceSoapProxy(soap_mode iomode)
{	XmlaWebServiceSoapProxy_init(iomode, iomode);
}

XmlaWebServiceSoapProxy::XmlaWebServiceSoapProxy(const char *url, soap_mode iomode)
{	XmlaWebServiceSoapProxy_init(iomode, iomode);
	soap_endpoint = url;
}

XmlaWebServiceSoapProxy::XmlaWebServiceSoapProxy(soap_mode imode, soap_mode omode)
{	XmlaWebServiceSoapProxy_init(imode, omode);
}

XmlaWebServiceSoapProxy::~XmlaWebServiceSoapProxy()
{ }

void XmlaWebServiceSoapProxy::XmlaWebServiceSoapProxy_init(soap_mode imode, soap_mode omode)
{	soap_imode(this, imode);
	soap_omode(this, omode);
	soap_endpoint = NULL;
	static const struct Namespace namespaces[] =
{
	{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://schemas.xmlsoap.org/soap/envelope/", NULL},
	{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://schemas.xmlsoap.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},
	{"ns2", "urn:schemas-microsoft-com:xml-analysis:rowset", NULL, NULL},
	{"ns4", "urn:schemas-microsoft-com:xml-analysis:mddataset", NULL, NULL},
	{"ns5", "urn:schemas-microsoft-com:xml-analysis:empty", NULL, NULL},
	{"ns3", "http://www.w3.org/2001/XMLSchema", NULL, NULL},
	{"ns6", "http://schemas.xmlsoap.org/ws/2002/04/secext", NULL, NULL},
	{"ns1", "urn:schemas-microsoft-com:xml-analysis", NULL, NULL},
	{NULL, NULL, NULL, NULL}
};
	soap_set_namespaces(this, namespaces);
}

void XmlaWebServiceSoapProxy::destroy()
{	soap_destroy(this);
	soap_end(this);
}

void XmlaWebServiceSoapProxy::reset()
{	destroy();
	soap_done(this);
	soap_init(this);
	XmlaWebServiceSoapProxy_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
}

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

void XmlaWebServiceSoapProxy::soap_header(ns1__BeginSession *ns1__BeginSession_, ns1__EndSession *ns1__EndSession_, ns1__Session *ns1__Session_, ns6__Security *ns6__Security_)
{	::soap_header(this);
	this->header->ns1__BeginSession_ = ns1__BeginSession_;
	this->header->ns1__EndSession_ = ns1__EndSession_;
	this->header->ns1__Session_ = ns1__Session_;
	this->header->ns6__Security_ = ns6__Security_;
}

const SOAP_ENV__Header *XmlaWebServiceSoapProxy::soap_header()
{	return this->header;
}

const SOAP_ENV__Fault *XmlaWebServiceSoapProxy::soap_fault()
{	return this->fault;
}

const char *XmlaWebServiceSoapProxy::soap_fault_string()
{	return *soap_faultstring(this);
}

const char *XmlaWebServiceSoapProxy::soap_fault_detail()
{	return *soap_faultdetail(this);
}

int XmlaWebServiceSoapProxy::soap_close_socket()
{	return soap_closesock(this);
}

int XmlaWebServiceSoapProxy::soap_force_close_socket()
{	return soap_force_closesock(this);
}

void XmlaWebServiceSoapProxy::soap_print_fault(FILE *fd)
{	::soap_print_fault(this, fd);
}

#ifndef WITH_LEAN
#ifndef WITH_COMPAT
void XmlaWebServiceSoapProxy::soap_stream_fault(std::ostream& os)
{	::soap_stream_fault(this, os);
}
#endif

char *XmlaWebServiceSoapProxy::soap_sprint_fault(char *buf, size_t len)
{	return ::soap_sprint_fault(this, buf, len);
}
#endif

int XmlaWebServiceSoapProxy::Execute(const char *endpoint, const char *soap_action, _ns1__Execute *ns1__Execute, _ns1__ExecuteResponse *ns1__ExecuteResponse)
{	struct soap *soap = this;
	struct __ns1__Execute soap_tmp___ns1__Execute;
	if (endpoint)
		soap_endpoint = endpoint;
	if (soap_endpoint == NULL)
		soap_endpoint = "http://209.139.232.176:8282/M4OXmlaWebService/services/XmlaWebService";
	if (soap_action == NULL)
		soap_action = "urn:schemas-microsoft-com:xml-analysis:Execute";
	soap->encodingStyle = NULL;
	soap_tmp___ns1__Execute.ns1__Execute = ns1__Execute;
	soap_begin(soap);
	soap_set_version(soap, 1); /* SOAP1.1 */
	soap_serializeheader(soap);
	soap_serialize___ns1__Execute(soap, &soap_tmp___ns1__Execute);
	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___ns1__Execute(soap, &soap_tmp___ns1__Execute, "-ns1:Execute", NULL)
		 || 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_url(soap, soap_endpoint, NULL), soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___ns1__Execute(soap, &soap_tmp___ns1__Execute, "-ns1:Execute", NULL)
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!ns1__ExecuteResponse)
		return soap_closesock(soap);
	ns1__ExecuteResponse->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);
	ns1__ExecuteResponse->soap_get(soap, "ns1:ExecuteResponse", "");
	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 XmlaWebServiceSoapProxy::Discover(const char *endpoint, const char *soap_action, _ns1__Discover *ns1__Discover, _ns1__DiscoverResponse *ns1__DiscoverResponse)
{	struct soap *soap = this;
	struct __ns1__Discover soap_tmp___ns1__Discover;
	if (endpoint)
		soap_endpoint = endpoint;
	if (soap_endpoint == NULL)
		soap_endpoint = "http://209.139.232.176:8282/M4OXmlaWebService/services/XmlaWebService";
	if (soap_action == NULL)
		soap_action = "urn:schemas-microsoft-com:xml-analysis:Discover";
	soap->encodingStyle = NULL;
	soap_tmp___ns1__Discover.ns1__Discover = ns1__Discover;
	soap_begin(soap);
	soap_set_version(soap, 1); /* SOAP1.1 */
	soap_serializeheader(soap);
	soap_serialize___ns1__Discover(soap, &soap_tmp___ns1__Discover);
	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___ns1__Discover(soap, &soap_tmp___ns1__Discover, "-ns1:Discover", NULL)
		 || 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_url(soap, soap_endpoint, NULL), soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___ns1__Discover(soap, &soap_tmp___ns1__Discover, "-ns1:Discover", NULL)
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!ns1__DiscoverResponse)
		return soap_closesock(soap);
	ns1__DiscoverResponse->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);
	ns1__DiscoverResponse->soap_get(soap, "ns1:DiscoverResponse", "");
	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 XmlaWebServiceSoapProxy::Execute_(const char *endpoint, const char *soap_action, _ns1__Execute *ns1__Execute, _ns1__ExecuteResponse *ns1__ExecuteResponse)
{	struct soap *soap = this;
	struct __ns1__Execute_ soap_tmp___ns1__Execute_;
	if (endpoint)
		soap_endpoint = endpoint;
	if (soap_endpoint == NULL)
		soap_endpoint = "http://209.139.232.176:8282/M4OXmlaWebService/services/XmlaWebService";
	if (soap_action == NULL)
		soap_action = "urn:schemas-microsoft-com:xml-analysis:Execute";
	soap->encodingStyle = NULL;
	soap_tmp___ns1__Execute_.ns1__Execute = ns1__Execute;
	soap_begin(soap);
	soap_set_version(soap, 1); /* SOAP1.1 */
	soap_serializeheader(soap);
	soap_serialize___ns1__Execute_(soap, &soap_tmp___ns1__Execute_);
	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___ns1__Execute_(soap, &soap_tmp___ns1__Execute_, "-ns1:Execute", NULL)
		 || 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_url(soap, soap_endpoint, NULL), soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___ns1__Execute_(soap, &soap_tmp___ns1__Execute_, "-ns1:Execute", NULL)
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!ns1__ExecuteResponse)
		return soap_closesock(soap);
	ns1__ExecuteResponse->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);
	ns1__ExecuteResponse->soap_get(soap, "ns1:ExecuteResponse", "");
	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 XmlaWebServiceSoapProxy::Discover_(const char *endpoint, const char *soap_action, _ns1__Discover *ns1__Discover, _ns1__DiscoverResponse *ns1__DiscoverResponse)
{	struct soap *soap = this;
	struct __ns1__Discover_ soap_tmp___ns1__Discover_;
	if (endpoint)
		soap_endpoint = endpoint;
	if (soap_endpoint == NULL)
		soap_endpoint = "http://209.139.232.176:8282/M4OXmlaWebService/services/XmlaWebService";
	if (soap_action == NULL)
		soap_action = "urn:schemas-microsoft-com:xml-analysis:Discover";
	soap->encodingStyle = NULL;
	soap_tmp___ns1__Discover_.ns1__Discover = ns1__Discover;
	soap_begin(soap);
	soap_set_version(soap, 1); /* SOAP1.1 */
	soap_serializeheader(soap);
	soap_serialize___ns1__Discover_(soap, &soap_tmp___ns1__Discover_);
	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___ns1__Discover_(soap, &soap_tmp___ns1__Discover_, "-ns1:Discover", NULL)
		 || 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_url(soap, soap_endpoint, NULL), soap_action)
	 || soap_envelope_begin_out(soap)
	 || soap_putheader(soap)
	 || soap_body_begin_out(soap)
	 || soap_put___ns1__Discover_(soap, &soap_tmp___ns1__Discover_, "-ns1:Discover", NULL)
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap_closesock(soap);
	if (!ns1__DiscoverResponse)
		return soap_closesock(soap);
	ns1__DiscoverResponse->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);
	ns1__DiscoverResponse->soap_get(soap, "ns1:DiscoverResponse", "");
	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 */
