You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2003/09/16 10:43:47 UTC

cvs commit: xml-axis/c/src/client Call.cpp

sanjaya     2003/09/16 01:43:47

  Modified:    c/src/client Call.cpp
  Log:
  -modified to support simple types.
  -Added a set of AddParameter methods.
  -Added methods SetProtocol, and SetHeader.
  
  Revision  Changes    Path
  1.2       +87 -6     xml-axis/c/src/client/Call.cpp
  
  Index: Call.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/client/Call.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Call.cpp	11 Sep 2003 10:42:47 -0000	1.1
  +++ Call.cpp	16 Sep 2003 08:43:47 -0000	1.2
  @@ -10,9 +10,14 @@
   // Construction/Destruction
   //////////////////////////////////////////////////////////////////////
   
  +extern "C" int initialize_module();
  +
   Call::Call()
   {
   	m_pAxisEngine = NULL;
  +	m_Soap.so.http.ip_headercount = 0;
  +	m_Soap.so.http.ip_headers = NULL;
  +	m_Param = new Param();
   }
   
   Call::~Call()
  @@ -32,12 +37,73 @@
   	pMethod->setPrefix(m_pIWSSZ->getNewNamespacePrefix());
   	pMethod->setUri(pchNamespace);
   }
  -
  +/*
   void Call::AddParameter(XSDTYPE nType, uParamValue Value, const char* pchName)
   {
   	IParam* pRetParam = m_pIWSSZ->AddOutputParam(nType, Value);
   	pRetParam->SetName(pchName);
   }
  +*/
  +void Call::AddParameter(int nValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(nValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(unsigned int unValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(unValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(short sValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(sValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(unsigned short usValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(usValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(long lValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(lValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(unsigned long ulValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(ulValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(char cValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(cValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(unsigned char ucValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(ucValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(float fValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(fValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(double dValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(dValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(struct tm tValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(tValue);
  +	pRetParam->SetName(pchName);
  +}
  +void Call::AddParameter(const AxisChar* pStrValue,const char* pchName)
  +{
  +	IParam* pRetParam = m_pIWSSZ->AddOutputParam(pStrValue);
  +	pRetParam->SetName(pchName);
  +}
   
   void Call::AddParameter(IArrayBean *pArrayBean, const char* pchName)
   {
  @@ -54,6 +120,7 @@
   void Call::SetReturnType(XSDTYPE nType)
   {
   	m_nReturnType = nType;
  +	m_Param->SetValue(m_nReturnType, m_uReturnValue);
   }
   
   void Call::SetReturnType(void *pObject, void *pDZFunct, void *pDelFunct)
  @@ -71,7 +138,7 @@
   	{
   		if (m_nReturnType == USER_TYPE)
   		{
  -			m_ReturnCplxObj.pDZFunct(m_ReturnCplxObj.pObject, m_pMsgData);
  +			m_ReturnCplxObj.pDZFunct(m_ReturnCplxObj.pObject, m_pMsgData->m_pDZ);
   		}
   		else if (m_nReturnType == XSD_ARRAY)
   		{
  @@ -79,20 +146,22 @@
   		}
   		else //basic type
   		{
  -			m_Param.
  -			m_pIWSDZ->DeSerialize(m_nReturnType, &m_uReturnValue);
  +			m_Param = (Param*)m_pIWSDZ->GetParam();
   		}
   	}
   	return nStatus;
   }
   
  -const uParamValue& Call::GetResult()
  +Param* Call::GetResult()
   {
  -	return m_uReturnValue;
  +	return m_Param;
   }
   
   int Call::Initialize()
   {
  +	initialize_module();
  +	m_Soap.sessionid = "somesessionid1234";
  +	this->SetProtocol(APTHTTP);
   	if (m_pAxisEngine) delete m_pAxisEngine;
   	m_pAxisEngine = new ClientAxisEngine();
   	if (!m_pAxisEngine) return FAIL;
  @@ -122,4 +191,16 @@
   		m_pAxisEngine = NULL;
   	}
   	return SUCCESS;
  +}
  +
  +int Call::SetProtocol(AXIS_PROTOCOL_TYPE protocol)
  +{
  +	m_Soap.trtype = protocol;
  +	return 0;
  +}
  +
  +int Call::SetHeader(char *key, char *value)
  +{
  +	set_header(&m_Soap, key, value);
  +	return 0;
   }