axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ros...@apache.org
Subject cvs commit: ws-axis/c/vc/samples/client/RPCFaultClient RPCFaultClient.dsp
Date Thu, 02 Dec 2004 07:54:01 GMT
roshan      2004/12/01 23:54:01

  Modified:    c/samples/client/rpcfault DivByZeroStruct.cpp MathOps.cpp
                        MathOpsClient.cpp
               c/vc/samples/client/RPCFaultClient RPCFaultClient.dsp
  Added:       c/samples/client/rpcfault DivByZeroStruct.hpp MathOps.hpp
                        MathOps_AxisClientException.cpp
                        MathOps_AxisClientException.hpp
  Log:
  fixed the problem of rpcFaultClient sample not being compiling
  
  Revision  Changes    Path
  1.4       +7 -6      ws-axis/c/samples/client/rpcfault/DivByZeroStruct.cpp
  
  Index: DivByZeroStruct.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/samples/client/rpcfault/DivByZeroStruct.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DivByZeroStruct.cpp	24 Nov 2004 13:25:17 -0000	1.3
  +++ DivByZeroStruct.cpp	2 Dec 2004 07:54:01 -0000	1.4
  @@ -1,11 +1,9 @@
   /*
  - *This file is automatically generated by the Axis C++ Wrapper Class Generator
  - *Web service wrapper class's implementation generated by Axis WCG
  - *Parameters and wrapper methos to manipulate DivByZeroStruct
  + * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
  + * This file contains functions to manipulate complex type DivByZeroStruct
    */
   
  -#include <malloc.h>
  -#include "DivByZeroStruct.h"
  +#include "DivByZeroStruct.hpp"
   #include <axis/AxisWrapperAPI.hpp>
   
   /*
  @@ -36,7 +34,7 @@
   /*
    * This static method deserialize a DivByZeroStruct type of object
    */
  -int Axis_DeSerialize_DivByZeroStruct(DivByZeroStruct* param, IWrapperSoapDeSerializer *pIWSDZ)
  +int Axis_DeSerialize_DivByZeroStruct(DivByZeroStruct* param, IWrapperSoapDeSerializer*
pIWSDZ)
   {
   	param->varString = pIWSDZ->getElementAsString("varString",0);
   	param->varInt = pIWSDZ->getElementAsInt("varInt",0);
  @@ -90,6 +88,9 @@
   {
   	/*do not allocate memory to any pointer members here
   	 because deserializer will allocate memory anyway. */
  +	memset( &varString, 0, sizeof( xsd__string));
  +	memset( &varInt, 0, sizeof( xsd__int));
  +	memset( &varFloat, 0, sizeof( xsd__float));
   }
   
   DivByZeroStruct::~DivByZeroStruct()
  
  
  
  1.22      +50 -72    ws-axis/c/samples/client/rpcfault/MathOps.cpp
  
  Index: MathOps.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/samples/client/rpcfault/MathOps.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- MathOps.cpp	24 Nov 2004 13:25:17 -0000	1.21
  +++ MathOps.cpp	2 Dec 2004 07:54:01 -0000	1.22
  @@ -1,49 +1,33 @@
   /*
  - *   Copyright 2003-2004 The Apache Software Foundation.
  - *
  - *   Licensed under the Apache License, Version 2.0 (the "License");
  - *   you may not use this file except in compliance with the License.
  - *   You may obtain a copy of the License at
  - *
  - *       http://www.apache.org/licenses/LICENSE-2.0
  - *
  - *   Unless required by applicable law or agreed to in writing, software
  - *   distributed under the License is distributed on an "AS IS" BASIS,
  - *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - *   See the License for the specific language governing permissions and
  - *   limitations under the License.
  - *
  - *
  - *   @author Damitha Kumarage (damitha@opensource.lk, damitha@jkcsworld.com)
  - *
  + * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
  + * This file contains Client Stub implementation for remote web service.
    */
   
  -
  -#include "MathOps.h"
  +#include "MathOps.hpp"
   
   #include <axis/AxisWrapperAPI.hpp>
   
  -extern int Axis_DeSerialize_DivByZeroStruct(DivByZeroStruct* param, IWrapperSoapDeSerializer*
pDZ);
  +using namespace std;
  +
  + extern int Axis_DeSerialize_DivByZeroStruct(DivByZeroStruct* param, IWrapperSoapDeSerializer*
pDZ);
   extern void* Axis_Create_DivByZeroStruct(DivByZeroStruct *Obj, bool bArray = false, int
nSize=0);
   extern void Axis_Delete_DivByZeroStruct(DivByZeroStruct* param, bool bArray = false, int
nSize=0);
   extern int Axis_Serialize_DivByZeroStruct(DivByZeroStruct* param, IWrapperSoapSerializer*
pSZ, bool bArray = false);
   extern int Axis_GetSize_DivByZeroStruct();
   
  -using namespace std;
  -
  - bool CallBase::bInitialized;
  -//CallFunctions CallBase::ms_VFtable;
  +MathOps::MathOps(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol)
  +:Stub(pchEndpointUri, eProtocol)
  +{
  +}
   
  -MathOps::MathOps(const char* pchEndpointUri)
  +MathOps::MathOps()
  +:Stub(" ", APTHTTP1_1)
   {
  -	m_pCall = new Call();
  -	m_pCall->setProtocol(APTHTTP1_1);
  -	m_pCall->setEndpointURI(pchEndpointUri);
  +	m_pCall->setEndpointURI("http://localhost/axis/MathOps");
   }
   
   MathOps::~MathOps()
   {
  -	delete m_pCall;
   }
   
   
  @@ -52,9 +36,9 @@
   /*
    * This method wrap the service method div
    */
  -int MathOps::div(int Value0, int Value1)
  +xsd__int MathOps::div(xsd__int Value0, xsd__int Value1)
   {
  -	int Ret;
  +	xsd__int Ret = 0;
   	const char* pcCmplxFaultName;
   	try
   	{
  @@ -63,6 +47,7 @@
   		m_pCall->setTransportProperty(SOAPACTION_HEADER , "MathOps#div");
   		m_pCall->setSOAPVersion(SOAP_VER_1_1);
   		m_pCall->setOperation("div", "http://soapinterop.org/wsdl");
  +		applyUserPreferences();
   		m_pCall->addParameter((void*)&Value0, "int0", XSD_INT);
   		m_pCall->addParameter((void*)&Value1, "int1", XSD_INT);
   		if (AXIS_SUCCESS == m_pCall->invoke())
  @@ -72,56 +57,49 @@
   				Ret = m_pCall->getElementAsInt("addReturn", 0);
   			}
   		}
  -		m_pCall->unInitialize();
  +	updateStateAfterResponse();
  +	m_pCall->unInitialize();
   		return Ret;
   	}
   	catch(AxisException& e)
   	{
  -                int iExceptionCode = e.getExceptionCode();
  +		int iExceptionCode = e.getExceptionCode();
   		if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
  -                {
  -                    throw;
  -                }
  -
  -                ISoapFault* pSoapFault = (ISoapFault*) m_pCall->checkFault("Fault",
"http://localhost/axis/MathOps/types");
  -                if(pSoapFault)
  -                {
  -		    pcCmplxFaultName = pSoapFault->getCmplxFaultObjectName().c_str();
  -		    //printf("pcCmplxFaultName:%s\n", pcCmplxFaultName);
  -                    if(0 == strcmp("DivByZeroStruct", pcCmplxFaultName))
  -                    {
  -                        DivByZeroStruct* pFaultDetail = NULL;
  -                        pFaultDetail = (DivByZeroStruct*)pSoapFault->
  -                            getCmplxFaultObject((void*) Axis_DeSerialize_DivByZeroStruct,
  -                            (void*) Axis_Create_DivByZeroStruct,
  -                            (void*) Axis_Delete_DivByZeroStruct,"DivByZeroStruct", 0);
  -
  -			pSoapFault->setCmplxFaultObject(pFaultDetail);
  -			
  -		        m_pCall->unInitialize();
  -                        throw AxisClientException(pSoapFault);
  -		    }
  -		    else
  -		    {
  -		        m_pCall->unInitialize();
  -                        throw AxisClientException(pSoapFault);
  -		    }
  -                }
  -                else throw;
  -        }
  -}
  -
  -int MathOps::getStatus()
  -{
  -	if ( m_pCall==NULL ) 
  -		return AXIS_SUCCESS; 
  -	else 
  -		return m_pCall->getStatus();
  +		{
  +	updateStateAfterResponse();
  +	m_pCall->unInitialize();
  +			throw MathOps_AxisClientException(e.what());
  +		}
  +		ISoapFault* pSoapFault = (ISoapFault*) m_pCall->checkFault("Fault","http://localhost/axis/MathOps"
);
  +		if(pSoapFault)
  +		{
  +			pcCmplxFaultName = pSoapFault->getCmplxFaultObjectName().c_str();
  +			if(0 == strcmp("DivByZeroStruct", pcCmplxFaultName))
  +			{
  +					DivByZeroStruct* pFaultDetail = NULL;
  +					pFaultDetail = (DivByZeroStruct*)pSoapFault->
  +						getCmplxFaultObject((void*) Axis_DeSerialize_DivByZeroStruct,
  +						(void*) Axis_Create_DivByZeroStruct,
  +						(void*) Axis_Delete_DivByZeroStruct,"DivByZeroStruct", 0);
  +					pSoapFault->setCmplxFaultObject(pFaultDetail);
  +	updateStateAfterResponse();
  +	m_pCall->unInitialize();
  +					throw MathOps_AxisClientException(pSoapFault);
  +			}
  +			else
  +			{
  +	updateStateAfterResponse();
  +	m_pCall->unInitialize();
  +				  m_pCall->unInitialize();
  +				  throw MathOps_AxisClientException(pSoapFault);
  +			}
  +		}
  +		else throw;
  +	}
   }
   
   int MathOps::getFaultDetail(char** ppcDetail)
   {
   	return m_pCall->getFaultDetail(ppcDetail);
  -	return 0;
   }
   
  
  
  
  1.12      +1 -1      ws-axis/c/samples/client/rpcfault/MathOpsClient.cpp
  
  Index: MathOpsClient.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/samples/client/rpcfault/MathOpsClient.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MathOpsClient.cpp	24 Nov 2004 13:25:17 -0000	1.11
  +++ MathOpsClient.cpp	2 Dec 2004 07:54:01 -0000	1.12
  @@ -1,4 +1,4 @@
  -#include "MathOps.h"
  +#include "MathOps.hpp"
   #include <axis/AxisException.hpp>
   #include <ctype.h>
   #include <iostream>
  
  
  
  1.1                  ws-axis/c/samples/client/rpcfault/DivByZeroStruct.hpp
  
  Index: DivByZeroStruct.hpp
  ===================================================================
  /*
   * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
   * This file contains functions to manipulate complex type DivByZeroStruct
   */
  
  #if !defined(__DIVBYZEROSTRUCT_PARAM_H__INCLUDED_)
  #define __DIVBYZEROSTRUCT_PARAM_H__INCLUDED_
  
  #include <axis/AxisUserAPI.hpp>
  AXIS_CPP_NAMESPACE_USE 
  
  /*Local name and the URI for the type*/
  static const char* Axis_URI_DivByZeroStruct = "http://soapinterop.org/types";
  static const char* Axis_TypeName_DivByZeroStruct = "DivByZeroStruct";
  
  class DivByZeroStruct
  {
  public:
  	xsd__string varString;
  	xsd__int varInt;
  	xsd__float varFloat;
  	DivByZeroStruct();
  	virtual ~DivByZeroStruct();
  };
  
  #endif /* !defined(__DIVBYZEROSTRUCT_PARAM_H__INCLUDED_)*/
  
  
  
  1.1                  ws-axis/c/samples/client/rpcfault/MathOps.hpp
  
  Index: MathOps.hpp
  ===================================================================
  /*
   * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
   * This file contains Client Stub Class for remote web service 
   */
  
  #if !defined(__MATHOPS_CLIENTSTUB_H__INCLUDED_)
  #define __MATHOPS_CLIENTSTUB_H__INCLUDED_
  
  #include <axis/client/Stub.hpp>
  #include "MathOps_AxisClientException.hpp"
  #include <axis/ISoapFault.hpp>
  #include "DivByZeroStruct.hpp"
  
  class MathOps :public Stub
  {
  public:
  	STORAGE_CLASS_INFO MathOps(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol=APTHTTP1_1);
  	STORAGE_CLASS_INFO MathOps();
  public:
  	STORAGE_CLASS_INFO virtual ~MathOps();
  public: 
  	STORAGE_CLASS_INFO xsd__int div(xsd__int Value0,xsd__int Value1);
  	int getFaultDetail(char** ppcDetail);
  };
  
  #endif /* !defined(__MATHOPS_CLIENTSTUB_H__INCLUDED_)*/
  
  
  
  1.1                  ws-axis/c/samples/client/rpcfault/MathOps_AxisClientException.cpp
  
  Index: MathOps_AxisClientException.cpp
  ===================================================================
  /*
   * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
   * This file contains implementations of the MathOps Exception class of the web service.
   */
  
  #include "MathOps_AxisClientException.hpp"
  
  #include <axis/AxisWrapperAPI.hpp>
  
  MathOps_AxisClientException::MathOps_AxisClientException()
  {
  /* This only serves the purpose of indicating that the 
   * service has thrown an excpetion 
   */ 
  	m_iExceptionCode = AXISC_SERVICE_THROWN_EXCEPTION; 
  	processException(m_iExceptionCode); 
  }
  
  MathOps_AxisClientException::MathOps_AxisClientException(ISoapFault* pFault)
  {
  	m_iExceptionCode = AXISC_SERVICE_THROWN_EXCEPTION;
  	m_pISoapFault = pFault;
  	processException(pFault);}
  
  MathOps_AxisClientException::MathOps_AxisClientException(int iExceptionCode)
  {
  
  	m_iExceptionCode = iExceptionCode;
  	processException (iExceptionCode);
  }
  
  MathOps_AxisClientException::MathOps_AxisClientException(exception* e)
  {
  	processException (e);
  }
  
  MathOps_AxisClientException::MathOps_AxisClientException(exception* e,int iExceptionCode)
  {
  
  	processException (e, iExceptionCode);
  }
  
  MathOps_AxisClientException::MathOps_AxisClientException(string sMessage)
  {
  	 m_sMessage =sMessage;
  }
  
  MathOps_AxisClientException::~MathOps_AxisClientException() throw () 
  {
  	m_sMessage ="";
  }
  
  void MathOps_AxisClientException:: processException(exception* e, int iExceptionCode)
  {
  	m_sMessage = getMessage (e) + getMessage (iExceptionCode);
  }
  
  void MathOps_AxisClientException::processException (ISoapFault* pFault)
  {
  	/*User can do something like deserializing the struct into a string*/
  }
  
  void MathOps_AxisClientException::processException(exception* e)
  {
  	m_sMessage = getMessage (e);
  }
  
  void MathOps_AxisClientException::processException(int iExceptionCode)
  {
  	m_sMessage = getMessage (iExceptionCode);
  }
  
  const string MathOps_AxisClientException::getMessage (exception* objException)
  {
  	string sMessage = objException->what();
  	return sMessage;
  }
  
  const string MathOps_AxisClientException::getMessage (int iExceptionCode)
  {
  	string sMessage;
  	switch(iExceptionCode)
  	{
  		case AXISC_SERVICE_THROWN_EXCEPTION:
  		sMessage = "The MathOps service has thrown an exception. see details";
  		break;
  		default:
  		sMessage = "Unknown Exception has occured in the MathOps service";
  	}
  return sMessage;
  }
  
  const char* MathOps_AxisClientException::what() throw ()
  {
  	return m_sMessage.c_str ();
  }
  
  const int MathOps_AxisClientException::getExceptionCode(){
  	return m_iExceptionCode;
  }
  
  const ISoapFault* MathOps_AxisClientException::getFault(){
  	return m_pISoapFault;
  }
  
  
  
  
  1.1                  ws-axis/c/samples/client/rpcfault/MathOps_AxisClientException.hpp
  
  Index: MathOps_AxisClientException.hpp
  ===================================================================
  /*
   * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
   * This file contains an Exception class of the web service.
   */
  
  #if !defined(__AXISCLIENTEXCEPTION_EXCEPTION_H__INCLUDED_)
  #define __AXISCLIENTEXCEPTION_EXCEPTION_H__INCLUDED_
  
  #include <string>
  #include <exception>
  #include <axis/AxisException.hpp>
  #include <axis/ISoapFault.hpp>
  #include "DivByZeroStruct.hpp"
  
  using namespace std;
  AXIS_CPP_NAMESPACE_USE 
  
  class MathOps_AxisClientException: public AxisException
  {
  public:
  	STORAGE_CLASS_INFO MathOps_AxisClientException();
  	STORAGE_CLASS_INFO MathOps_AxisClientException(ISoapFault* pFault);
  	STORAGE_CLASS_INFO MathOps_AxisClientException(int iExceptionCode);
  	STORAGE_CLASS_INFO MathOps_AxisClientException(exception* e);
  	STORAGE_CLASS_INFO MathOps_AxisClientException(exception* e, int iExceptionCode);
  	STORAGE_CLASS_INFO MathOps_AxisClientException(string sMessage);
  	STORAGE_CLASS_INFO virtual ~MathOps_AxisClientException() throw();
  	STORAGE_CLASS_INFO const char* what() throw();
  	STORAGE_CLASS_INFO const int getExceptionCode();
  	STORAGE_CLASS_INFO const string getMessage(exception* e);
  	STORAGE_CLASS_INFO const string getMessage(int iExceptionCode);
  	STORAGE_CLASS_INFO const ISoapFault* getFault();
  
  private:
  	 void processException(exception* e);
  	 void processException(ISoapFault* pFault);
  	 void processException(exception* e, int iExceptionCode);
  	 void processException(int iExceptionCode);
  	 string m_sMessage;
  	 int m_iExceptionCode;
  	 ISoapFault* m_pISoapFault;
  
  };
  
  #endif /* !defined(__AXISCLIENTEXCEPTION_EXCEPTION_H__INCLUDED_)*/
  
  
  
  1.3       +6 -6      ws-axis/c/vc/samples/client/RPCFaultClient/RPCFaultClient.dsp
  
  Index: RPCFaultClient.dsp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/vc/samples/client/RPCFaultClient/RPCFaultClient.dsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RPCFaultClient.dsp	6 Aug 2004 14:44:51 -0000	1.2
  +++ RPCFaultClient.dsp	2 Dec 2004 07:54:01 -0000	1.3
  @@ -88,15 +88,15 @@
   # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
   # Begin Source File
   
  -SOURCE=..\..\..\..\samples\client\rpcfault\AxisClientException.cpp
  +SOURCE=..\..\..\..\samples\client\rpcfault\DivByZeroStruct.cpp
   # End Source File
   # Begin Source File
   
  -SOURCE=..\..\..\..\samples\client\rpcfault\DivByZeroStruct.cpp
  +SOURCE=..\..\..\..\samples\client\rpcfault\MathOps.cpp
   # End Source File
   # Begin Source File
   
  -SOURCE=..\..\..\..\samples\client\rpcfault\MathOps.cpp
  +SOURCE=..\..\..\..\samples\client\rpcfault\MathOps_AxisClientException.cpp
   # End Source File
   # Begin Source File
   
  @@ -108,15 +108,15 @@
   # PROP Default_Filter "h;hpp;hxx;hm;inl"
   # Begin Source File
   
  -SOURCE=..\..\..\..\samples\client\rpcfault\AxisClientException.h
  +SOURCE=..\..\..\..\samples\client\rpcfault\DivByZeroStruct.hpp
   # End Source File
   # Begin Source File
   
  -SOURCE=..\..\..\..\samples\client\rpcfault\DivByZeroStruct.h
  +SOURCE=..\..\..\..\samples\client\rpcfault\MathOps.hpp
   # End Source File
   # Begin Source File
   
  -SOURCE=..\..\..\..\samples\client\rpcfault\MathOps.h
  +SOURCE=..\..\..\..\samples\client\rpcfault\MathOps_AxisClientException.hpp
   # End Source File
   # End Group
   # Begin Group "Resource Files"
  
  
  

Mime
View raw message