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 su...@apache.org on 2003/08/05 07:29:40 UTC

cvs commit: xml-axis/c/src/wcg WSClass.cpp TranslationUnit.cpp Method.cpp BeanClass.cpp

susantha    2003/08/04 22:29:40

  Modified:    c/src/wcg WSClass.cpp TranslationUnit.cpp Method.cpp
                        BeanClass.cpp
  Log:
  Altered generated wrapper class according to the changes Serializer/Deserializer API
  
  Revision  Changes    Path
  1.6       +10 -3     xml-axis/c/src/wcg/WSClass.cpp
  
  Index: WSClass.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/wcg/WSClass.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WSClass.cpp	4 Aug 2003 05:03:49 -0000	1.5
  +++ WSClass.cpp	5 Aug 2003 05:29:39 -0000	1.6
  @@ -180,7 +180,10 @@
   		file << "// Implementation of WrapperClassHandler interfaces." << endl;
   		file << "int " << m_Name << "::Invoke(IMessageData* mc)" << endl; 		
   		file << "{" << endl;
  -		file << "\tstring method = mc->getSoapDeserializer()->GetMethodName();" << endl;
  +		file << "\tIWrapperSoapDeSerializer* pIWSDZ = NULL;" << endl;
  +		file << "\tmc->getSoapDeSerializer(&pIWSDZ);" << endl;
  +		file << "\tif (!pIWSDZ) return FAIL;" << endl;
  +		file << "\tstring method = pIWSDZ->GetMethodName();" << endl;
   		bool tab = true;
   		list<Method*>::iterator it;
   		for (it = m_Methods.begin(); it != m_Methods.end(); it++)
  @@ -214,9 +217,12 @@
   		file << "int " << m_Name << "::SetResponseMethod(IMessageData* mc, const char* name)" << endl; 			
   		file << "{" << endl;
   		file << "\tstring method = name;" << endl;
  -		file << "\tISoapMethod* pMethod = mc->getSoapSerializer()->createSoapMethod();" << endl;
  +		file << "\tIWrapperSoapSerializer* pIWSSZ = NULL;" << endl;
  +		file << "\tmc->getSoapSerializer(&pIWSSZ);" << endl;
  +		file << "\tif (!pIWSSZ) return FAIL;" << endl;
  +		file << "\tISoapMethod* pMethod = pIWSSZ->createSoapMethod();" << endl;
   		file << "\tpMethod->setLocalName(method + \"Response\");" << endl;
  -		file << "\tpMethod->setPrefix(" << "mc->getSoapSerializer()->getNewNamespacePrefix()" << ");"<< endl; //amp - axis method prefix :)
  +		file << "\tpMethod->setPrefix(" << "pIWSSZ->getNewNamespacePrefix()" << ");"<< endl; //amp - axis method prefix :)
   		file << "\tpMethod->setUri(\"" << g_ClassNamespaces[m_AWSName] << "\");"<< endl; //http://www.opensource.lk will come from wsdd
   		file << "\treturn SUCCESS;" << endl; 
   		file << "}" << endl;
  @@ -262,4 +268,5 @@
   	{
   		if ((*it)->GenerateOperationInBinding(file, sServiceName, nBinding, nStyle, sURI)) return 1; //error occured;
   	}
  +	return 0; //success
   }
  
  
  
  1.5       +2 -2      xml-axis/c/src/wcg/TranslationUnit.cpp
  
  Index: TranslationUnit.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/wcg/TranslationUnit.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TranslationUnit.cpp	4 Aug 2003 05:03:49 -0000	1.4
  +++ TranslationUnit.cpp	5 Aug 2003 05:29:39 -0000	1.5
  @@ -183,8 +183,8 @@
   		file << "#include \"" << m_pWSClass->GetName() << ".hpp\"" << endl;
   		file << endl;
   		//add includes
  -		file << "#include \"common/ISoapDeserializer.h\"" << endl;
  -		file << "#include \"common/ISoapSerializer.h\"" << endl;
  +		file << "#include \"common/IWrapperSoapDeSerializer.h\"" << endl;
  +		file << "#include \"common/IWrapperSoapSerializer.h\"" << endl;
   		file << "#include \"common/ISoapMethod.h\"" << endl;
   		file << "#include \"common/IParam.h\"" << endl;
   
  
  
  
  1.7       +9 -3      xml-axis/c/src/wcg/Method.cpp
  
  Index: Method.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/wcg/Method.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Method.cpp	4 Aug 2003 05:03:49 -0000	1.6
  +++ Method.cpp	5 Aug 2003 05:29:39 -0000	1.7
  @@ -139,17 +139,23 @@
   {
   	file << "int " << sClassName << "::" << m_Name << "(IMessageData* mc)" << endl; 	
   	file << "{" << endl;
  +	file << "\tIWrapperSoapSerializer* pIWSSZ = NULL;" << endl;
  +	file << "\tmc->getSoapSerializer(&pIWSSZ);" << endl;
  +	file << "\tif (!pIWSSZ) return FAIL;" << endl;
  +	file << "\tIWrapperSoapDeSerializer* pIWSDZ = NULL;" << endl;
  +	file << "\tmc->getSoapDeSerializer(&pIWSDZ);" << endl;
  +	file << "\tif (!pIWSDZ) return FAIL;" << endl;
   	file << "\tSetResponseMethod(mc, \"" << m_Name << "\");" << endl;
   	int nParam = 0;
   	for (list<Variable*>::iterator it = m_Params.begin(); it != m_Params.end(); it++)
   	{
   		file << endl;
  -		file << "\tIParam *param" << nParam << " = mc->getSoapDeserializer()->GetParam();" << endl;
  +		file << "\tIParam *param" << nParam << " = pIWSDZ->GetParam();" << endl;
   		if ((*it)->IsComplexType())
   		{
   			file << "\t" << (*it)->GetTypeName() << "* v" << nParam << " = new " << (*it)->GetTypeName() << "();" << endl;
   			file << "\tparam" << nParam << "->" << "SetUserType(" << "v" << nParam << ");" << endl; 
  -			file <<	"\tmc->getSoapDeserializer()->Deserialize(param" << nParam << ",0);" << endl; // 0 should be changed to 1 if multiref to be used			
  +			file <<	"\tpIWSDZ->Deserialize(param" << nParam << ",0);" << endl; // 0 should be changed to 1 if multiref to be used			
   		}
   		else if ((*it)->IsArrayType())
   		{
  @@ -183,7 +189,7 @@
   		file << ".c_str()";
   	}
   	file <<	";" << endl;
  -	file << "\tIParam* pRetParam = mc->getSoapSerializer()->setResponseParam(" << m_pReturnType->GetTypeEnumStr() << ", value);" << endl;
  +	file << "\tIParam* pRetParam = pIWSSZ->setResponseParam(" << m_pReturnType->GetTypeEnumStr() << ", value);" << endl;
   	file << "\tpRetParam->SetName(\"" << m_Name << "Return\");" << endl;
   	file << "\treturn SUCCESS;" << endl; 
   	file << "}" << endl;
  
  
  
  1.7       +3 -2      xml-axis/c/src/wcg/BeanClass.cpp
  
  Index: BeanClass.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/wcg/BeanClass.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BeanClass.cpp	4 Aug 2003 05:06:15 -0000	1.6
  +++ BeanClass.cpp	5 Aug 2003 05:29:39 -0000	1.7
  @@ -99,8 +99,9 @@
   {
   	list<Variable*>::iterator it;
   
  -	file << "int " << m_Name << "::DeSerialize(ISoapDeSerializer *pDZ)" << endl;
  +	file << "int " << m_Name << "::DeSerialize(IWrapperSoapDeSerializer *pDZ)" << endl;
   	file << "{" << endl;
  +	file << "\tIParam* pHeadParam = pDZ->GetParam(); //do any type validation here if necessary" << endl;
   	for (it = m_Variables.begin(); it != m_Variables.end(); it++)
   	{
   		(*it)->GenerateDeserializerImpl(file);
  @@ -109,7 +110,7 @@
   	file << "}" << endl;
   	file << endl;
   
  -	file << "int " << m_Name << "::Serialize(ISoapSerializer& pSZ)" << endl;
  +	file << "int " << m_Name << "::Serialize(IWrapperSoapSerializer& pSZ)" << endl;
   	file << "{" << endl;
   	file << "\tm_URI = \"" << g_ClassNamespaces[m_Name] << "\";" << endl;
   	file << "\tstring sPrefix = pSZ.getNewNamespacePrefix();" << endl;