susantha 2003/06/27 05:43:49
Added: c/src/server/samples/serviceinteropgroupb InteropTestB.wsdl
InteropTestB.cpp GroupBTestsWrapper.h
GroupBTestsWrapper.cpp
Log:
web services for interop testing
Revision Changes Path
1.1
xml-axis/c/src/server/samples/serviceinteropgroupb/InteropTestB.wsdl
Index: InteropTestB.wsdl
===================================================================
<?xml version="1.0"?>
<definitions name="InteropTestB" targetNamespace="http://soapinterop.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://soapinterop.org/xsd">
<import namespace =
"http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ArrayOfstring">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="string[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOfint">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="int[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOffloat">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="float[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOfSOAPStruct">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="s:SOAPStruct[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="SOAPStruct">
<all>
<element name="varString" type="string"/>
<element name="varInt" type="int"/>
<element name="varFloat" type="float"/>
</all>
</complexType>
<complexType name="SOAPStructStruct">
<all>
<element name="varString" type="string"/>
<element name="varInt" type="int"/>
<element name="varFloat" type="float"/>
<element name="varStruct" type="s:SOAPStruct"/>
</all>
</complexType>
<complexType name="SOAPArrayStruct">
<all>
<element name="varString" type="string"/>
<element name="varInt" type="int"/>
<element name="varFloat" type="float"/>
<element name="varArray"
type="s:ArrayOfstring"/>
</all>
</complexType>
<complexType name="ArrayOfString2D">
<complexContent>
<restriction base="SOAP-ENC:Array">
<attribute ref="SOAP-ENC:arrayType"
wsdl:arrayType="xsd:string[,]"/>
</restriction>
</complexContent>
</complexType>
</schema>
</types>
<message name="echoStructAsSimpleTypesRequest">
<part name="inputStruct" type="s:SOAPStruct"/>
</message>
<message name="echoStructAsSimpleTypesResponse">
<part name="outputString" type="xsd:string"/>
<part name="outputInteger" type="xsd:int"/>
<part name="outputFloat" type="xsd:float"/>
</message>
<message name="echoSimpleTypesAsStructRequest">
<part name="inputString" type="xsd:string"/>
<part name="inputInteger" type="xsd:int"/>
<part name="inputFloat" type="xsd:float"/>
</message>
<message name="echoSimpleTypesAsStructResponse">
<part name="return" type="s:SOAPStruct"/>
</message>
<message name="echo2DStringArrayRequest">
<part name="input2DStringArray" type="s:ArrayOfString2D"/>
</message>
<message name="echo2DStringArrayResponse">
<part name="return" type="s:ArrayOfString2D"/>
</message>
<message name="echoNestedStructRequest">
<part name="inputStruct" type="s:SOAPStructStruct"/>
</message>
<message name="echoNestedStructResponse">
<part name="return" type="s:SOAPStructStruct"/>
</message>
<message name="echoNestedArrayRequest">
<part name="inputStruct" type="s:SOAPArrayStruct"/>
</message>
<message name="echoNestedArrayResponse">
<part name="return" type="s:SOAPArrayStruct"/>
</message>
<portType name="InteropTestPortTypeB">
<operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct
outputString outputInteger outputFloat">
<input message="tns:echoStructAsSimpleTypesRequest"/>
<output message="tns:echoStructAsSimpleTypesResponse"/>
</operation>
<operation name="echoSimpleTypesAsStruct" parameterOrder="inputString
inputInteger inputFloat">
<input message="tns:echoSimpleTypesAsStructRequest"/>
<output message="tns:echoSimpleTypesAsStructResponse"/>
</operation>
<operation name="echo2DStringArray"
parameterOrder="input2DStringArray">
<input message="tns:echo2DStringArrayRequest"/>
<output message="tns:echo2DStringArrayResponse"/>
</operation>
<operation name="echoNestedStruct" parameterOrder="inputStruct">
<input message="tns:echoNestedStructRequest"/>
<output message="tns:echoNestedStructResponse"/>
</operation>
<operation name="echoNestedArray" parameterOrder="inputStruct">
<input message="tns:echoNestedArrayRequest"/>
<output message="tns:echoNestedArrayResponse"/>
</operation>
</portType>
<binding name="InteropTestSoapBindingB" type="tns:InteropTestPortTypeB">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="echoStructAsSimpleTypes">
<soap:operation soapAction="http://soapinterop.org/"/>
<input>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="echoSimpleTypesAsStruct">
<soap:operation soapAction="http://soapinterop.org/"/>
<input>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="echo2DStringArray">
<soap:operation soapAction="http://soapinterop.org/"/>
<input>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="echoNestedStruct">
<soap:operation soapAction="http://soapinterop.org/"/>
<input>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="echoNestedArray">
<soap:operation soapAction="http://soapinterop.org/"/>
<input>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded"
namespace="http://soapinterop.org/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
</definitions>
1.1
xml-axis/c/src/server/samples/serviceinteropgroupb/InteropTestB.cpp
Index: InteropTestB.cpp
===================================================================
/* -*- C++ -*- */
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "SOAP" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*
*
*
* @author Susantha Kumara ([EMAIL PROTECTED])
*
*/
// WsService.cpp : Defines the entry point for the DLL application.
//
#ifdef WIN32
#define STORAGE_CLASS_INFO __declspec(dllexport)
#else
#define STORAGE_CLASS_INFO
#endif
#include "GroupBTestsWrapper.h"
extern "C" {
//the two export functions////////////////////////////////////////////
STORAGE_CLASS_INFO
int GetClassInstance(BasicHandler **inst)
{
WrapperClassHandler* pWCH = new GroupBTestsWrapper();
if (pWCH)
{
pWCH->Init();
*inst = pWCH;
return SUCCESS;
}
return FAIL;
}
STORAGE_CLASS_INFO
int DestroyInstance(BasicHandler *inst)
{
if (inst)
{
WrapperClassHandler* pWCH = dynamic_cast<WrapperClassHandler*>(inst);
pWCH->Fini();
delete pWCH;
return SUCCESS;
}
return FAIL;
}
//////////////////////////////////////////////////////////////////////
}
//Following describes how the export function of the handler DLLs (or .so s)
/*
STORAGE_CLASS_INFO
int GetClassInstance(BasicHandler **inst)
{
*inst = new MyHandler();
if (*inst)
{
return SUCCESS;
}
return FAIL;
}
STORAGE_CLASS_INFO
int DestroyInstance(BasicHandler *inst)
{
if (inst)
{
delete inst;
return SUCCESS;
}
return FAIL;
}
*/
1.1
xml-axis/c/src/server/samples/serviceinteropgroupb/GroupBTestsWrapper.h
Index: GroupBTestsWrapper.h
===================================================================
// GroupBTestsWrapper.h: interface for the GroupBTestsWrapper class.
//
//////////////////////////////////////////////////////////////////////
#if
!defined(AFX_GROUPBTESTSWRAPPER_H__93570D23_4717_476D_B716_401934A332E4__INCLUDED_)
#define AFX_GROUPBTESTSWRAPPER_H__93570D23_4717_476D_B716_401934A332E4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "../libinteropgroupb/GroupBTests.h"
#include "../../../common/WrapperClassHandler.h"
#include "../../../common/MessageData.h"
#include "../../../common/GDefine.h"
#include "../../../common/AccessBean.h"
class GroupBTestsWrapper : public WrapperClassHandler
{
public:
GroupBTestsWrapper();
virtual ~GroupBTestsWrapper();
public: //WrapperClassHandler
int Invoke(MessageData* mc);
void OnFault(MessageData* pMsg);
int Init();
int Fini();
private: //Methods corresponding to the web service methods
int SetResponseMethod(MessageData* mc, const char* name);
private:
GroupBTests *pWs; // Actual web service object.
};
#endif //
!defined(AFX_GROUPBTESTSWRAPPER_H__93570D23_4717_476D_B716_401934A332E4__INCLUDED_)
1.1
xml-axis/c/src/server/samples/serviceinteropgroupb/GroupBTestsWrapper.cpp
Index: GroupBTestsWrapper.cpp
===================================================================
// GroupBTestsWrapper.cpp: implementation of the GroupBTestsWrapper class.
//
//////////////////////////////////////////////////////////////////////
#include "GroupBTestsWrapper.h"
#include "../../../soap/SoapDeSerializer.h"
#include "../../../soap/SoapSerializer.h"
#include "../../../common/BasicTypeSerializer.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
GroupBTestsWrapper::GroupBTestsWrapper()
{
}
GroupBTestsWrapper::~GroupBTestsWrapper()
{
}
// Implementation of WrapperClassHandler interface.
int GroupBTestsWrapper::Invoke(MessageData* mc)
{
string method = mc->m_pDZ->GetMethodName();
return FAIL;
}
int GroupBTestsWrapper::Init()
{
//Do any Initialization here
return 0;
}
int GroupBTestsWrapper::Fini()
{
//Do any finalization here
return 0;
}
int GroupBTestsWrapper::SetResponseMethod(MessageData* mc, const char* name)
{
string method = name;
SoapMethod* pMethod = new SoapMethod();
pMethod->setLocalName(method + "Response");
mc->m_pSZ->setSoapMethod(pMethod);
return SUCCESS;
}
void GroupBTestsWrapper::OnFault(MessageData* mc)
{
}
// Methods that wraps actual web methods