Return-Path: Delivered-To: apmail-ws-axis-cvs-archive@www.apache.org Received: (qmail 80550 invoked from network); 14 Mar 2005 12:39:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Mar 2005 12:39:06 -0000 Received: (qmail 42579 invoked by uid 500); 14 Mar 2005 12:39:03 -0000 Delivered-To: apmail-ws-axis-cvs-archive@ws.apache.org Received: (qmail 42261 invoked by uid 500); 14 Mar 2005 12:39:02 -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 42245 invoked by uid 99); 14 Mar 2005 12:39:01 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME 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; Mon, 14 Mar 2005 04:39:00 -0800 Received: (qmail 80342 invoked by uid 1972); 14 Mar 2005 12:38:59 -0000 Date: 14 Mar 2005 12:38:59 -0000 Message-ID: <20050314123859.80341.qmail@minotaur.apache.org> From: nithya@apache.org To: ws-axis-cvs@apache.org Subject: cvs commit: ws-axis/c/tests/server/soapHeader/test8 build.sh test8.cpp test8.h test8Helper.cpp X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N nithya 2005/03/14 04:38:59 Added: c/tests/server/soapHeader/test8 build.sh test8.cpp test8.h test8Helper.cpp Log: test case to set soap headers with null values Revision Changes Path 1.1 ws-axis/c/tests/server/soapHeader/test8/build.sh Index: build.sh =================================================================== g++ -shared -I$AXISCPP_HOME/include -olibTest8Handler.so *.cpp 1.1 ws-axis/c/tests/server/soapHeader/test8/test8.cpp Index: test8.cpp =================================================================== /* * 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 Rangika Mendis (rangika@opensource.lk) * @author Nithyakala Thangarajah (nithya@opensource.lk) * */ #include "test8.h" #include #include #include #include #include test8::test8() { } test8::~test8() { } int test8::invoke(void *pvIMsg) { IMessageData *pIMsg = (IMessageData*) pvIMsg; AxisChar* pachTemp; IHandlerSoapSerializer* pISZ; pIMsg->getSoapSerializer(&pISZ); IHeaderBlock* pIHeaderBlock= pISZ->createHeaderBlock(); pIHeaderBlock->setLocalName("TestHeader"); pIHeaderBlock->setURI("http://soapinterop.org/echoheader/"); //........ creating the User Name....... BasicNode* pBasicNode = pIHeaderBlock->createChild(ELEMENT_NODE); pBasicNode->setLocalName("User Name"); pIHeaderBlock->addChild(pBasicNode); BasicNode* pBasicNode1 = pIHeaderBlock->createChild(CHARACTER_NODE); pBasicNode1->setValue(NULL); pBasicNode->addChild(pBasicNode1); //........ creating the Password....... BasicNode* pBasicNode2 = pIHeaderBlock->createChild(ELEMENT_NODE); pBasicNode2->setLocalName("Password"); pIHeaderBlock->addChild(pBasicNode2); BasicNode* pBasicNode3 = pIHeaderBlock->createChild(CHARACTER_NODE); pBasicNode3->setValue("Testpw"); pBasicNode2->addChild(pBasicNode3); //Getting the header block IHeaderBlock* pIHeaderBlock1= pISZ->getHeaderBlock("TestHeader","http://soapinterop.org/echoheader/"); //Getting the 1st child if (pIHeaderBlock1 != NULL) { BasicNode* pBasicNode4= pIHeaderBlock1->getChild(1); const AxisChar* pachHeaderValue; if (pBasicNode4 != NULL) { if((pBasicNode4->getNodeType()) == ELEMENT_NODE) { BasicNode* pBasicNode5 = pBasicNode4->getFirstChild(); if((pBasicNode5->getNodeType()) == CHARACTER_NODE){ pachHeaderValue= pBasicNode5->getValue(); } } else { pachHeaderValue = "This was not the expected value Ros"; } }else { pachHeaderValue = "pBascNode is NULL"; } // Getting the 2nd child BasicNode* pBasicNode6= pIHeaderBlock1->getChild(2); const AxisChar* pachHeaderValue1; if (pBasicNode6 != NULL) { if((pBasicNode6->getNodeType()) == ELEMENT_NODE) { BasicNode* pBasicNode7 = pBasicNode6->getFirstChild(); if((pBasicNode7->getNodeType()) == CHARACTER_NODE){ pachHeaderValue1= pBasicNode7->getValue(); } } else { pachHeaderValue1 = "This was not the expected value Ros"; } } else { pachHeaderValue1 = "pBascNode is NULL"; } return AXIS_SUCCESS; } } void test8::onFault(void *pvIMsg) { } int test8::init() { //do any initialization, resetting of values return AXIS_SUCCESS; } int test8::fini() { //do any finalizatoin return AXIS_SUCCESS; } 1.1 ws-axis/c/tests/server/soapHeader/test8/test8.h Index: test8.h =================================================================== /* * 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 Rangika Mendis (rangika@opensource.lk) * @author Nithyakala Thangarajah (nithya@opensource.lk) * */ #if !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_) #define _ESHHANDLER_H____OF_AXIS_INCLUDED_ #include AXIS_CPP_NAMESPACE_USE class test8 : public Handler { public: int AXISCALL fini(); int AXISCALL init(); void AXISCALL onFault(void* pvIMsg); int AXISCALL invoke(void* pvIMsg); test8(); virtual ~test8(); }; #endif // !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_) 1.1 ws-axis/c/tests/server/soapHeader/test8/test8Helper.cpp Index: test8Helper.cpp =================================================================== /* * 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 Rangika Mendis (rangika@opensource.lk) * @author Nithyakala Thangarajah (nithya@opensource.lk) * */ #include "test8.h" #include extern "C" { //the two export functions//////////////////////////////////////////// //Following describes how the export function of the handler DLLs (or .so s) STORAGE_CLASS_INFO int GetClassInstance(BasicHandler **inst) { *inst = new BasicHandler(); test8* pESHHandler = new test8(); (*inst)->_functions = 0; if (pESHHandler) { (*inst)->_object = pESHHandler; return pESHHandler->init(); } return AXIS_FAIL; } STORAGE_CLASS_INFO int DestroyInstance(BasicHandler *inst) { if (inst) { Handler* pH = static_cast(inst->_object); pH->fini(); delete pH; delete inst; return AXIS_SUCCESS; } return AXIS_FAIL; } }