You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ra...@apache.org on 2005/03/11 12:06:29 UTC
cvs commit: ws-axis/c/tests/server/soapHeader/test6 test6.cpp test6.h test6Helper.cpp
rangika 2005/03/11 03:06:29
Modified: c/tests/server/soapHeader/test1 test1.cpp
Added: c/tests/server/soapHeader/test2 test2.cpp test2.h
test2Helper.cpp
c/tests/server/soapHeader/test3 test3.cpp test3.h
test3Helper.cpp
c/tests/server/soapHeader/test4 test4.cpp test4.h
test4Helper.cpp
c/tests/server/soapHeader/test5 test5.cpp test5.h
test5Helper.cpp
c/tests/server/soapHeader/test6 test6.cpp test6.h
test6Helper.cpp
Log:
Added some server side source files to soapHeader.
Revision Changes Path
1.2 +7 -3 ws-axis/c/tests/server/soapHeader/test1/test1.cpp
Index: test1.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/tests/server/soapHeader/test1/test1.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- test1.cpp 1 Mar 2005 04:37:09 -0000 1.1
+++ test1.cpp 11 Mar 2005 11:06:29 -0000 1.2
@@ -48,19 +48,21 @@
pIHeaderBlock->setLocalName("TestHeader");
pIHeaderBlock->setURI("http://soapinterop.org/echoheader/");
-//........ creating the User Name.......
+//........ Creating the 1st Element Node.......
- BasicNode* pBasicNode = pIHeaderBlock->createChild(ELEMENT_NODE);
+ BasicNode* pBasicNode = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode->setLocalName("User Name");
pIHeaderBlock->addChild(pBasicNode);
+//..........Creating the 1st Character Node.........
+
BasicNode* pBasicNode1 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode1->setValue("TestName");
pBasicNode->addChild(pBasicNode1);
- //........ creating the Password.......
+//........ Creating the 2nd Element Node.......
BasicNode* pBasicNode2 = pIHeaderBlock->createChild(ELEMENT_NODE);
@@ -68,6 +70,8 @@
pIHeaderBlock->addChild(pBasicNode2);
+//.......Creating the 2nd Character Node.......
+
BasicNode* pBasicNode3 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode3->setValue("Testpw");
1.1 ws-axis/c/tests/server/soapHeader/test2/test2.cpp
Index: test2.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)
*
*/
#include "test2.h"
#include <axis/GDefine.hpp>
#include <axis/IHandlerSoapSerializer.hpp>
#include <axis/IHandlerSoapDeSerializer.hpp>
#include <axis/BasicNode.hpp>
#include <iostream>
test2::test2()
{
}
test2::~test2()
{
}
int test2::invoke(void *pvIMsg)
{
int iStatus = 0;
IMessageData *pIMsg = (IMessageData*) pvIMsg;
AxisChar* pachTemp;
IHandlerSoapSerializer* pISZ;
pIMsg->getSoapSerializer(&pISZ);
// Setting a header block
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("TestName");
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);
//Deleting a header block
iStatus = pISZ->deleteHeaderBlock("TestHeader","http://soapinterop.org/echoheader/");
return iStatus;
}
void test2::onFault(void *pvIMsg)
{
}
int test2::init()
{
//do any initialization, resetting of values
return AXIS_SUCCESS;
}
int test2::fini()
{
//do any finalizatoin
return AXIS_SUCCESS;
}
1.1 ws-axis/c/tests/server/soapHeader/test2/test2.h
Index: test2.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)
*
*/
#if !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
#define _ESHHANDLER_H____OF_AXIS_INCLUDED_
#include <axis/Handler.hpp>
AXIS_CPP_NAMESPACE_USE
class test2 : public Handler
{
public:
int AXISCALL fini();
int AXISCALL init();
void AXISCALL onFault(void* pvIMsg);
int AXISCALL invoke(void* pvIMsg);
test2();
virtual ~test2();
};
#endif // !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
1.1 ws-axis/c/tests/server/soapHeader/test2/test2Helper.cpp
Index: test2Helper.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)
*
*/
#include "test2.h"
#include <axis/GDefine.hpp>
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();
test2* pESHHandler = new test2();
(*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<Handler*>(inst->_object);
pH->fini();
delete pH;
delete inst;
return AXIS_SUCCESS;
}
return AXIS_FAIL;
}
}
1.1 ws-axis/c/tests/server/soapHeader/test3/test3.cpp
Index: test3.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)
*
*/
#include "test3.h"
#include <axis/GDefine.hpp>
#include <axis/IHandlerSoapSerializer.hpp>
#include <axis/IHandlerSoapDeSerializer.hpp>
#include <axis/BasicNode.hpp>
#include <iostream>
test3::test3()
{
}
test3::~test3()
{
}
int test3::invoke(void *pvIMsg)
{
IMessageData *pIMsg = (IMessageData*) pvIMsg;
AxisChar* pachTemp;
IHandlerSoapSerializer* pISZ;
pIMsg->getSoapSerializer(&pISZ);
//... Creating the 1st Header Block...........
IHeaderBlock* pIHeaderBlock= pISZ->createHeaderBlock();
pIHeaderBlock->setLocalName("FirstHeader");
pIHeaderBlock->setURI("http://soapinterop.org/echoheader/");
//........ Creating the 1st Element Node.......
BasicNode* pBasicNode = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode->setLocalName("TestHeader");
pIHeaderBlock->addChild(pBasicNode);
//.......Creating the 1st Character Node......
BasicNode* pBasicNode1 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode1->setValue("TestValue");
pBasicNode->addChild(pBasicNode1);
//........ Creating the 2nd Element Node.......
BasicNode* pBasicNode2 = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode2->setLocalName("SecondElement");
pIHeaderBlock->addChild(pBasicNode2);
//.......Creating the 2nd Character Node......
BasicNode* pBasicNode3 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode3->setValue("SecondValue");
pBasicNode2->addChild(pBasicNode3);
//.... Creating the 2nd Header Block............
IHeaderBlock* pIHeaderBlock2= pISZ->createHeaderBlock();
pIHeaderBlock2->setLocalName("SecondHeader");
pIHeaderBlock2->setURI("http://soapinterop.org/echoheader/");
//........ Creating the 1st Element Node.......
BasicNode* pBasicNode8 = pIHeaderBlock2->createChild(ELEMENT_NODE);
pBasicNode8->setLocalName("SecondTest");
pIHeaderBlock2->addChild(pBasicNode8);
//..........Creating the 1st Character Node.......
BasicNode* pBasicNode9 = pIHeaderBlock2->createChild(CHARACTER_NODE);
pBasicNode9->setValue("TestValue");
pBasicNode8->addChild(pBasicNode9);
//........ Creating the 2nd Element Node.......
BasicNode* pBasicNode10 = pIHeaderBlock2->createChild(ELEMENT_NODE);
pBasicNode10->setLocalName("SecondNode");
pIHeaderBlock2->addChild(pBasicNode10);
//.......Creating the 2nd Character Node........
BasicNode* pBasicNode11 = pIHeaderBlock2->createChild(CHARACTER_NODE);
pBasicNode11->setValue("NodeChild");
pBasicNode10->addChild(pBasicNode11);
//....Getting the 1st header block............
IHeaderBlock* pIHeaderBlock1= pISZ->getHeaderBlock("FirstHeader","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";
}
//.......Getting the 2nd header block..........
IHeaderBlock* pIHeaderBlock3= pISZ->getHeaderBlock("SecondHeader","http://soapinterop.org/echoheader/");
//...........Getting the 1st child........
if (pIHeaderBlock3 != NULL) {
BasicNode* pBasicNode12= pIHeaderBlock3->getChild(1);
const AxisChar* pachHeaderValue2;
if (pBasicNode12 != NULL)
{
if((pBasicNode12->getNodeType()) == ELEMENT_NODE) {
BasicNode* pBasicNode13 = pBasicNode12->getFirstChild();
if((pBasicNode13->getNodeType()) == CHARACTER_NODE){
pachHeaderValue2= pBasicNode13->getValue();
}
} else {
pachHeaderValue2 = "This was not the expected value Ros";
}
}else
{
pachHeaderValue2 = "pBascNode is NULL";
}
//,...... Getting the 2nd child..............
BasicNode* pBasicNode14= pIHeaderBlock3->getChild(2);
const AxisChar* pachHeaderValue3;
if (pBasicNode14 != NULL)
{
if((pBasicNode14->getNodeType()) == ELEMENT_NODE) {
BasicNode* pBasicNode15 = pBasicNode14->getFirstChild();
if((pBasicNode15->getNodeType()) == CHARACTER_NODE){
pachHeaderValue3= pBasicNode15->getValue();
}
} else {
pachHeaderValue3 = "This was not the expected value Ros";
}
} else
{
pachHeaderValue3 = "pBascNode is NULL";
}
FILE *pFile = fopen("rangifile.txt", "a");
fputs(pachHeaderValue, pFile);
fputs("\n", pFile);
fputs(pachHeaderValue1,pFile);
fputs("\n", pFile);
fputs(pachHeaderValue2,pFile);
fputs("\n", pFile);
fputs(pachHeaderValue3,pFile);
fputs("\n", pFile);
fclose(pFile);
}
return AXIS_SUCCESS;
}
}
void test3::onFault(void *pvIMsg)
{
}
int test3::init()
{
//do any initialization, resetting of values
return AXIS_SUCCESS;
}
int test3::fini()
{
//do any finalizatoin
return AXIS_SUCCESS;
}
1.1 ws-axis/c/tests/server/soapHeader/test3/test3.h
Index: test3.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)
*
*/
#if !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
#define _ESHHANDLER_H____OF_AXIS_INCLUDED_
#include <axis/Handler.hpp>
AXIS_CPP_NAMESPACE_USE
class test3 : public Handler
{
public:
int AXISCALL fini();
int AXISCALL init();
void AXISCALL onFault(void* pvIMsg);
int AXISCALL invoke(void* pvIMsg);
test3();
virtual ~test3();
};
#endif // !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
1.1 ws-axis/c/tests/server/soapHeader/test3/test3Helper.cpp
Index: test3Helper.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)
*
*/
#include "test3.h"
#include <axis/GDefine.hpp>
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();
test3* pESHHandler = new test3();
(*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<Handler*>(inst->_object);
pH->fini();
delete pH;
delete inst;
return AXIS_SUCCESS;
}
return AXIS_FAIL;
}
}
1.1 ws-axis/c/tests/server/soapHeader/test4/test4.cpp
Index: test4.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)
*
*/
#include "test4.h"
#include <axis/GDefine.hpp>
#include <axis/IHandlerSoapSerializer.hpp>
#include <axis/IHandlerSoapDeSerializer.hpp>
#include <axis/BasicNode.hpp>
#include <iostream>
test4::test4()
{
}
test4::~test4()
{
}
int test4::invoke(void *pvIMsg)
{
int iStatus = 0;
IMessageData *pIMsg = (IMessageData*) pvIMsg;
AxisChar* pachTemp;
IHandlerSoapSerializer* pISZ;
pIMsg->getSoapSerializer(&pISZ);
//... Creating the 1st Header Block...........
IHeaderBlock* pIHeaderBlock= pISZ->createHeaderBlock();
pIHeaderBlock->setLocalName("FirstHeader");
pIHeaderBlock->setURI("http://soapinterop.org/echoheader/");
//........ Creating the 1st Element Node.......
BasicNode* pBasicNode = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode->setLocalName("FirstElement");
pIHeaderBlock->addChild(pBasicNode);
//.......Creating the 1st Character Node......
BasicNode* pBasicNode1 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode1->setValue("FirstChild");
pBasicNode->addChild(pBasicNode1);
//........ Creating the 2nd Element Node.......
BasicNode* pBasicNode2 = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode2->setLocalName("SecondElement");
pIHeaderBlock->addChild(pBasicNode2);
//.......Creating the 2nd Character Node......
BasicNode* pBasicNode3 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode3->setValue("SecondChild");
pBasicNode2->addChild(pBasicNode3);
//.... Creating the 2nd Header Block............
IHeaderBlock* pIHeaderBlock2= pISZ->createHeaderBlock();
pIHeaderBlock2->setLocalName("SecondHeader");
pIHeaderBlock2->setURI("http://soapinterop.org/echoheader/");
//........ Creating the 1st Element Node.......
BasicNode* pBasicNode8 = pIHeaderBlock2->createChild(ELEMENT_NODE);
pBasicNode8->setLocalName("FirstElement");
pIHeaderBlock2->addChild(pBasicNode8);
//..........Creating the 1st Character Node.......
BasicNode* pBasicNode9 = pIHeaderBlock2->createChild(CHARACTER_NODE);
pBasicNode9->setValue("FirstChild");
pBasicNode8->addChild(pBasicNode9);
//........ Creating the 2nd Element Node.......
BasicNode* pBasicNode10 = pIHeaderBlock2->createChild(ELEMENT_NODE);
pBasicNode10->setLocalName("SecondElement");
pIHeaderBlock2->addChild(pBasicNode10);
//.......Creating the 2nd Character Node........
BasicNode* pBasicNode11 = pIHeaderBlock2->createChild(CHARACTER_NODE);
pBasicNode11->setValue("SecondChild");
pBasicNode10->addChild(pBasicNode11);
//.... Creating the 3rd Header Block............
IHeaderBlock* pIHeaderBlock3= pISZ->createHeaderBlock();
pIHeaderBlock3->setLocalName("ThirdHeader");
pIHeaderBlock3->setURI("http://soapinterop.org/echoheader/");
//........ Creating the 1st Element Node.......
BasicNode* pBasicNode12 = pIHeaderBlock3->createChild(ELEMENT_NODE);
pBasicNode12->setLocalName("FirstElement");
pIHeaderBlock3->addChild(pBasicNode12);
//..........Creating the 1st Character Node.......
BasicNode* pBasicNode13 = pIHeaderBlock3->createChild(CHARACTER_NODE);
pBasicNode13->setValue("FirstChild");
pBasicNode12->addChild(pBasicNode13);
//........ Creating the 2nd Element Node.......
BasicNode* pBasicNode14 = pIHeaderBlock3->createChild(ELEMENT_NODE);
pBasicNode14->setLocalName("SecondElement");
pIHeaderBlock3->addChild(pBasicNode14);
//.......Creating the 2nd Character Node........
BasicNode* pBasicNode15 = pIHeaderBlock3->createChild(CHARACTER_NODE);
pBasicNode15->setValue("SecondChild");
pBasicNode14->addChild(pBasicNode15);
iStatus = pISZ->deleteHeaderBlock("FirstHeader","http://soapinterop.org/echoheader/");
iStatus = pISZ->deleteHeaderBlock("SecondHeader","http://soapinterop.org/echoheader/");
return iStatus;
}
void test4::onFault(void *pvIMsg)
{
}
int test4::init()
{
//do any initialization, resetting of values
return AXIS_SUCCESS;
}
int test4::fini()
{
//do any finalizatoin
return AXIS_SUCCESS;
}
1.1 ws-axis/c/tests/server/soapHeader/test4/test4.h
Index: test4.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)
*
*/
#if !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
#define _ESHHANDLER_H____OF_AXIS_INCLUDED_
#include <axis/Handler.hpp>
AXIS_CPP_NAMESPACE_USE
class test4 : public Handler
{
public:
int AXISCALL fini();
int AXISCALL init();
void AXISCALL onFault(void* pvIMsg);
int AXISCALL invoke(void* pvIMsg);
test4();
virtual ~test4();
};
#endif // !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
1.1 ws-axis/c/tests/server/soapHeader/test4/test4Helper.cpp
Index: test4Helper.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)
*
*/
#include "test4.h"
#include <axis/GDefine.hpp>
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();
test4* pESHHandler = new test4();
(*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<Handler*>(inst->_object);
pH->fini();
delete pH;
delete inst;
return AXIS_SUCCESS;
}
return AXIS_FAIL;
}
}
1.1 ws-axis/c/tests/server/soapHeader/test5/test5.cpp
Index: test5.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)
*
*/
#include "test5.h"
#include <axis/GDefine.hpp>
#include <axis/IHandlerSoapSerializer.hpp>
#include <axis/IHandlerSoapDeSerializer.hpp>
#include <axis/BasicNode.hpp>
#include <iostream>
test5::test5()
{
}
test5::~test5()
{
}
int test5::invoke(void *pvIMsg)
{
int iStatus = 0;
IMessageData *pIMsg = (IMessageData*) pvIMsg;
AxisChar* pachTemp;
IHandlerSoapSerializer* pISZ;
pIMsg->getSoapSerializer(&pISZ);
//... Creating the 1st Header Block...........
IHeaderBlock* pIHeaderBlock= pISZ->createHeaderBlock();
pIHeaderBlock->setLocalName("FirstHeader");
pIHeaderBlock->setURI("http://soapinterop.org/echoheader/");
//........ Creating the 1st Element Node.......
BasicNode* pBasicNode = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode->setLocalName("FirstElement");
pIHeaderBlock->addChild(pBasicNode);
//.......Creating the 1st Character Node......
BasicNode* pBasicNode1 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode1->setValue("FirstChild");
pBasicNode->addChild(pBasicNode1);
//........ Creating the 2nd Element Node.......
BasicNode* pBasicNode2 = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode2->setLocalName("SecondElement");
pIHeaderBlock->addChild(pBasicNode2);
//.......Creating the 2nd Character Node......
BasicNode* pBasicNode3 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode3->setValue("SecondChild");
pBasicNode2->addChild(pBasicNode3);
//.... Creating the 2nd Header Block............
IHeaderBlock* pIHeaderBlock2= pISZ->createHeaderBlock();
pIHeaderBlock2->setLocalName("SecondHeader");
pIHeaderBlock2->setURI("http://soapinterop.org/echoheader/");
//........ Creating the 1st Element Node.......
BasicNode* pBasicNode8 = pIHeaderBlock2->createChild(ELEMENT_NODE);
pBasicNode8->setLocalName("FirstElement");
pIHeaderBlock2->addChild(pBasicNode8);
//..........Creating the 1st Character Node.......
BasicNode* pBasicNode9 = pIHeaderBlock2->createChild(CHARACTER_NODE);
pBasicNode9->setValue("FirstChild");
pBasicNode8->addChild(pBasicNode9);
//........ Creating the 2nd Element Node.......
BasicNode* pBasicNode10 = pIHeaderBlock2->createChild(ELEMENT_NODE);
pBasicNode10->setLocalName("SecondElement");
pIHeaderBlock2->addChild(pBasicNode10);
//.......Creating the 2nd Character Node........
BasicNode* pBasicNode11 = pIHeaderBlock2->createChild(CHARACTER_NODE);
pBasicNode11->setValue("SecondChild");
pBasicNode10->addChild(pBasicNode11);
iStatus = pISZ->removeSoapHeader();
return iStatus;
}
void test5::onFault(void *pvIMsg)
{
}
int test5::init()
{
//do any initialization, resetting of values
return AXIS_SUCCESS;
}
int test5::fini()
{
//do any finalizatoin
return AXIS_SUCCESS;
}
1.1 ws-axis/c/tests/server/soapHeader/test5/test5.h
Index: test5.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)
*
*/
#if !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
#define _ESHHANDLER_H____OF_AXIS_INCLUDED_
#include <axis/Handler.hpp>
AXIS_CPP_NAMESPACE_USE
class test5 : public Handler
{
public:
int AXISCALL fini();
int AXISCALL init();
void AXISCALL onFault(void* pvIMsg);
int AXISCALL invoke(void* pvIMsg);
test5();
virtual ~test5();
};
#endif // !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
1.1 ws-axis/c/tests/server/soapHeader/test5/test5Helper.cpp
Index: test5Helper.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)
*
*/
#include "test5.h"
#include <axis/GDefine.hpp>
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();
test5* pESHHandler = new test5();
(*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<Handler*>(inst->_object);
pH->fini();
delete pH;
delete inst;
return AXIS_SUCCESS;
}
return AXIS_FAIL;
}
}
1.1 ws-axis/c/tests/server/soapHeader/test6/test6.cpp
Index: test6.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)
*
*/
#include "test6.h"
#include <axis/GDefine.hpp>
#include <axis/IHandlerSoapSerializer.hpp>
#include <axis/IHandlerSoapDeSerializer.hpp>
#include <axis/BasicNode.hpp>
#include <iostream>
test6::test6()
{
}
test6::~test6()
{
}
int test6::invoke(void *pvIMsg)
{
IMessageData *pIMsg = (IMessageData*) pvIMsg;
AxisChar* pachTemp;
IHandlerSoapSerializer* pISZ;
pIMsg->getSoapSerializer(&pISZ);
//... Creating the Header Block...........
IHeaderBlock* pIHeaderBlock= pISZ->createHeaderBlock();
pIHeaderBlock->setLocalName("Student");
pIHeaderBlock->setURI("http://soapinterop.org/echoheader/");
//........ Creating the 1st Element Node.......
BasicNode* pBasicNode = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode->setLocalName("StudDetails");
pIHeaderBlock->addChild(pBasicNode);
//.......Creating the 2nd Element Node......
BasicNode* pBasicNode1 = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode1->setLocalName("StudNo");
pBasicNode->addChild(pBasicNode1);
//........ Creating the 1st Character Node.......
BasicNode* pBasicNode2 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode2->setValue("1111");
pBasicNode1->addChild(pBasicNode2);
//.......Creating the 3rd Element Node......
BasicNode* pBasicNode3 = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode3->setLocalName("StudName");
pBasicNode->addChild(pBasicNode3);
//......Creating the 4th Element Node......
BasicNode* pBasicNode4 = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode4->setLocalName("FirstName");
pBasicNode3->addChild(pBasicNode4);
//........ Creating the 2nd Character Node.......
BasicNode* pBasicNode5 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode5->setValue("Keanu");
pBasicNode4->addChild(pBasicNode5);
//......Creating the 5th Element Node......
BasicNode* pBasicNode6 = pIHeaderBlock->createChild(ELEMENT_NODE);
pBasicNode6->setLocalName("LastName");
pBasicNode3->addChild(pBasicNode6);
//........ Creating the 3rd Character Node.......
BasicNode* pBasicNode7 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode7->setValue("Reeves");
pBasicNode6->addChild(pBasicNode7);
//....Getting the header block............
IHeaderBlock* pIHeaderBlock1= pISZ->getHeaderBlock("Student","http://soapinterop.org/echoheader/");
//.......Getting the 1st child.........
if (pIHeaderBlock1 != NULL) {
FILE *pFile = fopen("rangifile.txt", "a");
BasicNode* pBasicNode8= pIHeaderBlock1->getChild(1);
const AxisChar* pachHeaderValue;
if (pBasicNode8 != NULL)
{
if((pBasicNode8->getNodeType()) == ELEMENT_NODE) {
//get the first child which is the "studno"
BasicNode* pBasicNode9 = pBasicNode8->getFirstChild();
if((pBasicNode9->getNodeType()) == ELEMENT_NODE){
BasicNode* pBasicNode10 = pBasicNode9->getFirstChild();
if((pBasicNode10->getNodeType()) == CHARACTER_NODE){
pachHeaderValue= pBasicNode10->getValue();
fputs(pachHeaderValue, pFile);
fputs("\n", pFile);
}
}
//get the second child which is the "studname"
BasicNode* pBasicNode11= pBasicNode8->getChild(2);
const AxisChar* pachHeaderValue1;
if (pBasicNode11 != NULL)
{
if((pBasicNode11->getNodeType()) == ELEMENT_NODE) {
BasicNode* pBasicNode12 = pBasicNode11->getFirstChild();
if((pBasicNode12->getNodeType()) == ELEMENT_NODE){
BasicNode* pBasicNode13 = pBasicNode12->getFirstChild();
if((pBasicNode13->getNodeType()) == CHARACTER_NODE){
pachHeaderValue1= pBasicNode13->getValue();
fputs(pachHeaderValue1,pFile);
fputs("\n", pFile);
}
}
BasicNode* pBasicNode14 = pBasicNode11->getLastChild();
const AxisChar* pachHeaderValue2;
if (pBasicNode14 != NULL)
{
if((pBasicNode14->getNodeType()) == ELEMENT_NODE){
BasicNode* pBasicNode15 = pBasicNode14->getFirstChild();
if((pBasicNode15->getNodeType()) == CHARACTER_NODE){
pachHeaderValue2= pBasicNode15->getValue();
fputs(pachHeaderValue2,pFile);
fputs("\n", pFile);
}
}
}
}
}
}
fclose(pFile);
}
}
return AXIS_SUCCESS;
}
void test6::onFault(void *pvIMsg)
{
}
int test6::init()
{
//do any initialization, resetting of values
return AXIS_SUCCESS;
}
int test6::fini()
{
//do any finalizatoin
return AXIS_SUCCESS;
}
1.1 ws-axis/c/tests/server/soapHeader/test6/test6.h
Index: test6.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)
*
*/
#if !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
#define _ESHHANDLER_H____OF_AXIS_INCLUDED_
#include <axis/Handler.hpp>
AXIS_CPP_NAMESPACE_USE
class test6 : public Handler
{
public:
int AXISCALL fini();
int AXISCALL init();
void AXISCALL onFault(void* pvIMsg);
int AXISCALL invoke(void* pvIMsg);
test6();
virtual ~test6();
};
#endif // !defined(_ESHHANDLER_H____OF_AXIS_INCLUDED_)
1.1 ws-axis/c/tests/server/soapHeader/test6/test6Helper.cpp
Index: test6Helper.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)
*
*/
#include "test6.h"
#include <axis/GDefine.hpp>
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();
test6* pESHHandler = new test6();
(*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<Handler*>(inst->_object);
pH->fini();
delete pH;
delete inst;
return AXIS_SUCCESS;
}
return AXIS_FAIL;
}
}