Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 24722 invoked from network); 18 Mar 2005 12:15:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Mar 2005 12:15:35 -0000 Received: (qmail 96560 invoked by uid 500); 18 Mar 2005 12:15:33 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 96518 invoked by uid 500); 18 Mar 2005 12:15:33 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 96505 invoked by uid 99); 18 Mar 2005 12:15:33 -0000 X-ASF-Spam-Status: No, hits=-9.3 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,WEIRD_PORT X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 18 Mar 2005 04:15:32 -0800 Received: (qmail 24643 invoked by uid 2003); 18 Mar 2005 12:15:31 -0000 Date: 18 Mar 2005 12:15:31 -0000 Message-ID: <20050318121531.24642.qmail@minotaur.apache.org> From: jamejose@apache.org To: ws-axis-cvs@apache.org Subject: cvs commit: ws-axis/c/tests/auto_build/testcases/dynamic/DynamicGet_AddAnyObjectTestOutOfScope Calculator.hpp Calculator.cpp X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N jamejose 2005/03/18 04:15:31 Added: c/tests/auto_build/testcases/dynamic/DynamicGet_AddAnyObjectTestOutOfScope Calculator.hpp Calculator.cpp Log: Revision Changes Path 1.1 ws-axis/c/tests/auto_build/testcases/dynamic/DynamicGet_AddAnyObjectTestOutOfScope/Calculator.hpp Index: Calculator.hpp =================================================================== /* * This is a manually edited version of the Generated stub code for CaluclatorDoc.wsdl * to simplify the code to allow the cpp file to be edited to be used as a dynamic client */ #if !defined(__CALCULATOR_CLIENT_H__INCLUDED_) #define __CALCULATOR_CLIENT_H__INCLUDED_ #include #include #include #include #include using namespace std; AXIS_CPP_NAMESPACE_USE class Calculator { public: STORAGE_CLASS_INFO Calculator(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol=APTHTTP1_1); STORAGE_CLASS_INFO Calculator(); public: STORAGE_CLASS_INFO virtual ~Calculator(); public: STORAGE_CLASS_INFO void SetSecure( char *, ...); STORAGE_CLASS_INFO xsd__int div(xsd__int Value0,xsd__int Value1); private: void includeSecure(); Call *m_pCall; protected: std::string sArguments[8]; }; #endif /* !defined(__CALCULATOR_CLIENT_H__INCLUDED_)*/ 1.1 ws-axis/c/tests/auto_build/testcases/dynamic/DynamicGet_AddAnyObjectTestOutOfScope/Calculator.cpp Index: Calculator.cpp =================================================================== /* * This is a manually edited version of the Generated stub code for CaluclatorDoc.wsdl * to simplify the code to allow the cpp file to be edited to be used as a dynamic client. * This program tests getAnyObject() and addAnyObject() API in Call class * @ Author : James Jose */ #include "Calculator.hpp" #include #include #include #include Calculator::Calculator(const char* pcEndpointUri, AXIS_PROTOCOL_TYPE eProtocol) { m_pCall=new Call(); m_pCall->setProtocol(eProtocol); m_pCall->setEndpointURI(pcEndpointUri); } Calculator::Calculator() { m_pCall=new Call(); m_pCall->setEndpointURI("http://localhost/axis/Calculator"); } Calculator::~Calculator() { free(m_pCall); m_pCall=NULL; } void Calculator::SetSecure( char * pszArguments, ...) { char ** ppszArgPtr = &pszArguments; int iArgIndex = 0; while( *ppszArgPtr != NULL) { sArguments[iArgIndex] = *ppszArgPtr; iArgIndex++; ppszArgPtr++; } } xsd__int Calculator::div(xsd__int Value0, xsd__int Value1) { xsd__int Ret = 0; AnyType * any; AnyType* pAny = new AnyType(); pAny->_size = 2; pAny->_array = new char*[2]; char *p=new char[100]; sprintf(p,"%d",Value0); pAny->_array[0]=strdup(p); sprintf(p,"%d",Value1); //pAny->_array[1]=strdup("0"); pAny->_array[1]=strdup(p); const char* pcCmplxFaultName; try { m_pCall->initialize(CPP_DOC_PROVIDER); m_pCall->setTransportProperty(SOAPACTION_HEADER , "Calculator#div"); m_pCall->setSOAPVersion(SOAP_VER_1_1); m_pCall->setOperation("div", "http://localhost/axis/Calculator"); includeSecure(); char cPrefixAndParamName0[17]; cout<addAnyObject(pAny)<invoke()) { if(AXIS_SUCCESS == m_pCall->checkMessage("divResponse", "http://localhost/axis/Calculator")) { any = (AnyType*)m_pCall->getAnyObject(); if(any!=NULL){ cout << any->_size<_array[0]<getAnyObject(); any = (AnyType*)m_pCall->getAnyObject(); any = (AnyType*)m_pCall->getAnyObject(); if(any!=NULL){ cout << any->_size<_array[0]<getAnyObject(); if(any!=NULL){ cout << any->_size<_array[0]<unInitialize(); delete pAny; delete p; return Ret; } void Calculator::includeSecure() { m_pCall->setTransportProperty( SECURE_PROPERTIES, (const char *) &sArguments); } int main(int argc, char* argv[]) { char endpoint[256]; const char* url="http://localhost:9080/Calculator/services/Calculator"; int iResult; if(argc > 1){ url=argv[1]; } try { sprintf(endpoint, "%s", url); Calculator ws(endpoint); ws.div(10,2); } catch(AxisException& e) { cout << "Exception : " << e.what() << endl; } catch(exception& e) { cout << "Unknown exception has occured" << endl; } catch(...) { cout << "Unspecified exception has occured" << endl; } cout << "----------------------------TEST COMPLETE------------------------------------" << endl; return 0; }