axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From susan...@apache.org
Subject cvs commit: xml-axis/c/src/server/samples/serviceinteropbase InteropTest.wsdl InteropTest.cpp BaseTestsWrapper.h BaseTestsWrapper.cpp
Date Fri, 27 Jun 2003 12:42:12 GMT
susantha    2003/06/27 05:42:12

  Added:       c/src/server/samples/serviceinteropbase InteropTest.wsdl
                        InteropTest.cpp BaseTestsWrapper.h
                        BaseTestsWrapper.cpp
  Log:
  web services for interop testing
  
  Revision  Changes    Path
  1.1                  xml-axis/c/src/server/samples/serviceinteropbase/InteropTest.wsdl
  
  Index: InteropTest.wsdl
  ===================================================================
  <?xml version="1.0"?>
  <definitions name="InteropTest" 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>
  		</schema>
  	</types>
  
  	<message name="echoStringRequest">
  		<part name="inputString" type="xsd:string"/>
  	</message>
  	<message name="echoStringResponse">
  		<part name="return" type="xsd:string"/>
  	</message>
  	<message name="echoStringArrayRequest">
  		<part name="inputStringArray" type="s:ArrayOfstring"/>
  	</message>
  	<message name="echoStringArrayResponse">
  		<part name="return" type="s:ArrayOfstring"/>
  	</message>
  	<message name="echoIntegerRequest">
  		<part name="inputInteger" type="xsd:int"/>
  	</message>
  	<message name="echoIntegerResponse">
  		<part name="return" type="xsd:int"/>
  	</message>
  	<message name="echoIntegerArrayRequest">
  		<part name="inputIntegerArray" type="s:ArrayOfint"/>
  	</message>
  	<message name="echoIntegerArrayResponse">
  		<part name="return" type="s:ArrayOfint"/>
  	</message>
  	<message name="echoFloatRequest">
  		<part name="inputFloat" type="xsd:float"/>
  	</message>
  	<message name="echoFloatResponse">
  		<part name="return" type="xsd:float"/>
  	</message>
  	<message name="echoFloatArrayRequest">
  		<part name="inputFloatArray" type="s:ArrayOffloat"/>
  	</message>
  	<message name="echoFloatArrayResponse">
  		<part name="return" type="s:ArrayOffloat"/>
  	</message>
  	<message name="echoStructRequest">
  		<part name="inputStruct" type="s:SOAPStruct"/>
  	</message>
  	<message name="echoStructResponse">
  		<part name="return" type="s:SOAPStruct"/>
  	</message>
  	<message name="echoStructArrayRequest">
  		<part name="inputStructArray" type="s:ArrayOfSOAPStruct"/>
  	</message>
  	<message name="echoStructArrayResponse">
  		<part name="return" type="s:ArrayOfSOAPStruct"/>
  	</message>
  	<message name="echoVoidRequest"/>
  	<message name="echoVoidResponse"/>
  	<message name="echoBase64Request">
  		<part name="inputBase64" type="xsd:base64Binary"/>
  	</message>
  	<message name="echoBase64Response">
  		<part name="return" type="xsd:base64Binary"/>
  	</message>
  	<message name="echoDateRequest">
  		<part name="inputDate" type="xsd:dateTime"/>
  	</message>
  	<message name="echoDateResponse">
  		<part name="return" type="xsd:dateTime"/>
  	</message>
  	<message name="echoHexBinaryRequest">
  		<part name="inputHexBinary" type="xsd:hexBinary"/>
  	</message>
  	<message name="echoHexBinaryResponse">
  		<part name="return" type="xsd:hexBinary"/>
  	</message>
  	<message name="echoDecimalRequest">
  		<part name="inputDecimal" type="xsd:decimal"/>
  	</message>
  	<message name="echoDecimalResponse">
  		<part name="return" type="xsd:decimal"/>
  	</message>
  	<message name="echoBooleanRequest">
  		<part name="inputBoolean" type="xsd:boolean"/>
  	</message>
  	<message name="echoBooleanResponse">
  		<part name="return" type="xsd:boolean"/>
  	</message>
  
  	<portType name="InteropTestPortType">
  		<operation name="echoString" parameterOrder="inputString">
  			<input message="tns:echoStringRequest"/>
  			<output message="tns:echoStringResponse"/>
  		</operation>
  		<operation name="echoStringArray" parameterOrder="inputStringArray">
  			<input message="tns:echoStringArrayRequest"/>
  			<output message="tns:echoStringArrayResponse"/>
  		</operation>
  		<operation name="echoInteger" parameterOrder="inputInteger">
  			<input message="tns:echoIntegerRequest"/>
  			<output message="tns:echoIntegerResponse"/>
  		</operation>
  		<operation name="echoIntegerArray" parameterOrder="inputIntegerArray">
  			<input message="tns:echoIntegerArrayRequest"/>
  			<output message="tns:echoIntegerArrayResponse"/>
  		</operation>
  		<operation name="echoFloat" parameterOrder="inputFloat">
  			<input message="tns:echoFloatRequest"/>
  			<output message="tns:echoFloatResponse"/>
  		</operation>
  		<operation name="echoFloatArray" parameterOrder="inputFloatArray">
  			<input message="tns:echoFloatArrayRequest"/>
  			<output message="tns:echoFloatArrayResponse"/>
  		</operation>
  		<operation name="echoStruct" parameterOrder="inputStruct">
  			<input message="tns:echoStructRequest"/>
  			<output message="tns:echoStructResponse"/>
  		</operation>
  		<operation name="echoStructArray" parameterOrder="inputStructArray">
  			<input message="tns:echoStructArrayRequest"/>
  			<output message="tns:echoStructArrayResponse"/>
  		</operation>
  		<operation name="echoVoid">
  			<input message="tns:echoVoidRequest"/>
  			<output message="tns:echoVoidResponse"/>
  		</operation>
  		<operation name="echoBase64" parameterOrder="inputBase64">
  			<input message="tns:echoBase64Request"/>
  			<output message="tns:echoBase64Response"/>
  		</operation>
  		<operation name="echoDate" parameterOrder="inputDate">
  			<input message="tns:echoDateRequest"/>
  			<output message="tns:echoDateResponse"/>
  		</operation>
  		<operation name="echoHexBinary" parameterOrder="inputHexBinary">
  			<input message="tns:echoHexBinaryRequest"/>
  			<output message="tns:echoHexBinaryResponse"/>
  		</operation>
  		<operation name="echoDecimal" parameterOrder="inputDecimal">
  			<input message="tns:echoDecimalRequest"/>
  			<output message="tns:echoDecimalResponse"/>
  		</operation>
  		<operation name="echoBoolean" parameterOrder="inputBoolean">
  			<input message="tns:echoBooleanRequest"/>
  			<output message="tns:echoBooleanResponse"/>
  		</operation>
  	</portType>
  
  	<binding name="InteropTestSoapBinding" type="tns:InteropTestPortType">
  		<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  		<operation name="echoString">
  			<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="echoStringArray">
  			<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="echoInteger">
  			<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="echoIntegerArray">
  			<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="echoFloat">
  			<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="echoFloatArray">
  			<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="echoStruct">
  			<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="echoStructArray">
  			<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="echoVoid">
  			<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="echoBase64">
  			<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="echoDate">
  			<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="echoHexBinary">
  			<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="echoDecimal">
  			<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="echoBoolean">
  			<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/serviceinteropbase/InteropTest.cpp
  
  Index: InteropTest.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 apache@apache.org.
   *
   * 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 (skumara@virtusa.com)
   *
   */
  
  // 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 "BaseTestsWrapper.h"
  
  extern "C" {
  //the two export functions//////////////////////////////////////////// 
  
  STORAGE_CLASS_INFO
  int GetClassInstance(BasicHandler **inst)
  {
  	WrapperClassHandler* pWCH = new BaseTestsWrapper();
  	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/serviceinteropbase/BaseTestsWrapper.h
  
  Index: BaseTestsWrapper.h
  ===================================================================
  // BaseTestsWrapper.h: interface for the BaseTestsWrapper class.
  //
  //////////////////////////////////////////////////////////////////////
  
  #if !defined(AFX_BASETESTSWRAPPER_H__AF54F4D1_C133_461C_BFCF_87D4056009FC__INCLUDED_)
  #define AFX_BASETESTSWRAPPER_H__AF54F4D1_C133_461C_BFCF_87D4056009FC__INCLUDED_
  
  #if _MSC_VER > 1000
  #pragma once
  #endif // _MSC_VER > 1000
  
  #include "../libinteropbase/BaseTests.h"
  #include "../../../common/WrapperClassHandler.h"
  #include "../../../common/MessageData.h"
  #include "../../../common/GDefine.h"
  #include "../../../common/AccessBean.h"
  
  class BaseTestsWrapper : public WrapperClassHandler  
  {
  public:
  	BaseTestsWrapper();
  	virtual ~BaseTestsWrapper();
  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:
  	BaseTests *pWs; // Actual web service object.
  };
  
  #endif // !defined(AFX_BASETESTSWRAPPER_H__AF54F4D1_C133_461C_BFCF_87D4056009FC__INCLUDED_)
  
  
  
  1.1                  xml-axis/c/src/server/samples/serviceinteropbase/BaseTestsWrapper.cpp
  
  Index: BaseTestsWrapper.cpp
  ===================================================================
  // BaseTestsWrapper.cpp: implementation of the BaseTestsWrapper class.
  //
  //////////////////////////////////////////////////////////////////////
  
  #include "BaseTestsWrapper.h"
  #include "../../../soap/SoapDeSerializer.h"
  #include "../../../soap/SoapSerializer.h"
  #include "../../../common/BasicTypeSerializer.h"
  
  //////////////////////////////////////////////////////////////////////
  // Construction/Destruction
  //////////////////////////////////////////////////////////////////////
  
  BaseTestsWrapper::BaseTestsWrapper()
  {
  
  }
  
  BaseTestsWrapper::~BaseTestsWrapper()
  {
  
  }
  
  // Implementation of WrapperClassHandler interface.
  int BaseTestsWrapper::Invoke(MessageData* mc)
  {
  	string method = mc->m_pDZ->GetMethodName();
  	return FAIL;
  }
  int BaseTestsWrapper::Init()
  {
  	//Do any Initialization here
  	return 0;
  }
  int BaseTestsWrapper::Fini()
  {
  	//Do any finalization here
  	return 0;
  }
  
  int BaseTestsWrapper::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 BaseTestsWrapper::OnFault(MessageData* mc)
  {
  }
  
  // Methods that wraps actual web methods
  
  
  

Mime
View raw message