/* soapcwmpService.cpp
   Generated by gSOAP 2.8.83 for trapi.h

gSOAP XML Web services tools
Copyright (C) 2000-2018, 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 "soapcwmpService.h"

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

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

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

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

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

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

void cwmpService::cwmpService_init(soap_mode imode, soap_mode omode)
{	soap_imode(this->soap, imode);
    soap_omode(this->soap, omode);
    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 },
            { "cwmp", "urn:dslforum-org:cwmp-1-2", NULL, NULL },
            { NULL, NULL, NULL, NULL}
    };
    soap_set_namespaces(this->soap, namespaces);
}

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

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

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

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

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

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

int cwmpService::soap_senderfault(const char *string, const char *detailXML)
{	return ::soap_sender_fault(this->soap, string, detailXML);
}

int cwmpService::soap_senderfault(const char *subcodeQName, const char *string, const char *detailXML)
{	return ::soap_sender_fault_subcode(this->soap, subcodeQName, string, detailXML);
}

int cwmpService::soap_receiverfault(const char *string, const char *detailXML)
{	return ::soap_receiver_fault(this->soap, string, detailXML);
}

int cwmpService::soap_receiverfault(const char *subcodeQName, const char *string, const char *detailXML)
{	return ::soap_receiver_fault_subcode(this->soap, subcodeQName, string, detailXML);
}

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

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

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

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

void cwmpService::soap_header(struct _cwmp__SupportedCWMPVersions *cwmp__SupportedCWMPVersions, struct _cwmp__UseCWMPVersion *cwmp__UseCWMPVersion, struct _cwmp__SessionTimeout *cwmp__SessionTimeout, struct _cwmp__ID *cwmp__ID, struct _cwmp__HoldRequests *cwmp__HoldRequests)
{
    ::soap_header(this->soap);
    this->soap->header->cwmp__SupportedCWMPVersions = cwmp__SupportedCWMPVersions;
    this->soap->header->cwmp__UseCWMPVersion = cwmp__UseCWMPVersion;
    this->soap->header->cwmp__SessionTimeout = cwmp__SessionTimeout;
    this->soap->header->cwmp__ID = cwmp__ID;
    this->soap->header->cwmp__HoldRequests = cwmp__HoldRequests;
}

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

#ifndef WITH_NOIO
int cwmpService::run(int port, int backlog)
{	if (!soap_valid_socket(this->soap->master) && !soap_valid_socket(this->bind(NULL, port, backlog)))
        return this->soap->error;
    for (;;)
    {	if (!soap_valid_socket(this->accept()))
        {	if (this->soap->errnum == 0) // timeout?
                this->soap->error = SOAP_OK;
            break;
        }
        if (this->serve())
            break;
        this->destroy();
    }
    return this->soap->error;
}

#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
int cwmpService::ssl_run(int port, int backlog)
{	if (!soap_valid_socket(this->soap->master) && !soap_valid_socket(this->bind(NULL, port, backlog)))
		return this->soap->error;
	for (;;)
	{	if (!soap_valid_socket(this->accept()))
		{	if (this->soap->errnum == 0) // timeout?
				this->soap->error = SOAP_OK;
			break;
		}
		if (this->ssl_accept() || this->serve())
			break;
		this->destroy();
	}
	return this->soap->error;
}
#endif

SOAP_SOCKET cwmpService::bind(const char *host, int port, int backlog)
{	return soap_bind(this->soap, host, port, backlog);
}

SOAP_SOCKET cwmpService::accept()
{	return soap_accept(this->soap);
}

#if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
int cwmpService::ssl_accept()
{	return soap_ssl_accept(this->soap);
}
#endif
#endif

int cwmpService::serve()
{
#ifndef WITH_FASTCGI
    this->soap->keep_alive = this->soap->max_keep_alive + 1;
#endif
    do
    {
#ifndef WITH_FASTCGI
        if (this->soap->keep_alive > 0 && this->soap->max_keep_alive > 0)
            this->soap->keep_alive--;
#endif
        if (soap_begin_serve(this->soap))
        {
            if (this->soap->error >= SOAP_STOP){
                continue;
            }
            return this->soap->error;
        }
        if ((dispatch() || (this->soap->fserveloop && this->soap->fserveloop(this->soap))) && this->soap->error && this->soap->error < SOAP_STOP)
        {
#ifdef WITH_FASTCGI
            soap_send_fault(this->soap);
#else
            return soap_send_fault(this->soap);
#endif
        }
#ifdef WITH_FASTCGI
        soap_destroy(this->soap);
		soap_end(this->soap);
	} while (1);
#else
    } while (this->soap->keep_alive);
#endif
    return SOAP_OK;
}

static int serve___cwmp__GetParameterNames(struct soap*, cwmpService*);
static int serve___cwmp__GetParameterValues(struct soap*, cwmpService*);
static int serve___cwmp__GetParameterValuesResponse(struct soap*, cwmpService*);
static int serve___cwmp__SetParameterValues(struct soap*, cwmpService*);
static int serve___cwmp__GetParameterAttributes(struct soap*, cwmpService*);
static int serve___cwmp__SetParameterAttributes(struct soap*, cwmpService*);
static int serve___cwmp__Download(struct soap*, cwmpService*);
static int serve___cwmp__Upload(struct soap*, cwmpService*);
static int serve___cwmp__AddObject(struct soap*, cwmpService*);
static int serve___cwmp__DeleteObject(struct soap*, cwmpService*);
static int serve___cwmp__GetRPCMethods(struct soap*, cwmpService*);
static int serve___cwmp__Inform(struct soap*, cwmpService*);

int cwmpService::dispatch()
{	return dispatch(this->soap);
}

int cwmpService::dispatch(struct soap* soap)
{
    cwmpService_init(soap->imode, soap->omode);
    soap_peek_element(soap);
    if (!soap_match_tag(soap, soap->tag, "cwmp:GetParameterNames"))
        return serve___cwmp__GetParameterNames(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:GetParameterValues"))
        return serve___cwmp__GetParameterValues(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:GetParameterValuesResponse"))
        return serve___cwmp__GetParameterValuesResponse(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:SetParameterValues"))
        return serve___cwmp__SetParameterValues(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:GetParameterAttributes"))
        return serve___cwmp__GetParameterAttributes(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:SetParameterAttributes"))
        return serve___cwmp__SetParameterAttributes(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:Download"))
        return serve___cwmp__Download(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:Upload"))
        return serve___cwmp__Upload(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:AddObject"))
        return serve___cwmp__AddObject(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:DeleteObject"))
        return serve___cwmp__DeleteObject(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:GetRPCMethods"))
        return serve___cwmp__GetRPCMethods(soap, this);
    if (!soap_match_tag(soap, soap->tag, "cwmp:Inform"))
        return serve___cwmp__Inform(soap, this);
    return soap->error = SOAP_NO_METHOD;
}


static int serve___cwmp__GetParameterNames(struct soap *soap, cwmpService *service)
{	struct __cwmp__GetParameterNames soap_tmp___cwmp__GetParameterNames;
    struct _cwmp__GetParameterNamesResponse cwmp__GetParameterNamesResponse;
    soap_default__cwmp__GetParameterNamesResponse(soap, &cwmp__GetParameterNamesResponse);
    soap_default___cwmp__GetParameterNames(soap, &soap_tmp___cwmp__GetParameterNames);
    if (!soap_get___cwmp__GetParameterNames(soap, &soap_tmp___cwmp__GetParameterNames, "-cwmp:GetParameterNames", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->GetParameterNames(soap_tmp___cwmp__GetParameterNames.cwmp__GetParameterNames, &cwmp__GetParameterNamesResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__GetParameterNamesResponse(soap, &cwmp__GetParameterNamesResponse);
    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__cwmp__GetParameterNamesResponse(soap, &cwmp__GetParameterNamesResponse, "cwmp:GetParameterNamesResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__GetParameterNamesResponse(soap, &cwmp__GetParameterNamesResponse, "cwmp:GetParameterNamesResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__GetParameterValues(struct soap *soap, cwmpService *service)
{	struct __cwmp__GetParameterValues soap_tmp___cwmp__GetParameterValues;
    struct _cwmp__GetParameterValuesResponse cwmp__GetParameterValuesResponse;
    soap_default__cwmp__GetParameterValuesResponse(soap, &cwmp__GetParameterValuesResponse);
    soap_default___cwmp__GetParameterValues(soap, &soap_tmp___cwmp__GetParameterValues);
    if (!soap_get___cwmp__GetParameterValues(soap, &soap_tmp___cwmp__GetParameterValues, "-cwmp:GetParameterValues", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->GetParameterValues(soap_tmp___cwmp__GetParameterValues.cwmp__GetParameterValues, &cwmp__GetParameterValuesResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__GetParameterValuesResponse(soap, &cwmp__GetParameterValuesResponse);
    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__cwmp__GetParameterValuesResponse(soap, &cwmp__GetParameterValuesResponse, "cwmp:GetParameterValuesResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__GetParameterValuesResponse(soap, &cwmp__GetParameterValuesResponse, "cwmp:GetParameterValuesResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__GetParameterValuesResponse(struct soap *soap, cwmpService *service)
{	struct __cwmp__GetParameterValuesResponse soap_tmp___cwmp__GetParameterValuesResponse;
    soap_default___cwmp__GetParameterValuesResponse(soap, &soap_tmp___cwmp__GetParameterValuesResponse);
    if (!soap_get___cwmp__GetParameterValuesResponse(soap, &soap_tmp___cwmp__GetParameterValuesResponse, "-cwmp:GetParameterValuesResponse", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->GetParameterValuesResponse(soap_tmp___cwmp__GetParameterValuesResponse.cwmp__GetParameterValuesResponse);
    if (soap->error)
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__SetParameterValues(struct soap *soap, cwmpService *service)
{	struct __cwmp__SetParameterValues soap_tmp___cwmp__SetParameterValues;
    struct _cwmp__SetParameterValuesResponse cwmp__SetParameterValuesResponse;
    soap_default__cwmp__SetParameterValuesResponse(soap, &cwmp__SetParameterValuesResponse);
    soap_default___cwmp__SetParameterValues(soap, &soap_tmp___cwmp__SetParameterValues);
    if (!soap_get___cwmp__SetParameterValues(soap, &soap_tmp___cwmp__SetParameterValues, "-cwmp:SetParameterValues", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->SetParameterValues(soap_tmp___cwmp__SetParameterValues.cwmp__SetParameterValues, &cwmp__SetParameterValuesResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__SetParameterValuesResponse(soap, &cwmp__SetParameterValuesResponse);
    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__cwmp__SetParameterValuesResponse(soap, &cwmp__SetParameterValuesResponse, "cwmp:SetParameterValuesResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__SetParameterValuesResponse(soap, &cwmp__SetParameterValuesResponse, "cwmp:SetParameterValuesResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__GetParameterAttributes(struct soap *soap, cwmpService *service)
{	struct __cwmp__GetParameterAttributes soap_tmp___cwmp__GetParameterAttributes;
    struct _cwmp__GetParameterAttributesResponse cwmp__GetParameterAttributesResponse;
    soap_default__cwmp__GetParameterAttributesResponse(soap, &cwmp__GetParameterAttributesResponse);
    soap_default___cwmp__GetParameterAttributes(soap, &soap_tmp___cwmp__GetParameterAttributes);
    if (!soap_get___cwmp__GetParameterAttributes(soap, &soap_tmp___cwmp__GetParameterAttributes, "-cwmp:GetParameterAttributes", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->GetParameterAttributes(soap_tmp___cwmp__GetParameterAttributes.cwmp__GetParameterAttributes, &cwmp__GetParameterAttributesResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__GetParameterAttributesResponse(soap, &cwmp__GetParameterAttributesResponse);
    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__cwmp__GetParameterAttributesResponse(soap, &cwmp__GetParameterAttributesResponse, "cwmp:GetParameterAttributesResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__GetParameterAttributesResponse(soap, &cwmp__GetParameterAttributesResponse, "cwmp:GetParameterAttributesResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__SetParameterAttributes(struct soap *soap, cwmpService *service)
{	struct __cwmp__SetParameterAttributes soap_tmp___cwmp__SetParameterAttributes;
    struct _cwmp__SetParameterAttributesResponse cwmp__SetParameterAttributesResponse;
    soap_default__cwmp__SetParameterAttributesResponse(soap, &cwmp__SetParameterAttributesResponse);
    soap_default___cwmp__SetParameterAttributes(soap, &soap_tmp___cwmp__SetParameterAttributes);
    if (!soap_get___cwmp__SetParameterAttributes(soap, &soap_tmp___cwmp__SetParameterAttributes, "-cwmp:SetParameterAttributes", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->SetParameterAttributes(soap_tmp___cwmp__SetParameterAttributes.cwmp__SetParameterAttributes, &cwmp__SetParameterAttributesResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__SetParameterAttributesResponse(soap, &cwmp__SetParameterAttributesResponse);
    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__cwmp__SetParameterAttributesResponse(soap, &cwmp__SetParameterAttributesResponse, "cwmp:SetParameterAttributesResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__SetParameterAttributesResponse(soap, &cwmp__SetParameterAttributesResponse, "cwmp:SetParameterAttributesResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__Download(struct soap *soap, cwmpService *service)
{	struct __cwmp__Download soap_tmp___cwmp__Download;
    struct _cwmp__DownloadResponse cwmp__DownloadResponse;
    soap_default__cwmp__DownloadResponse(soap, &cwmp__DownloadResponse);
    soap_default___cwmp__Download(soap, &soap_tmp___cwmp__Download);
    if (!soap_get___cwmp__Download(soap, &soap_tmp___cwmp__Download, "-cwmp:Download", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->Download(soap_tmp___cwmp__Download.cwmp__Download, &cwmp__DownloadResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__DownloadResponse(soap, &cwmp__DownloadResponse);
    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__cwmp__DownloadResponse(soap, &cwmp__DownloadResponse, "cwmp:DownloadResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__DownloadResponse(soap, &cwmp__DownloadResponse, "cwmp:DownloadResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__Upload(struct soap *soap, cwmpService *service)
{	struct __cwmp__Upload soap_tmp___cwmp__Upload;
    struct _cwmp__UploadResponse cwmp__UploadResponse;
    soap_default__cwmp__UploadResponse(soap, &cwmp__UploadResponse);
    soap_default___cwmp__Upload(soap, &soap_tmp___cwmp__Upload);
    if (!soap_get___cwmp__Upload(soap, &soap_tmp___cwmp__Upload, "-cwmp:Upload", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->Upload(soap_tmp___cwmp__Upload.cwmp__Upload, &cwmp__UploadResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__UploadResponse(soap, &cwmp__UploadResponse);
    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__cwmp__UploadResponse(soap, &cwmp__UploadResponse, "cwmp:UploadResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__UploadResponse(soap, &cwmp__UploadResponse, "cwmp:UploadResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__AddObject(struct soap *soap, cwmpService *service)
{	struct __cwmp__AddObject soap_tmp___cwmp__AddObject;
    struct _cwmp__AddObjectResponse cwmp__AddObjectResponse;
    soap_default__cwmp__AddObjectResponse(soap, &cwmp__AddObjectResponse);
    soap_default___cwmp__AddObject(soap, &soap_tmp___cwmp__AddObject);
    if (!soap_get___cwmp__AddObject(soap, &soap_tmp___cwmp__AddObject, "-cwmp:AddObject", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->AddObject(soap_tmp___cwmp__AddObject.cwmp__AddObject, &cwmp__AddObjectResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__AddObjectResponse(soap, &cwmp__AddObjectResponse);
    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__cwmp__AddObjectResponse(soap, &cwmp__AddObjectResponse, "cwmp:AddObjectResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__AddObjectResponse(soap, &cwmp__AddObjectResponse, "cwmp:AddObjectResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__DeleteObject(struct soap *soap, cwmpService *service)
{	struct __cwmp__DeleteObject soap_tmp___cwmp__DeleteObject;
    struct _cwmp__DeleteObjectResponse cwmp__DeleteObjectResponse;
    soap_default__cwmp__DeleteObjectResponse(soap, &cwmp__DeleteObjectResponse);
    soap_default___cwmp__DeleteObject(soap, &soap_tmp___cwmp__DeleteObject);
    if (!soap_get___cwmp__DeleteObject(soap, &soap_tmp___cwmp__DeleteObject, "-cwmp:DeleteObject", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->DeleteObject(soap_tmp___cwmp__DeleteObject.cwmp__DeleteObject, &cwmp__DeleteObjectResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__DeleteObjectResponse(soap, &cwmp__DeleteObjectResponse);
    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__cwmp__DeleteObjectResponse(soap, &cwmp__DeleteObjectResponse, "cwmp:DeleteObjectResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__DeleteObjectResponse(soap, &cwmp__DeleteObjectResponse, "cwmp:DeleteObjectResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__GetRPCMethods(struct soap *soap, cwmpService *service)
{	struct __cwmp__GetRPCMethods soap_tmp___cwmp__GetRPCMethods;
    struct _cwmp__GetRPCMethodsResponse cwmp__GetRPCMethodsResponse;
    soap_default__cwmp__GetRPCMethodsResponse(soap, &cwmp__GetRPCMethodsResponse);
    soap_default___cwmp__GetRPCMethods(soap, &soap_tmp___cwmp__GetRPCMethods);
    if (!soap_get___cwmp__GetRPCMethods(soap, &soap_tmp___cwmp__GetRPCMethods, "-cwmp:GetRPCMethods", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->GetRPCMethods(soap_tmp___cwmp__GetRPCMethods.cwmp__GetRPCMethods, &cwmp__GetRPCMethodsResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__GetRPCMethodsResponse(soap, &cwmp__GetRPCMethodsResponse);
    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__cwmp__GetRPCMethodsResponse(soap, &cwmp__GetRPCMethodsResponse, "cwmp:GetRPCMethodsResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__GetRPCMethodsResponse(soap, &cwmp__GetRPCMethodsResponse, "cwmp:GetRPCMethodsResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}

static int serve___cwmp__Inform(struct soap *soap, cwmpService *service)
{	struct __cwmp__Inform soap_tmp___cwmp__Inform;
    struct _cwmp__InformResponse cwmp__InformResponse;
    soap_default__cwmp__InformResponse(soap, &cwmp__InformResponse);
    soap_default___cwmp__Inform(soap, &soap_tmp___cwmp__Inform);
    if (!soap_get___cwmp__Inform(soap, &soap_tmp___cwmp__Inform, "-cwmp:Inform", NULL))
        return soap->error;
    if (soap_body_end_in(soap)
        || soap_envelope_end_in(soap)
        || soap_end_recv(soap))
        return soap->error;
    soap->error = service->Inform(soap_tmp___cwmp__Inform.cwmp__Inform, &cwmp__InformResponse);
    if (soap->error)
        return soap->error;
    soap->encodingStyle = ""; /* use SOAP encoding style */
    soap_serializeheader(soap);
    soap_serialize__cwmp__InformResponse(soap, &cwmp__InformResponse);
    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__cwmp__InformResponse(soap, &cwmp__InformResponse, "cwmp:InformResponse", "")
             || soap_body_end_out(soap)
             || soap_envelope_end_out(soap))
            return soap->error;
    };
    if (soap_end_count(soap)
        || soap_response(soap, SOAP_OK)
        || soap_envelope_begin_out(soap)
        || soap_putheader(soap)
        || soap_body_begin_out(soap)
        || soap_put__cwmp__InformResponse(soap, &cwmp__InformResponse, "cwmp:InformResponse", "")
        || soap_body_end_out(soap)
        || soap_envelope_end_out(soap)
        || soap_end_send(soap))
        return soap->error;
    return soap_closesock(soap);
}
/* End of server object code */
