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 ha...@apache.org on 2005/03/23 18:26:41 UTC
cvs commit: ws-axis/c/tests/auto_build/testcases/client/cpp NillableArraysClient.cpp
hawkeye 2005/03/23 09:26:41
Added: c/tests/auto_build/testcases/handlers/handler_test16/testhandler
TestHandler.cpp THandler.cpp THandler.h
c/tests/auto_build/testcases/output
NillableArraysRequest.out HandlerTest16.expected
HandlerTest16Request.out NillableArrays.expected
c/tests/auto_build/testcases/tests NillableArrays.xml
HandlerTest16.xml
c/tests/auto_build/testcases/handlers/handler_test16/testhandler2
TestHandler2.cpp THandler2.cpp THandler2.h
c/tests/auto_build/testcases/wsdls NillableArrays.wsdl
c/tests/auto_build/testcases/client/cpp
NillableArraysClient.cpp
Log:
New tests:
Nillable arrays
handler_test16
Revision Changes Path
1.1 ws-axis/c/tests/auto_build/testcases/handlers/handler_test16/testhandler/TestHandler.cpp
Index: TestHandler.cpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
*
* 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 Andrew Perry (perryan@uk.ibm.com)
*
*****************************************************************************
* Test Logic.
* Add a SOAP header element in each handler in a handler chain.
*
* Test success is measured by comparing the actual request with an expected
* resquest.
*****************************************************************************
*
*
*/
//
//////////////////////////////////////////////////////////////////////
#include "THandler.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();
THandler* pTHandler = new THandler();
(*inst)->_functions = 0;
if (pTHandler)
{
(*inst)->_object = pTHandler;
return pTHandler->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/auto_build/testcases/handlers/handler_test16/testhandler/THandler.cpp
Index: THandler.cpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
*
* 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 Andrew Perry (perryan@uk.ibm.com)
*
*****************************************************************************
* Test Logic.
*
* Create the follow header block with a Complex Node with 5 attributes and 2 child
* complex nodes, each of which has a child character node.
*
* <ns2:basicNodeTest xmlns:ns2="http://soapinterop.org/basicNodeTest/">
* <bntn:basicNodeTestNode xmlns:bntn="http://soapinterop.org/basicNodeTestNode/"
* bntn:attr1="one" bntn:attr2="two" bntn:attr3="three"
* bntn:attr4="four" bntn:attr5="five">
* <bntc:basicNodeTestChild xmlns:bntc="http://soapinterop.org/basicNodeTestChild/">
* sub node value1
* </bntc:basicNodeTestChild>
* <bntc2:basicNodeTestChild xmlns:bntc2="http://soapinterop.org/basicNodeTestChild2/">
* sub node value2
* </bntc2:basicNodeTestChild>
* </bntn:basicNodeTestNode>
* </ns2:basicNodeTest>
*
* From this we are testing:
* - 2 different signitures of BasicNode->createAttribute
* - BasicNode->getNoOfChildren
* - BasicNode->getFirstChild
* - BasicNode->getLastChild
* - BasicNode->getChild(int)
* - BasicNode->getFirstAttribute()
* - BasicNode->getLastAttribute()
* - BasicNode->getCurrentAttribute()
* - BasicNode->getAttribute(AxisChar*, AxisChar*, AxisChar*)
*
* This is not an ideal test as ideally the attributes would have been set by
* the server and the attribute retrieved in the response message. For simplicity
* the items are set in 1 handler in a handler chain and retrieved in a second
* handler.
*
* Test success is measured by comparing the actual output and request with an
* expected request and output.
*****************************************************************************
*
*/
#include "THandler.h"
#include <axis/GDefine.hpp>
#include <axis/IHandlerSoapSerializer.hpp>
#include <axis/IHandlerSoapDeSerializer.hpp>
#include <axis/BasicNode.hpp>
#include <iostream>
THandler::THandler()
{
m_pOption = NULL;
m_sEmpty = "";
}
THandler::~THandler()
{
}
const string& THandler::getOption(const string& sArg)
{
map<string, string>::const_iterator it = m_pOption->find(sArg);
if (it != m_pOption->end())
{
return (*it).second;
}
return m_sEmpty;
}
void THandler::setOptionList(const map<string, string>* OptionList)
{
m_pOption = OptionList;
}
int THandler::invoke(void *pvIMsg)
{
IMessageData *pIMsg = (IMessageData*) pvIMsg;
if(pIMsg->isPastPivot()) {
/*this is a response*/
} else {
/*this is a request*/
IHandlerSoapSerializer* pISZ;
pIMsg->getSoapSerializer(&pISZ);
IHeaderBlock* pIHeaderBlock= pISZ->createHeaderBlock();
pIHeaderBlock->setLocalName("basicNodeTest");
pIHeaderBlock->setURI("http://soapinterop.org/basicNodeTest/");
BasicNode* pComplexNode = pIHeaderBlock->createChild(ELEMENT_NODE, "basicNodeTestNode", "bntn", "http://soapinterop.org/basicNodeTestNode/", NULL);
pIHeaderBlock->addChild(pComplexNode);
IAttribute* pIAttribute1 = pComplexNode->createAttribute("attr1", "bntn", "http://soapinterop.org/basicNodeTestNode/", "one");
IAttribute* pIAttribute2 = pComplexNode->createAttribute("attr2", "bntn", "two");
IAttribute* pIAttribute3 = pComplexNode->createAttribute("attr3", "bntn", "three");
IAttribute* pIAttribute4 = pComplexNode->createAttribute("attr4", "bntn", "four");
IAttribute* pIAttribute5 = pComplexNode->createAttribute("attr5", "bntn", "five");
BasicNode* pChildNode1 = pIHeaderBlock->createChild(ELEMENT_NODE, "basicNodeTestChild", "bntc", "http://soapinterop.org/basicNodeTestChild/", NULL);
BasicNode* pChildNode2 = pIHeaderBlock->createChild(ELEMENT_NODE, "basicNodeTestChild", "bntc2", "http://soapinterop.org/basicNodeTestChild2/", NULL);
BasicNode* pBasicNode1 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode1->setValue("sub node value1");
BasicNode* pBasicNode2 = pIHeaderBlock->createChild(CHARACTER_NODE);
pBasicNode2->setValue("sub node value2");
pChildNode1->addChild(pBasicNode1);
pChildNode2->addChild(pBasicNode2);
pComplexNode->addChild(pChildNode1);
pComplexNode->addChild(pChildNode2);
}
return AXIS_SUCCESS;
}
void THandler::onFault(void *pvIMsg)
{
}
int THandler::init()
{
//do any initialization, resetting of values
return AXIS_SUCCESS;
}
int THandler::fini()
{
//do any finalizatoin
return AXIS_SUCCESS;
}
1.1 ws-axis/c/tests/auto_build/testcases/handlers/handler_test16/testhandler/THandler.h
Index: THandler.h
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
*
* 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 Andrew Perry (perryan@uk.ibm.com)
*
*****************************************************************************
* Test Logic.
* Add a SOAP header element in each handler in a handler chain.
*
* Test success is measured by comparing the actual request with an expected
* resquest.
*****************************************************************************
*
*
*/
#if !defined(_THANDLER_H____OF_AXIS_INCLUDED_)
#define _THANDLER_H____OF_AXIS_INCLUDED_
#include <axis/Handler.hpp>
AXIS_CPP_NAMESPACE_USE
class THandler : public Handler
{
public:
int AXISCALL fini();
int AXISCALL init();
void AXISCALL onFault(void* pvIMsg);
int AXISCALL invoke(void* pvIMsg);
void setOptionList(const map<string, string>* OptionList);
const string& getOption(const string& sArg);
THandler();
virtual ~THandler();
protected:
string m_sEmpty;
};
#endif // !defined(_THANDLER_H____OF_AXIS_INCLUDED_)
1.1 ws-axis/c/tests/auto_build/testcases/output/NillableArraysRequest.out
Index: NillableArraysRequest.out
===================================================================
POST /NillableArrays/services/NillableArraysPort HTTP/1.1
Host: localhost:13260
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 470
<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoBooleanArray xmlns:ns1="http://arrays.test.apache.org">
<ns1:arg_0_0>false</ns1:arg_0_0>
<ns1:arg_0_0 xsi:nil="true"></ns1:arg_0_0>
<ns1:arg_0_0>true</ns1:arg_0_0>
</ns1:echoBooleanArray>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
POST /NillableArrays/services/NillableArraysPort HTTP/1.1
Host: localhost:13260
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 463
<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoShortArray xmlns:ns1="http://arrays.test.apache.org">
<ns1:arg_0_2>252</ns1:arg_0_2>
<ns1:arg_0_2 xsi:nil="true"></ns1:arg_0_2>
<ns1:arg_0_2>254</ns1:arg_0_2>
</ns1:echoShortArray>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
POST /NillableArrays/services/NillableArraysPort HTTP/1.1
Host: localhost:13260
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 467
<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoIntArray xmlns:ns1="http://arrays.test.apache.org">
<ns1:arg_0_3>1000000</ns1:arg_0_3>
<ns1:arg_0_3 xsi:nil="true"></ns1:arg_0_3>
<ns1:arg_0_3>1000002</ns1:arg_0_3>
</ns1:echoIntArray>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
POST /NillableArrays/services/NillableArraysPort HTTP/1.1
Host: localhost:13260
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 467
<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoLongArray xmlns:ns1="http://arrays.test.apache.org">
<ns1:arg_0_4>200001</ns1:arg_0_4>
<ns1:arg_0_4 xsi:nil="true"></ns1:arg_0_4>
<ns1:arg_0_4>200003</ns1:arg_0_4>
</ns1:echoLongArray>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
POST /NillableArrays/services/NillableArraysPort HTTP/1.1
Host: localhost:13260
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 475
<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoFloatArray xmlns:ns1="http://arrays.test.apache.org">
<ns1:arg_0_5>11.111000</ns1:arg_0_5>
<ns1:arg_0_5 xsi:nil="true"></ns1:arg_0_5>
<ns1:arg_0_5>33.111000</ns1:arg_0_5>
</ns1:echoFloatArray>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
POST /NillableArrays/services/NillableArraysPort HTTP/1.1
Host: localhost:13260
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 477
<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoDoubleArray xmlns:ns1="http://arrays.test.apache.org">
<ns1:arg_0_6>71.156500</ns1:arg_0_6>
<ns1:arg_0_6 xsi:nil="true"></ns1:arg_0_6>
<ns1:arg_0_6>73.156500</ns1:arg_0_6>
</ns1:echoDoubleArray>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
POST /NillableArrays/services/NillableArraysPort HTTP/1.1
Host: localhost:13260
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 473
<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:echoStringArray xmlns:ns1="http://arrays.test.apache.org">
<ns1:arg_0_7>Apache</ns1:arg_0_7>
<ns1:arg_0_7 xsi:nil="true"></ns1:arg_0_7>
<ns1:arg_0_7>Axis C++</ns1:arg_0_7>
</ns1:echoStringArray>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
1.1 ws-axis/c/tests/auto_build/testcases/output/HandlerTest16.expected
Index: HandlerTest16.expected
===================================================================
Number of children in header block = 1
Number of children in node = 2
getFirstAttribute() attr1=one
getNextAttribute() attr2=two
getNextAttribute() attr3=three
getNextAttribute() attr4=four
getNextAttribute() attr5=five
getAttribute() attr3=three
getLastAttribute() attr5=five
getFirstAttribute() attr1=one
getCurrentAttribute() attr1=one
BasicNode first child type = 1
BasicNode child of child type = 2
BasicNode child of child value = sub node value1
BasicNode last child type = 1
BasicNode child of child type = 2
BasicNode child of child value = sub node value2
BasicNode child(1) child type = 1
BasicNode child of child type = 2
BasicNode child of child value = sub node value1
5
---------------------- TEST COMPLETE -----------------------------
1.1 ws-axis/c/tests/auto_build/testcases/output/HandlerTest16Request.out
Index: HandlerTest16Request.out
===================================================================
POST /Calculator/services/Calculator HTTP/1.1
Host: localhost:13260
Content-Type: text/xml; charset=UTF-8
SOAPAction: "Calculator#add"
Content-Length: 963
<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header><ns2:basicNodeTest xmlns:ns2="http://soapinterop.org/basicNodeTest/"><bntn:basicNodeTestNode xmlns:bntn="http://soapinterop.org/basicNodeTestNode/" bntn:attr1="one" bntn:attr2="two" bntn:attr3="three" bntn:attr4="four" bntn:attr5="five"><bntc:basicNodeTestChild xmlns:bntc="http://soapinterop.org/basicNodeTestChild/">sub node value1</bntc:basicNodeTestChild><bntc2:basicNodeTestChild xmlns:bntc2="http://soapinterop.org/basicNodeTestChild2/">sub node value2</bntc2:basicNodeTestChild></bntn:basicNodeTestNode></ns2:basicNodeTest></SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:add xmlns:ns1="http://localhost/axis/Calculator">
<ns1:arg_0_0>2</ns1:arg_0_0>
<ns1:arg_1_0>3</ns1:arg_1_0>
</ns1:add>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
1.1 ws-axis/c/tests/auto_build/testcases/output/NillableArrays.expected
Index: NillableArrays.expected
===================================================================
invoking echoBooleanArray...
successful
invoking echoShortArray...
successful
invoking echoIntArray...
successful
invoking echoLongArray...
successful
invoking echoFloatArray...
successful
invoking echoDoubleArray...
successful
invoking echoStringArray...
successful
---------------------- TEST COMPLETE -----------------------------
1.1 ws-axis/c/tests/auto_build/testcases/tests/NillableArrays.xml
Index: NillableArrays.xml
===================================================================
<test>
<name>NillableArrays</name>
<description>NillableArrays</description>
<clientLang>cpp</clientLang>
<clientCode>NillableArraysClient.cpp</clientCode>
<wsdl>NillableArrays.wsdl</wsdl>
<expected>
<output>
NillableArrays.expected
</output>
<request>
NillableArraysRequest.out
</request>
</expected>
<endpoint>http://localhost:80/NillableArrays/services/NillableArraysPort</endpoint>
</test>
1.1 ws-axis/c/tests/auto_build/testcases/tests/HandlerTest16.xml
Index: HandlerTest16.xml
===================================================================
<test>
<name>HandlerTest16</name>
<description>CalculatorDoc with Handler Chain. Test chile node attributes and retrieval</description>
<clientLang>cpp</clientLang>
<clientCode>CalculatorDocClient.cpp</clientCode>
<wsdl>CalculatorDoc.wsdl</wsdl>
<expected>
<output>
HandlerTest16.expected
</output>
<request>
HandlerTest16Request.out
</request>
</expected>
<handler>
<directory>
handler_test16
</directory>
<service>
Calculator
</service>
</handler>
<endpoint>http://localhost:80/Calculator/services/Calculator</endpoint>
</test>
1.1 ws-axis/c/tests/auto_build/testcases/handlers/handler_test16/testhandler2/TestHandler2.cpp
Index: TestHandler2.cpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
*
* 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 Andrew Perry (perryan@uk.ibm.com)
*
*****************************************************************************
* Test Logic.
* Add a SOAP header element in each handler in a handler chain.
*
* Test success is measured by comparing the actual request with an expected
* resquest.
*****************************************************************************
*
*
*/
//
//////////////////////////////////////////////////////////////////////
#include "THandler2.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();
THandler2* pTHandler = new THandler2();
(*inst)->_functions = 0;
if (pTHandler)
{
(*inst)->_object = pTHandler;
return pTHandler->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/auto_build/testcases/handlers/handler_test16/testhandler2/THandler2.cpp
Index: THandler2.cpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
*
* 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 Andrew Perry (perryan@uk.ibm.com)
*
*****************************************************************************
* Test Logic.
*
* Create the follow header block with a Complex Node with 5 attributes and 2 child
* complex nodes, each of which has a child character node.
*
* <ns2:basicNodeTest xmlns:ns2="http://soapinterop.org/basicNodeTest/">
* <bntn:basicNodeTestNode xmlns:bntn="http://soapinterop.org/basicNodeTestNode/"
* bntn:attr1="one" bntn:attr2="two" bntn:attr3="three"
* bntn:attr4="four" bntn:attr5="five">
* <bntc:basicNodeTestChild xmlns:bntc="http://soapinterop.org/basicNodeTestChild/">
* sub node value1
* </bntc:basicNodeTestChild>
* <bntc2:basicNodeTestChild xmlns:bntc2="http://soapinterop.org/basicNodeTestChild2/">
* sub node value2
* </bntc2:basicNodeTestChild>
* </bntn:basicNodeTestNode>
* </ns2:basicNodeTest>
*
* From this we are testing:
* - 2 different signitures of BasicNode->createAttribute
* - BasicNode->getNoOfChildren
* - BasicNode->getFirstChild
* - BasicNode->getLastChild
* - BasicNode->getChild(int)
* - BasicNode->getFirstAttribute()
* - BasicNode->getLastAttribute()
* - BasicNode->getCurrentAttribute()
* - BasicNode->getAttribute(AxisChar*, AxisChar*, AxisChar*)
*
* This is not an ideal test as ideally the attributes would have been set by
* the server and the attribute retrieved in the response message. For simplicity
* the items are set in 1 handler in a handler chain and retrieved in a second
* handler.
*
* Test success is measured by comparing the actual output and request with an
* expected request and output.
*****************************************************************************
*
*/
#include "THandler2.h"
#include <axis/GDefine.hpp>
#include <axis/IHandlerSoapSerializer.hpp>
#include <axis/IHandlerSoapDeSerializer.hpp>
#include <axis/BasicNode.hpp>
#include <iostream>
THandler2::THandler2()
{
m_pOption = NULL;
m_sEmpty = "";
}
THandler2::~THandler2()
{
}
const string& THandler2::getOption(const string& sArg)
{
map<string, string>::const_iterator it = m_pOption->find(sArg);
if (it != m_pOption->end())
{
return (*it).second;
}
return m_sEmpty;
}
void THandler2::setOptionList(const map<string, string>* OptionList)
{
m_pOption = OptionList;
}
int THandler2::invoke(void *pvIMsg)
{
IMessageData *pIMsg = (IMessageData*) pvIMsg;
if(pIMsg->isPastPivot()) {
/*this is a response*/
} else {
/*this is a request*/
char api[25];
IHandlerSoapSerializer* pISZ;
pIMsg->getSoapSerializer(&pISZ);
IHeaderBlock* pIHeaderBlock = pISZ->getHeaderBlock("basicNodeTest", "http://soapinterop.org/basicNodeTest/");
int num_kids = pIHeaderBlock->getNoOfChildren();
cout << "Number of children in header block = " << num_kids << endl;
BasicNode* pBasicNode = pIHeaderBlock->getFirstChild();
if(pBasicNode) {
num_kids = pBasicNode->getNoOfChildren();
cout << "Number of children in node = " << num_kids << endl;
/* Get the first attribute of the complex node */
IAttribute* pIAttribute = pBasicNode->getFirstAttribute();
if(pIAttribute) {
strcpy(api, "getFirstAttribute() ");
/* loop through all the attribute of the complex node */
do {
cout << api << pIAttribute->getLocalName() << "=" << pIAttribute->getValue() << endl;
strcpy(api, "getNextAttribute() ");
} while( ( pIAttribute = pBasicNode->getNextAttribute() ) );
/* get a specific attribute */
pIAttribute = pBasicNode->getAttribute(NULL, NULL, "attr3");
if(pIAttribute)
cout << "getAttribute() " << pIAttribute->getLocalName() << "=" << pIAttribute->getValue() << endl;
else cout << "could not getAttribute(NULL, NULL, \"attr1\")" << endl;
/* get the last attribute */
pIAttribute = pBasicNode->getLastAttribute();
if(pIAttribute)
cout << "getLastAttribute() " << pIAttribute->getLocalName() << "=" << pIAttribute->getValue() << endl;
else cout << "could not getLastAttribute" << endl;
pIAttribute = pBasicNode->getFirstAttribute();
if(pIAttribute)
cout << "getFirstAttribute() " << pIAttribute->getLocalName() << "=" << pIAttribute->getValue() << endl;
else cout << "could not getFirstAttribute" << endl;
/* get the current node. should be the last one */
pIAttribute = pBasicNode->getCurrentAttribute();
if(pIAttribute)
cout << "getCurrentAttribute() " << pIAttribute->getLocalName() << "=" << pIAttribute->getValue() << endl;
else cout << "could not getCurrentAttribute" << endl;
} else {
cout << "cannot find first attribute" << endl;
}
BasicNode* pChildNode = pBasicNode->getFirstChild();
cout << "BasicNode first child type = " << pChildNode->getNodeType() << endl;
BasicNode* pGrandChildNode = pChildNode->getFirstChild();
cout << "BasicNode child of child type = " << pGrandChildNode->getNodeType() << endl;
cout << "BasicNode child of child value = " << pGrandChildNode->getValue() << endl;
pChildNode = pBasicNode->getLastChild();
cout << "BasicNode last child type = " << pChildNode->getNodeType() << endl;
pGrandChildNode = pChildNode->getFirstChild();
cout << "BasicNode child of child type = " << pGrandChildNode->getNodeType() << endl;
cout << "BasicNode child of child value = " << pGrandChildNode->getValue() << endl;
pChildNode = pBasicNode->getChild(1);
cout << "BasicNode child(1) child type = " << pChildNode->getNodeType() << endl;
pGrandChildNode = pChildNode->getFirstChild();
cout << "BasicNode child of child type = " << pGrandChildNode->getNodeType() << endl;
cout << "BasicNode child of child value = " << pGrandChildNode->getValue() << endl;
} else {
cout << "Cannot find Basic Node" << endl;
}
}
return AXIS_SUCCESS;
}
void THandler2::onFault(void *pvIMsg)
{
}
int THandler2::init()
{
//do any initialization, resetting of values
return AXIS_SUCCESS;
}
int THandler2::fini()
{
//do any finalizatoin
return AXIS_SUCCESS;
}
1.1 ws-axis/c/tests/auto_build/testcases/handlers/handler_test16/testhandler2/THandler2.h
Index: THandler2.h
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
*
* 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 Andrew Perry (perryan@uk.ibm.com)
*
*****************************************************************************
* Test Logic.
* Add a SOAP header element in each handler in a handler chain.
*
* Test success is measured by comparing the actual request with an expected
* resquest.
*****************************************************************************
*
*
*/
#if !defined(_THANDLER2_H____OF_AXIS_INCLUDED_)
#define _THANDLER2_H____OF_AXIS_INCLUDED_
#include <axis/Handler.hpp>
AXIS_CPP_NAMESPACE_USE
class THandler2 : public Handler
{
public:
int AXISCALL fini();
int AXISCALL init();
void AXISCALL onFault(void* pvIMsg);
int AXISCALL invoke(void* pvIMsg);
void setOptionList(const map<string, string>* OptionList);
const string& getOption(const string& sArg);
THandler2();
virtual ~THandler2();
protected:
string m_sEmpty;
};
#endif // !defined(_THANDLER2_H____OF_AXIS_INCLUDED_)
1.1 ws-axis/c/tests/auto_build/testcases/wsdls/NillableArrays.wsdl
Index: NillableArrays.wsdl
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2003-2004 The Apache Software Foundation. -->
<!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved -->
<!-- -->
<!-- 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. -->
<wsdl:definitions targetNamespace="http://arrays.test.apache.org" xmlns:impl="http://arrays.test.apache.org" xmlns:intf="http://arrays.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://arrays.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://arrays.test.apache.org" xmlns:intf="http://arrays.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<element name="echoBooleanArray">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_0" type="xsd:boolean"/>
</sequence>
</complexType>
</element>
<element name="echoBooleanArrayResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoBooleanArrayReturn" type="xsd:boolean"/>
</sequence>
</complexType>
</element>
<element name="echoShortArray">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_2" type="xsd:short"/>
</sequence>
</complexType>
</element>
<element name="echoShortArrayResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoShortArrayReturn" type="xsd:short"/>
</sequence>
</complexType>
</element>
<element name="echoIntArray">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_3" type="xsd:int"/>
</sequence>
</complexType>
</element>
<element name="echoIntArrayResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoIntArrayReturn" type="xsd:int"/>
</sequence>
</complexType>
</element>
<element name="echoLongArray">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_4" type="xsd:long"/>
</sequence>
</complexType>
</element>
<element name="echoLongArrayResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoLongArrayReturn" type="xsd:long"/>
</sequence>
</complexType>
</element>
<element name="echoFloatArray">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_5" type="xsd:float"/>
</sequence>
</complexType>
</element>
<element name="echoFloatArrayResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="echoFloatArrayReturn" type="xsd:float"/>
</sequence>
</complexType>
</element>
<element name="echoDoubleArray">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_6" type="xsd:double"/>
</sequence>
</complexType>
</element>
<element name="echoDoubleArrayResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoDoubleArrayReturn" type="xsd:double"/>
</sequence>
</complexType>
</element>
<element name="echoStringArray">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_7" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="echoStringArrayResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoStringArrayReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="echoDoubleArrayRequest">
<wsdl:part element="impl:echoDoubleArray" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoIntArrayResponse">
<wsdl:part element="impl:echoIntArrayResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoShortArrayRequest">
<wsdl:part element="impl:echoShortArray" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoShortArrayResponse">
<wsdl:part element="impl:echoShortArrayResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoIntArrayRequest">
<wsdl:part element="impl:echoIntArray" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoDoubleArrayResponse">
<wsdl:part element="impl:echoDoubleArrayResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoBooleanArrayResponse">
<wsdl:part element="impl:echoBooleanArrayResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoBooleanArrayRequest">
<wsdl:part element="impl:echoBooleanArray" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoLongArrayRequest">
<wsdl:part element="impl:echoLongArray" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoFloatArrayRequest">
<wsdl:part element="impl:echoFloatArray" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoStringArrayRequest">
<wsdl:part element="impl:echoStringArray" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoLongArrayResponse">
<wsdl:part element="impl:echoLongArrayResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoStringArrayResponse">
<wsdl:part element="impl:echoStringArrayResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="echoFloatArrayResponse">
<wsdl:part element="impl:echoFloatArrayResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="NillableArrays">
<wsdl:operation name="echoBooleanArray">
<wsdl:input message="impl:echoBooleanArrayRequest" name="echoBooleanArrayRequest"/>
<wsdl:output message="impl:echoBooleanArrayResponse" name="echoBooleanArrayResponse"/>
</wsdl:operation>
<wsdl:operation name="echoShortArray">
<wsdl:input message="impl:echoShortArrayRequest" name="echoShortArrayRequest"/>
<wsdl:output message="impl:echoShortArrayResponse" name="echoShortArrayResponse"/>
</wsdl:operation>
<wsdl:operation name="echoIntArray">
<wsdl:input message="impl:echoIntArrayRequest" name="echoIntArrayRequest"/>
<wsdl:output message="impl:echoIntArrayResponse" name="echoIntArrayResponse"/>
</wsdl:operation>
<wsdl:operation name="echoLongArray">
<wsdl:input message="impl:echoLongArrayRequest" name="echoLongArrayRequest"/>
<wsdl:output message="impl:echoLongArrayResponse" name="echoLongArrayResponse"/>
</wsdl:operation>
<wsdl:operation name="echoFloatArray">
<wsdl:input message="impl:echoFloatArrayRequest" name="echoFloatArrayRequest"/>
<wsdl:output message="impl:echoFloatArrayResponse" name="echoFloatArrayResponse"/>
</wsdl:operation>
<wsdl:operation name="echoDoubleArray">
<wsdl:input message="impl:echoDoubleArrayRequest" name="echoDoubleArrayRequest"/>
<wsdl:output message="impl:echoDoubleArrayResponse" name="echoDoubleArrayResponse"/>
</wsdl:operation>
<wsdl:operation name="echoStringArray">
<wsdl:input message="impl:echoStringArrayRequest" name="echoStringArrayRequest"/>
<wsdl:output message="impl:echoStringArrayResponse" name="echoStringArrayResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NillableArraysSoapBinding" type="impl:NillableArrays">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="echoBooleanArray">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="echoBooleanArrayRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="echoBooleanArrayResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="echoShortArray">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="echoShortArrayRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="echoShortArrayResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="echoIntArray">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="echoIntArrayRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="echoIntArrayResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="echoLongArray">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="echoLongArrayRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="echoLongArrayResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="echoFloatArray">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="echoFloatArrayRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="echoFloatArrayResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="echoDoubleArray">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="echoDoubleArrayRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="echoDoubleArrayResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="echoStringArray">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="echoStringArrayRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="echoStringArrayResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NillableArraysService">
<wsdl:port binding="impl:NillableArraysSoapBinding" name="NillableArraysPort">
<wsdlsoap:address location="http://lion:9080/NillableArrays/services/NillableArraysPort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
1.1 ws-axis/c/tests/auto_build/testcases/client/cpp/NillableArraysClient.cpp
Index: NillableArraysClient.cpp
===================================================================
// Copyright 2003-2004 The Apache Software Foundation.
// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
//
// 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.
/*
* test setting elements in a nillable array to nil.
* This is for primitive types only
*/
using namespace std;
#include "NillableArrays.hpp"
#include <axis/AxisException.hpp>
#include <iostream>
#define ARRAYSIZE 3
int main(int argc, char* argv[])
{
const char* url="http://localhost:80/axis/NillableArrays";
char endpoint[256];
if(argc>1)
url = argv[1];
try
{
sprintf(endpoint, "%s", url);
NillableArrays ws(endpoint);
xsd__boolean_Array boolean_in;
xsd__boolean_Array boolean_out;
xsd__short_Array short_in;
xsd__short_Array short_out;
xsd__int_Array int_in;
xsd__int_Array int_out;
xsd__long_Array long_in;
xsd__long_Array long_out;
xsd__float_Array float_in;
xsd__float_Array float_out;
xsd__double_Array double_in;
xsd__double_Array double_out;
xsd__string_Array string_in;
xsd__string_Array string_out;
/* Test a boolean array */
xsd__boolean b1 = (xsd__boolean)0;
xsd__boolean b3 = (xsd__boolean)1;
boolean_in.m_Array = new xsd__boolean*[ARRAYSIZE];
boolean_in.m_Size = ARRAYSIZE;
boolean_in.m_Array[0] = &b1;
boolean_in.m_Array[1] = NULL;
boolean_in.m_Array[2] = &b3;
cout << "invoking echoBooleanArray..."<<endl;
boolean_out = ws.echoBooleanArray(boolean_in);
cout << "successful "<<endl;
/* The response is not being checked at present
if(boolean_out.m_Size == ARRAYSIZE) {
if(boolean_out.m_Array[1])
cout << "failed "<<endl;
else if(*(boolean_out.m_Array[0]) == (xsd__boolean)0 && *(boolean_out.m_Array[2]) == (xsd__boolean)1)
cout << "successful "<<endl;
else
cout << "failed "<<endl;
} else
cout << "failed "<<endl;
*/
/* Test an short array */
xsd__short s1 = (xsd__short)252;
xsd__short s3 = (xsd__short)254;
short_in.m_Array = new xsd__short*[ARRAYSIZE];
short_in.m_Size = ARRAYSIZE;
short_in.m_Array[0] = &s1;
short_in.m_Array[1] = NULL;
short_in.m_Array[2] = &s3;
cout << "invoking echoShortArray..."<<endl;
short_out = ws.echoShortArray(short_in);
cout << "successful "<<endl;
/* The response is not being checked at present
if(short_out.m_Size == ARRAYSIZE) {
if(short_out.m_Array[1])
cout << "failed "<<endl;
else if(*(short_out.m_Array[0]) == 252 && *(short_out.m_Array[2]) == 254)
cout << "successful "<<endl;
else
cout << "failed "<<endl;
} else
cout << "failed "<<endl;
*/
/* Test an int array */
xsd__int val1 = 1000000;
xsd__int val3 = 1000002;
int_in.m_Array = new xsd__int*[ARRAYSIZE];
int_in.m_Size = ARRAYSIZE;
int_in.m_Array[0] = &val1;
int_in.m_Array[1] = NULL;
int_in.m_Array[2] = &val3;
cout << "invoking echoIntArray..."<<endl;
int_out = ws.echoIntArray(int_in);
cout << "successful "<<endl;
/* The response is not being checked at present
if(int_out.m_Size ==ARRAYSIZE) {
if(int_out.m_Array[1])
cout << "failed "<<endl;
else if(*(int_out.m_Array[0]) == val1 && *(int_out.m_Array[2]) == val3)
cout << "successful "<<endl;
else
cout << "failed "<<endl;
} else
cout << "failed "<<endl;
*/
/* Test a long array */
xsd__long l1 = (xsd__long)200001;
xsd__long l3 = (xsd__long)200003;
long_in.m_Array = new xsd__long*[ARRAYSIZE];
long_in.m_Size = ARRAYSIZE;
long_in.m_Array[0] = &l1;
long_in.m_Array[1] = NULL;
long_in.m_Array[2] = &l3;
cout << "invoking echoLongArray..."<<endl;
long_out = ws.echoLongArray(long_in);
cout << "successful "<<endl;
/* The response is not being checked at present
if(long_out.m_Size == ARRAYSIZE) {
if(long_out.m_Array[1])
cout << "failed "<<endl;
else if(*(long_out.m_Array[0]) == (xsd__long)200001 && *(long_out.m_Array[2]) == (xsd__long)200003)
cout << "successful "<<endl;
else
cout << "failed "<<endl;
} else
cout << "failed "<<endl;
*/
/* Test a float array */
xsd__float f1 = (xsd__float)11.111;
xsd__float f3 = (xsd__float)33.111;
float_in.m_Array = new xsd__float*[ARRAYSIZE];
float_in.m_Size = ARRAYSIZE;
float_in.m_Array[0] = &f1;
float_in.m_Array[1] = NULL;
float_in.m_Array[2] = &f3;
cout << "invoking echoFloatArray..."<<endl;
float_out = ws.echoFloatArray(float_in);
cout << "successful "<<endl;
/* The response is not being checked at present
if(float_out.m_Size ==ARRAYSIZE) {
if(float_out.m_Array[1])
cout << "failed "<<endl;
else if(*(float_out.m_Array[0]) == (xsd__float)11.111 && *(float_out.m_Array[2]) == (xsd__float)33.111)
cout << "successful "<<endl;
else
cout << "failed "<<endl;
} else
cout << "failed "<<endl;
*/
/* Test a double array */
xsd__double d1 = (xsd__double)71.1565;
xsd__double d3 = (xsd__double)73.1565;
double_in.m_Array = new xsd__double*[ARRAYSIZE];
double_in.m_Size = ARRAYSIZE;
double_in.m_Array[0] = &d1;
double_in.m_Array[1] = NULL;
double_in.m_Array[2] = &d3;
cout << "invoking echoDoubleArray..."<<endl;
double_out = ws.echoDoubleArray(double_in);
cout << "successful "<<endl;
/* The response is not being checked at present
if(double_out.m_Size ==ARRAYSIZE) {
if(double_out.m_Array[1])
cout << "failed "<<endl;
else if(*(double_out.m_Array[0]) == (xsd__double)71.1565 && *(double_out.m_Array[2]) == (xsd__double)73.1565)
cout << "successful "<<endl;
else
cout << "failed "<<endl;
} else
cout << "failed "<<endl;
*/
/* Test a string array */
static char* str1 = "Apache";
static char* str2 = "Axis C++";
string_in.m_Array = new xsd__string[ARRAYSIZE];
string_in.m_Size = ARRAYSIZE;
string_in.m_Array[0] = str1;
string_in.m_Array[1] = NULL;
string_in.m_Array[2] = str2;
cout << "invoking echoStringArray..."<<endl;
string_out = ws.echoStringArray(string_in);
if(string_out.m_Size ==ARRAYSIZE) {
if(string_out.m_Array[1])
cout << "failed "<<endl;
else if( (strcmp(string_out.m_Array[0], str1) == 0) && (strcmp(string_out.m_Array[2], str2) == 0) )
cout << "successful "<<endl;
else
cout << "failed "<<endl;
} else
cout << "failed "<<endl;
}
catch(AxisException& e)
{
cout << "Exception : "<< e.what()<<endl;
}
catch(exception& e)
{
cout << "Unknown exception has occured"<<endl;
}
catch(...)
{
cout << "Unknown exception has occured"<<endl;
}
cout << "---------------------- TEST COMPLETE -----------------------------"<< endl;
return 0;
}