/* qServer.c
   Generated by gSOAP 2.8.10 from quote.h

Copyright(C) 2000-2012, Robert van Engelen, Genivia Inc. All Rights Reserved.
The generated code is released under one of the following licenses:
1) GPL or 2) 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.
*/

#if defined(__BORLANDC__)
#pragma option push -w-8060
#pragma option push -w-8004
#endif
#include "qH.h"
#ifdef __cplusplus
extern "C" {
#endif

SOAP_SOURCE_STAMP("@(#) qServer.c ver 2.8.10 2012-08-18 18:56:32 GMT")


SOAP_FMAC5 int SOAP_FMAC6 q_serve(struct soap *soap)
{
#ifndef WITH_FASTCGI
	unsigned int k = soap->max_keep_alive;
#endif
	do
	{
#ifndef WITH_FASTCGI
		if (soap->max_keep_alive > 0 && !--k)
			soap->keep_alive = 0;
#endif
		if (soap_begin_serve(soap))
		{	if (soap->error >= SOAP_STOP)
				continue;
			return soap->error;
		}
		if (q_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 q_serve_request(struct soap *soap)
{
	soap_peek_element(soap);
	if (!soap_match_tag(soap, soap->tag, "ns:getQuote"))
		return soap_serve_ns__getQuote(soap);
	return soap->error = SOAP_NO_METHOD;
}
#endif

SOAP_FMAC5 int SOAP_FMAC6 soap_serve_ns__getQuote(struct soap *soap)
{	struct ns__getQuote soap_tmp_ns__getQuote;
	struct ns__getQuoteResponse soap_tmp_ns__getQuoteResponse;
	float soap_tmp_float;
	soap_default_ns__getQuoteResponse(soap, &soap_tmp_ns__getQuoteResponse);
	soap_default_float(soap, &soap_tmp_float);
	soap_tmp_ns__getQuoteResponse.Result = &soap_tmp_float;
	soap_default_ns__getQuote(soap, &soap_tmp_ns__getQuote);
	soap->encodingStyle = "";
	if (!soap_get_ns__getQuote(soap, &soap_tmp_ns__getQuote, "ns:getQuote", NULL))
		return soap->error;
	if (soap_body_end_in(soap)
	 || soap_envelope_end_in(soap)
	 || soap_end_recv(soap))
		return soap->error;
	soap->error = ns__getQuote(soap, soap_tmp_ns__getQuote.symbol, soap_tmp_ns__getQuoteResponse.Result);
	if (soap->error)
		return soap->error;
	soap_serializeheader(soap);
	soap_serialize_ns__getQuoteResponse(soap, &soap_tmp_ns__getQuoteResponse);
	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_ns__getQuoteResponse(soap, &soap_tmp_ns__getQuoteResponse, "ns:getQuoteResponse", NULL)
		 || 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_ns__getQuoteResponse(soap, &soap_tmp_ns__getQuoteResponse, "ns:getQuoteResponse", NULL)
	 || soap_body_end_out(soap)
	 || soap_envelope_end_out(soap)
	 || soap_end_send(soap))
		return soap->error;
	return soap_closesock(soap);
}

#ifdef __cplusplus
}
#endif

#if defined(__BORLANDC__)
#pragma option pop
#pragma option pop
#endif

/* End of qServer.c */
