⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 calculatorserver.cpp

📁 testing sample application
💻 CPP
字号:
/* CalculatorServer.cpp
   Generated by gSOAP 2.7.9l from Calculator.h
   Copyright(C) 2000-2007, 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.
*/
#include "CalculatorH.h"

SOAP_SOURCE_STAMP("@(#) CalculatorServer.cpp ver 2.7.9l 2007-12-19 11:26:56 GMT")


SOAP_FMAC5 int SOAP_FMAC6 Calculator_serve(struct soap *soap)
{
#ifndef WITH_FASTCGI
	unsigned int k = soap->max_keep_alive;
#endif

	do
	{
#ifdef WITH_FASTCGI
		if (FCGI_Accept() < 0)
		{
			soap->error = SOAP_EOF;
			return soap_send_fault(soap);
		}
#endif

		soap_begin(soap);

#ifndef WITH_FASTCGI
		if (soap->max_keep_alive > 0 && !--k)
			soap->keep_alive = 0;
#endif

		if (soap_begin_recv(soap))
		{	if (soap->error < SOAP_STOP)
			{
#ifdef WITH_FASTCGI
				soap_send_fault(soap);
#else 
				return soap_send_fault(soap);
#endif
			}
			soap_closesock(soap);

			continue;
		}

		if (soap_envelope_begin_in(soap)
		 || soap_recv_header(soap)
		 || soap_body_begin_in(soap)
		 || Calculator_serve_request(soap)
		 || (soap->fserveloop && soap->fserveloop(soap)))
		{
#ifdef WITH_FASTCGI
			soap_send_fault(soap);
#else
			return soap_send_fault(soap);
#endif
		}

#ifdef WITH_FASTCGI
		soap_destroy(soap);
		soap_end(soap);
	} while (1);
#else
	} while (soap->keep_alive);
#endif
	return SOAP_OK;
}

#ifndef WITH_NOSERVEREQUEST
SOAP_FMAC5 int SOAP_FMAC6 Calculator_serve_request(struct soap *soap)
{
	soap_peek_element(soap);
	if (!soap_match_tag(soap, soap->tag, "Calculator:Add"))
		return soap_serve_Calculator__Add(soap);
	if (!soap_match_tag(soap, soap->tag, "Calculator:Sub"))
		return soap_serve_Calculator__Sub(soap);
	if (!soap_match_tag(soap, soap->tag, "Calculator:Mul"))
		return soap_serve_Calculator__Mul(soap);
	if (!soap_match_tag(soap, soap->tag, "Calculator:Div"))
		return soap_serve_Calculator__Div(soap);
	return soap->error = SOAP_NO_METHOD;
}
#endif

SOAP_FMAC5 int SOAP_FMAC6 soap_serve_Calculator__Add(struct soap *soap)
{	struct Calculator__Add soap_tmp_Calculator__Add;
	struct Calculator__AddResponse soap_tmp_Calculator__AddResponse;
	soap_default_Calculator__AddResponse(soap, &soap_tmp_Calculator__AddResponse);
	soap_default_Calculator__Add(soap, &soap_tmp_Calculator__Add);
	soap->encodingStyle = NULL;
	if (!soap_get_Calculator__Add(soap, &soap_tmp_Calculator__Add, "Calculator:Add", NULL))
		return soap->error;
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap->error;
	soap->error = Calculator__Add(soap, soap_tmp_Calculator__Add.a, soap_tmp_Calculator__Add.b, soap_tmp_Calculator__AddResponse.Result);
	if (soap->error)
		return soap->error;
	soap_serializeheader(soap);
	soap_serialize_Calculator__AddResponse(soap, &soap_tmp_Calculator__AddResponse);
	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_Calculator__AddResponse(soap, &soap_tmp_Calculator__AddResponse, "Calculator:AddResponse", "")
		 || 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_Calculator__AddResponse(soap, &soap_tmp_Calculator__AddResponse, "Calculator:AddResponse", "")
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap->error;
	return soap_closesock(soap);
}

SOAP_FMAC5 int SOAP_FMAC6 soap_serve_Calculator__Sub(struct soap *soap)
{	struct Calculator__Sub soap_tmp_Calculator__Sub;
	struct Calculator__SubResponse soap_tmp_Calculator__SubResponse;
	soap_default_Calculator__SubResponse(soap, &soap_tmp_Calculator__SubResponse);
	soap_default_Calculator__Sub(soap, &soap_tmp_Calculator__Sub);
	soap->encodingStyle = NULL;
	if (!soap_get_Calculator__Sub(soap, &soap_tmp_Calculator__Sub, "Calculator:Sub", NULL))
		return soap->error;
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap->error;
	soap->error = Calculator__Sub(soap, soap_tmp_Calculator__Sub.a, soap_tmp_Calculator__Sub.b, soap_tmp_Calculator__SubResponse.Result);
	if (soap->error)
		return soap->error;
	soap_serializeheader(soap);
	soap_serialize_Calculator__SubResponse(soap, &soap_tmp_Calculator__SubResponse);
	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_Calculator__SubResponse(soap, &soap_tmp_Calculator__SubResponse, "Calculator:SubResponse", "")
		 || 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_Calculator__SubResponse(soap, &soap_tmp_Calculator__SubResponse, "Calculator:SubResponse", "")
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap->error;
	return soap_closesock(soap);
}

SOAP_FMAC5 int SOAP_FMAC6 soap_serve_Calculator__Mul(struct soap *soap)
{	struct Calculator__Mul soap_tmp_Calculator__Mul;
	struct Calculator__MulResponse soap_tmp_Calculator__MulResponse;
	soap_default_Calculator__MulResponse(soap, &soap_tmp_Calculator__MulResponse);
	soap_default_Calculator__Mul(soap, &soap_tmp_Calculator__Mul);
	soap->encodingStyle = NULL;
	if (!soap_get_Calculator__Mul(soap, &soap_tmp_Calculator__Mul, "Calculator:Mul", NULL))
		return soap->error;
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap->error;
	soap->error = Calculator__Mul(soap, soap_tmp_Calculator__Mul.a, soap_tmp_Calculator__Mul.b, soap_tmp_Calculator__MulResponse.Result);
	if (soap->error)
		return soap->error;
	soap_serializeheader(soap);
	soap_serialize_Calculator__MulResponse(soap, &soap_tmp_Calculator__MulResponse);
	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_Calculator__MulResponse(soap, &soap_tmp_Calculator__MulResponse, "Calculator:MulResponse", "")
		 || 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_Calculator__MulResponse(soap, &soap_tmp_Calculator__MulResponse, "Calculator:MulResponse", "")
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap->error;
	return soap_closesock(soap);
}

SOAP_FMAC5 int SOAP_FMAC6 soap_serve_Calculator__Div(struct soap *soap)
{	struct Calculator__Div soap_tmp_Calculator__Div;
	struct Calculator__DivResponse soap_tmp_Calculator__DivResponse;
	soap_default_Calculator__DivResponse(soap, &soap_tmp_Calculator__DivResponse);
	soap_default_Calculator__Div(soap, &soap_tmp_Calculator__Div);
	soap->encodingStyle = NULL;
	if (!soap_get_Calculator__Div(soap, &soap_tmp_Calculator__Div, "Calculator:Div", NULL))
		return soap->error;
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap->error;
	soap->error = Calculator__Div(soap, soap_tmp_Calculator__Div.a, soap_tmp_Calculator__Div.b, soap_tmp_Calculator__DivResponse.Result);
	if (soap->error)
		return soap->error;
	soap_serializeheader(soap);
	soap_serialize_Calculator__DivResponse(soap, &soap_tmp_Calculator__DivResponse);
	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_Calculator__DivResponse(soap, &soap_tmp_Calculator__DivResponse, "Calculator:DivResponse", "")
		 || 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_Calculator__DivResponse(soap, &soap_tmp_Calculator__DivResponse, "Calculator:DivResponse", "")
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap->error;
	return soap_closesock(soap);
}

/* End of CalculatorServer.cpp */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -