///////////////////////////////////////////////////////////////////////
// This is the Client Stub implementation file genarated by WSDL2Ws tool.
// PricerProxy.cpp: implemtation for the PricerProxy.
//
//////////////////////////////////////////////////////////////////////

#include "PricerProxy.h"

#include <axis/common/AxisWrapperAPI.h>

PricerProxy::PricerProxy()
{
	m_pCall = new Call();
	m_pCall->SetProtocol(APTHTTP);
	m_pCall->SetHeader("SOAPAction", "PricerService");
	m_pCall->SetEndpointURI("http://192.168.28.100:8000/livecluster/services/PricerTest");
}

PricerProxy::~PricerProxy()
{
	delete m_pCall;
}


//Methods corresponding to the web service methods

/////////////////////////////////////////////////////////////////
// This method wrap the service methodvalue_async
//////////////////////////////////////////////////////////////////
string PricerProxy::value_async(ArrayOf_xsd_double Value0)
{
	int nStatus;
	string Ret;
	if (SUCCESS != m_pCall->Initialize()) return Ret;
	m_pCall->SetSOAPVersion(SOAP_VER_1_1);
	m_pCall->SetOperation("value_async", "http://192.168.28.100:8000/livecluster/services/PricerTest");
	m_pCall->AddParameter((Axis_Array*)(&Value0), XSD_DOUBLE, "input");
	m_pCall->SetReturnType(XSD_STRING);
	nStatus = m_pCall->Invoke();
	if (SUCCESS == nStatus)
	{
		Ret = m_pCall->GetResult()->GetString();
	}
	m_pCall->UnInitialize();
	return Ret;
}


/////////////////////////////////////////////////////////////////
// This method wrap the service methodvalue
//////////////////////////////////////////////////////////////////
double PricerProxy::value(ArrayOf_xsd_double Value0)
{
	int nStatus;
	double Ret;
	if (SUCCESS != m_pCall->Initialize()) return Ret;
	m_pCall->SetSOAPVersion(SOAP_VER_1_1);
	m_pCall->SetOperation("value", "http://192.168.28.100:8000/livecluster/services/PricerTest");
	m_pCall->AddParameter((Axis_Array*)(&Value0), XSD_DOUBLE, "input");
	m_pCall->SetReturnType(XSD_DOUBLE);
	nStatus = m_pCall->Invoke();
	if (SUCCESS == nStatus)
	{
		Ret = m_pCall->GetResult()->GetDouble();
	}
	m_pCall->UnInitialize();
	return Ret;
}


/////////////////////////////////////////////////////////////////
// This method wrap the service methodnpv_async
//////////////////////////////////////////////////////////////////
string PricerProxy::npv_async(ArrayOf_xsd_double Value0)
{
	int nStatus;
	string Ret;
	if (SUCCESS != m_pCall->Initialize()) return Ret;
	m_pCall->SetSOAPVersion(SOAP_VER_1_1);
	m_pCall->SetOperation("npv_async", "http://192.168.28.100:8000/livecluster/services/PricerTest");
	m_pCall->AddParameter((Axis_Array*)(&Value0), XSD_DOUBLE, "input");
	m_pCall->SetReturnType(XSD_STRING);
	nStatus = m_pCall->Invoke();
	if (SUCCESS == nStatus)
	{
		Ret = m_pCall->GetResult()->GetString();
	}
	m_pCall->UnInitialize();
	return Ret;
}


/////////////////////////////////////////////////////////////////
// This method wrap the service methodnpv
//////////////////////////////////////////////////////////////////
ArrayOf_xsd_double PricerProxy::npv(ArrayOf_xsd_double Value0)
{
	int nStatus;
	ArrayOf_xsd_double RetArray = {NULL, 0};
	if (SUCCESS != m_pCall->Initialize()) return RetArray;
	m_pCall->SetSOAPVersion(SOAP_VER_1_1);
	m_pCall->SetOperation("npv", "http://192.168.28.100:8000/livecluster/services/PricerTest");
	m_pCall->AddParameter((Axis_Array*)(&Value0), XSD_DOUBLE, "input");
	m_pCall->SetReturnType((Axis_Array*)(&RetArray), XSD_DOUBLE);
	nStatus = m_pCall->Invoke();
	if (SUCCESS != nStatus)
	{
		delete RetArray.m_Array;
		RetArray.m_Array = NULL;
		RetArray.m_Size = 0;
	}
	m_pCall->UnInitialize();
	return RetArray;
}


/////////////////////////////////////////////////////////////////
// This method wrap the service methodcollectAsync
//////////////////////////////////////////////////////////////////
anyType* PricerProxy::collectAsync(string Value0)
{
	int nStatus;
	anyType* pReturn = NULL;
	if (SUCCESS != m_pCall->Initialize()) return pReturn;
	m_pCall->SetSOAPVersion(SOAP_VER_1_1);
	m_pCall->SetOperation("collectAsync", "http://192.168.28.100:8000/livecluster/services/PricerTest");
	m_pCall->AddParameter(Value0, "id", XSD_STRING);
	m_pCall->SetReturnType((void*) Axis_DeSerialize_anyType, (void*) Axis_Create_anyType, (void*) Axis_Delete_anyType, Axis_TypeName_anyType, Axis_URI_anyType);
	nStatus = m_pCall->Invoke();
	if (SUCCESS == nStatus)
	{
		m_pCall->GetResult((void**)&pReturn);
	}
	m_pCall->UnInitialize();
	return pReturn;
}


/////////////////////////////////////////////////////////////////
// This method wrap the service methodcreate
//////////////////////////////////////////////////////////////////
string PricerProxy::create()
{
	int nStatus;
	string Ret;
	if (SUCCESS != m_pCall->Initialize()) return Ret;
	m_pCall->SetSOAPVersion(SOAP_VER_1_1);
	m_pCall->SetOperation("create", "http://192.168.28.100:8000/livecluster/services/PricerTest");
	m_pCall->SetReturnType(XSD_STRING);
	nStatus = m_pCall->Invoke();
	if (SUCCESS == nStatus)
	{
		Ret = m_pCall->GetResult()->GetString();
	}
	m_pCall->UnInitialize();
	return Ret;
}


/////////////////////////////////////////////////////////////////
// This method wrap the service methoddestroy
//////////////////////////////////////////////////////////////////
void PricerProxy::destroy()
{
	int nStatus;
	if (SUCCESS != m_pCall->Initialize()) return ;
	m_pCall->SetSOAPVersion(SOAP_VER_1_1);
	m_pCall->SetOperation("destroy", "http://192.168.28.100:8000/livecluster/services/PricerTest");
	nStatus = m_pCall->Invoke();
	if (SUCCESS != nStatus)
	{
		//What to do ? . Throw an exception ??? 
	}
	m_pCall->UnInitialize();
}

