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 aj...@apache.org on 2005/02/11 05:13:30 UTC
svn commit: r153343 - in
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2:
./ bench.wsdl build.xml src/ src/META-INF/ src/META-INF/service.xml
src/benchmark1/ src/benchmark1/BenchProvider.java
src/benchmark1/Benchmark1Impl.java src/benchmark1/Benchmark1PortType.java
Author: ajith
Date: Thu Feb 10 20:13:27 2005
New Revision: 153343
URL: http://svn.apache.org/viewcvs?view=rev&rev=153343
Log:
Added the new sample for the SOAP bench mark testing
Added:
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/bench.wsdl
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/build.xml
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/META-INF/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/META-INF/service.xml
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/BenchProvider.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1Impl.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1PortType.java
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/bench.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/bench.wsdl?view=auto&rev=153343
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/bench.wsdl (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/bench.wsdl Thu Feb 10 20:13:27 2005
@@ -0,0 +1,428 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="urn:soap-bench" xmlns:impl="urn:soap-bench" xmlns:intf="urn:soap-bench" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+<!--WSDL created by Apache Axis version: 1.2RC1
+Built on Sep 29, 2004 (08:29:40 EDT)-->
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:soap-bench">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="ArrayOf_xsd_string">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOf_xsd_int">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="ArrayOf_xsd_double">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:double[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="receiveDoublesResponse">
+
+ <wsdl:part name="receiveDoublesReturn" type="xsd:int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="sendStringsResponse">
+
+ <wsdl:part name="sendStringsReturn" type="impl:ArrayOf_xsd_string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="sendIntsResponse">
+
+ <wsdl:part name="sendIntsReturn" type="impl:ArrayOf_xsd_int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoDoublesRequest">
+
+ <wsdl:part name="in0" type="impl:ArrayOf_xsd_double"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoDoublesResponse">
+
+ <wsdl:part name="echoDoublesReturn" type="impl:ArrayOf_xsd_double"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="receiveDoublesRequest">
+
+ <wsdl:part name="in0" type="impl:ArrayOf_xsd_double"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoStringsRequest">
+
+ <wsdl:part name="in0" type="impl:ArrayOf_xsd_string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="sendDoublesResponse">
+
+ <wsdl:part name="sendDoublesReturn" type="impl:ArrayOf_xsd_double"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="receiveIntsResponse">
+
+ <wsdl:part name="receiveIntsReturn" type="xsd:int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="sendIntsRequest">
+
+ <wsdl:part name="in0" type="xsd:int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoVoidResponse">
+
+ </wsdl:message>
+
+ <wsdl:message name="echoIntsRequest">
+
+ <wsdl:part name="in0" type="impl:ArrayOf_xsd_int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="sendStringsRequest">
+
+ <wsdl:part name="in0" type="xsd:int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="receiveIntsRequest">
+
+ <wsdl:part name="in0" type="impl:ArrayOf_xsd_int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="receiveStringsResponse">
+
+ <wsdl:part name="receiveStringsReturn" type="xsd:int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoStringsResponse">
+
+ <wsdl:part name="echoStringsReturn" type="impl:ArrayOf_xsd_string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoIntsResponse">
+
+ <wsdl:part name="echoIntsReturn" type="impl:ArrayOf_xsd_int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="receiveStringsRequest">
+
+ <wsdl:part name="in0" type="impl:ArrayOf_xsd_string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="sendDoublesRequest">
+
+ <wsdl:part name="in0" type="xsd:int"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoVoidRequest">
+
+ </wsdl:message>
+
+ <wsdl:portType name="Benchmark1PortType">
+
+ <wsdl:operation name="echoVoid">
+
+ <wsdl:input name="echoVoidRequest" message="impl:echoVoidRequest"/>
+
+ <wsdl:output name="echoVoidResponse" message="impl:echoVoidResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoStrings" parameterOrder="in0">
+
+ <wsdl:input name="echoStringsRequest" message="impl:echoStringsRequest"/>
+
+ <wsdl:output name="echoStringsResponse" message="impl:echoStringsResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoInts" parameterOrder="in0">
+
+ <wsdl:input name="echoIntsRequest" message="impl:echoIntsRequest"/>
+
+ <wsdl:output name="echoIntsResponse" message="impl:echoIntsResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoDoubles" parameterOrder="in0">
+
+ <wsdl:input name="echoDoublesRequest" message="impl:echoDoublesRequest"/>
+
+ <wsdl:output name="echoDoublesResponse" message="impl:echoDoublesResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="receiveStrings" parameterOrder="in0">
+
+ <wsdl:input name="receiveStringsRequest" message="impl:receiveStringsRequest"/>
+
+ <wsdl:output name="receiveStringsResponse" message="impl:receiveStringsResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="receiveInts" parameterOrder="in0">
+
+ <wsdl:input name="receiveIntsRequest" message="impl:receiveIntsRequest"/>
+
+ <wsdl:output name="receiveIntsResponse" message="impl:receiveIntsResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="receiveDoubles" parameterOrder="in0">
+
+ <wsdl:input name="receiveDoublesRequest" message="impl:receiveDoublesRequest"/>
+
+ <wsdl:output name="receiveDoublesResponse" message="impl:receiveDoublesResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="sendStrings" parameterOrder="in0">
+
+ <wsdl:input name="sendStringsRequest" message="impl:sendStringsRequest"/>
+
+ <wsdl:output name="sendStringsResponse" message="impl:sendStringsResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="sendInts" parameterOrder="in0">
+
+ <wsdl:input name="sendIntsRequest" message="impl:sendIntsRequest"/>
+
+ <wsdl:output name="sendIntsResponse" message="impl:sendIntsResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="sendDoubles" parameterOrder="in0">
+
+ <wsdl:input name="sendDoublesRequest" message="impl:sendDoublesRequest"/>
+
+ <wsdl:output name="sendDoublesResponse" message="impl:sendDoublesResponse"/>
+
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:binding name="soap-benchSoapBinding" type="impl:Benchmark1PortType">
+
+ <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="echoVoid">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoVoidRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoVoidResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoStrings">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoStringsRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoStringsResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoInts">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoIntsRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoIntsResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoDoubles">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoDoublesRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoDoublesResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="receiveStrings">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="receiveStringsRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="receiveStringsResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="receiveInts">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="receiveIntsRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="receiveIntsResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="receiveDoubles">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="receiveDoublesRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="receiveDoublesResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="sendStrings">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="sendStringsRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="sendStringsResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="sendInts">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="sendIntsRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="sendIntsResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="sendDoubles">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="sendDoublesRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="sendDoublesResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:soap-bench"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="Benchmark1PortTypeService">
+
+ <wsdl:port name="soap-bench" binding="impl:soap-benchSoapBinding">
+
+ <wsdlsoap:address location="http://localhost:8080/axis2/services/soap-bench"/>
+
+ </wsdl:port>
+
+ </wsdl:service>
+
+</wsdl:definitions>
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/build.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/build.xml?view=auto&rev=153343
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/build.xml (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/build.xml Thu Feb 10 20:13:27 2005
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<project basedir="." default="jar">
+ <property name="src" location="src"/>
+ <property name="build" location="build"/>
+ <property name="build.classes" location="${build}/classes"/>
+ <property name="build.lib" location="${build}/lib"/>
+ <property name="lib" location="lib"/>
+ <property name="root" location="../../../.."/>
+ <property name="jar.dir" location="${root}/target/test-resources/samples/services"/>
+ <property name="jar.name" value="soap-bench" ></property>
+
+ <path id="axis.test.classpath">
+ <path refid="maven.dependency.classpath"></path>
+ <pathelement location="${root}/target/classes"/>
+ <pathelement location="${root}/target/test-classes"/>
+ </path>
+
+ <target name="compile" depends="init" unless="jars.uptodate">
+ <mkdir dir="${build.classes}"/>
+ <mkdir dir="${build.lib}"/>
+ <javac destdir="${build.classes}" debug="on">
+ <classpath refid="axis.test.classpath" />
+ <src path="${src}"/>
+ </javac>
+ </target>
+
+ <target name="jar" depends="compile" unless="jars.uptodate">
+ <copy todir="${build.classes}/META-INF">
+ <fileset dir="${src}/META-INF/">
+ <include name="**/*.xml"/>
+ <exclude name="build.xml"/>
+ </fileset>
+ </copy>
+
+ <mkdir dir="${jar.dir}"/>
+ <jar jarfile="${jar.dir}/${jar.name}.jar" basedir="${build.classes}" >
+ <include name="**" />
+ </jar>
+ <delete dir="${build}"/>
+ </target>
+
+ <target name="init">
+ <uptodate property="jars.uptodate" targetfile="${jar.dir}/${jar.name}.jar">
+ <srcfiles dir="${src}">
+ <include name="**/*.java"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.wsdl"/>
+ <exclude name="${build}/**"/>
+ </srcfiles>
+ </uptodate>
+ <echo message="the files are up to date = ${jars.uptodate}"></echo>
+ </target>
+
+</project>
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/META-INF/service.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/META-INF/service.xml?view=auto&rev=153343
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/META-INF/service.xml (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/META-INF/service.xml Thu Feb 10 20:13:27 2005
@@ -0,0 +1,13 @@
+<service provider="benchmark1.BenchProvider" style="xsd:anyURI" contextPath="xsd:anycontextPath" >
+ <java:implementation class="benchmark1.Benchmark1Impl" xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
+ <operation name="echoVoid" qname="echoVoid" style="anyStyle" use="anyUse"/>
+ <operation name="echoStrings" qname="echoStrings" style="anyStyle" use="anyUse"/>
+ <operation name="echoInts" qname="echoInts" style="anyStyle" use="anyUse"/>
+ <operation name="echoDoubles" qname="echoDoubles" style="anyStyle" use="anyUse"/>
+ <operation name="receiveStrings" qname="receiveStrings" style="anyStyle" use="anyUse"/>
+ <operation name="receiveInts" qname="receiveInts" style="anyStyle" use="anyUse"/>
+ <operation name="receiveDoubles" qname="receiveDoubles" style="anyStyle" use="anyUse"/>
+ <operation name="sendStrings" qname="sendStrings" style="anyStyle" use="anyUse"/>
+ <operation name="sendInts" qname="sendInts" style="anyStyle" use="anyUse"/>
+ <operation name="sendDoubles" qname="sendDoubles" style="anyStyle" use="anyUse"/>
+</service>
\ No newline at end of file
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/BenchProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/BenchProvider.java?view=auto&rev=153343
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/BenchProvider.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/BenchProvider.java Thu Feb 10 20:13:27 2005
@@ -0,0 +1,168 @@
+package benchmark1;
+
+import org.apache.axis.testUtils.*;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.description.AxisOperation;
+import org.apache.axis.om.*;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamConstants;
+import java.lang.reflect.Method;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Ajith
+ * Date: Feb 10, 2005
+ * Time: 3:10:05 PM
+ */
+public class BenchProvider extends SimpleJavaProvider {
+
+ public Object[] deserializeParameters(
+ MessageContext msgContext,
+ Method method)
+ throws AxisFault {
+ // org.TimeRecorder.BEFORE_DESERALIZE = System.currentTimeMillis();
+ XMLStreamReader xpp =
+ msgContext.getSoapOperationElement().getPullParser(true);
+ Class[] parms = method.getParameterTypes();
+ Object[] objs = new Object[parms.length];
+
+ try {
+ int event = xpp.next();
+ while (XMLStreamConstants.START_ELEMENT != event
+ && XMLStreamConstants.END_ELEMENT != event) {
+ event = xpp.next();
+ }
+ //now we are at the opearion element event
+ event = xpp.next();
+ while (XMLStreamConstants.START_ELEMENT != event
+ && XMLStreamConstants.END_ELEMENT != event) {
+ event = xpp.next();
+ }
+ //now we are at the parameter element event
+
+ if (XMLStreamConstants.END_ELEMENT == event) {
+ return null;
+ } else {
+ for (int i = 0; i < parms.length; i++) {
+ if (int.class.equals(parms[i])) {
+ objs[i] =
+ new Integer(
+ SimpleTypeEncodingUtils.deserializeInt(xpp));
+ } else if (String.class.equals(parms[i])) {
+ objs[i] = SimpleTypeEncodingUtils.deserializeString(xpp);
+ } else if (String[].class.equals(parms[i])) {
+ objs[i] = SimpleTypeEncodingUtils.deserializeStringArray(xpp);
+ } else if (double.class.equals(parms[i])) {
+ objs[i] =new Double(SimpleTypeEncodingUtils.deserializeDouble(xpp));
+ } else if (double[].class.equals(parms[i])) {
+ objs[i] = SimpleTypeEncodingUtils.deserializeDoubleArray(xpp);
+ } else if (int[].class.equals(parms[i])) {
+ objs[i] = SimpleTypeEncodingUtils.deserializeIntArray(xpp);
+ } else {
+ throw new UnsupportedOperationException("Only int,String and String[] is supported yet");
+ }
+ }
+ return objs;
+
+ }
+ } catch (Exception e) {
+ throw new AxisFault("Exception",e);
+ }
+ }
+
+ public MessageContext invoke(MessageContext msgContext) throws AxisFault {
+ try {
+ //get the implementation class for the Web Service
+ Object obj = getTheImplementationObject(msgContext);
+
+ //find the WebService method
+ Class ImplClass = obj.getClass();
+ AxisOperation op = msgContext.getOperation();
+ String methodName = op.getName().getLocalPart();
+
+
+ Method[] methods = ImplClass.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ if (methods[i].getName().equals(methodName)) {
+ this.method = methods[i];
+ break;
+ }
+ }
+ //deserialize (XML-> java)
+ Object[] parms = deserializeParameters(msgContext, method);
+ //invoke the WebService
+
+ Benchmark1PortType benchmark = (Benchmark1PortType)obj;
+ Object result = null;
+ if("echoVoid".equals(methodName)) {
+ result = "";//benchmark.echoVoid();
+ }else if ("echoStrings".equals(methodName)) {
+ result = benchmark.echoStrings((String[])parms[0]);
+ }else if ("echoInts".equals(methodName)) {
+ result = benchmark.echoInts((int[])parms[0]);
+ }else if ("echoDoubles".equals(methodName)) {
+ result = benchmark.echoDoubles((double[])parms[0]);
+ }else if ("receiveStrings".equals(methodName)) {
+ result = new Integer(benchmark.receiveStrings((String[])parms[0]));
+ } else if ("receiveInts".equals(methodName)) {
+ result = new Integer(benchmark.receiveInts((int[])parms[0]));
+ } else if ("receiveDoubles".equals(methodName)) {
+ result = new Integer(benchmark.receiveDoubles((double[])parms[0]));
+ } else if ("sendStrings".equals(methodName)) {
+ result = benchmark.sendStrings(((Integer)parms[0]).intValue());
+ } else if ("sendInts".equals(methodName)) {
+ result = benchmark.sendInts(((Integer)parms[0]).intValue());
+ }else if ("sendDoubles".equals(methodName)) {
+ result = benchmark.sendDoubles(((Integer)parms[0]).intValue());
+ }
+
+ Encoder outobj = null;
+
+ Class clazz = result.getClass();
+ if (clazz == String.class ||
+ clazz == String[].class ||
+ clazz == int.class ||
+ clazz == Integer.class ||
+ clazz == int[].class ||
+ clazz == double.class ||
+ clazz == Double.class ||
+ clazz == double[].class ) {
+ outobj = new SimpleTypeEncoder(result);
+ }
+
+ OMFactory fac = OMFactory.newInstance();
+ SOAPEnvelope responseEnvelope = fac.getDefaultEnvelope();
+
+ OMNamespace ns = fac.createOMNamespace("http://soapenc/", "res");
+ OMElement responseMethodName =
+ fac.createOMElement(methodName + "Response", ns);
+ responseEnvelope.getBody().addChild(responseMethodName);
+ OMElement returnelement =
+ fac.createOMElement(methodName + "Return", ns);
+ responseMethodName.addChild(returnelement);
+ returnelement.setBuilder(
+ new ObjectToOMBuilder(returnelement, outobj));
+ returnelement.declareNamespace(
+ OMConstants.ARRAY_ITEM_NSURI,
+ "arrays");
+ returnelement.declareNamespace(
+ "http://axis.apache.org",
+ "s");
+
+ msgContext.setEnvelope(responseEnvelope);
+
+ return msgContext;
+
+ } catch (SecurityException e) {
+ throw AxisFault.makeFault(e);
+ } catch (IllegalArgumentException e) {
+ throw AxisFault.makeFault(e);
+ } catch (java.rmi.RemoteException e) {
+ throw AxisFault.makeFault(e);
+ }
+ }
+}
+
+
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1Impl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1Impl.java?view=auto&rev=153343
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1Impl.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1Impl.java Thu Feb 10 20:13:27 2005
@@ -0,0 +1,83 @@
+/**
+ * Benchmark1Impl.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis 1.2beta Apr 25, 2004 (11:37:32 EST) WSDL2Java emitter.
+ */
+
+package benchmark1;
+
+public class Benchmark1Impl implements benchmark1.Benchmark1PortType{
+ public void echoVoid() throws java.rmi.RemoteException {
+ }
+
+// public byte[] echoBase64(byte[] input) throws java.rmi.RemoteException {
+// return input;
+// }
+
+ public java.lang.String[] echoStrings(java.lang.String[] input) throws java.rmi.RemoteException {
+ return input;
+ }
+
+ public int[] echoInts(int[] input) throws java.rmi.RemoteException {
+ return input;
+ }
+
+ public double[] echoDoubles(double[] input) throws java.rmi.RemoteException {
+ return input;
+ }
+
+
+// public int receiveBase64(byte[] input) throws java.rmi.RemoteException {
+// return input.length;
+// }
+
+ public int receiveStrings(String[] input) throws java.rmi.RemoteException {
+ return input.length;
+ }
+
+ public int receiveInts(int[] input) throws java.rmi.RemoteException {
+ return input.length;
+ }
+
+ public int receiveDoubles(double[] input) throws java.rmi.RemoteException {
+ return input.length;
+ }
+
+// public byte[] sendBase64(int n) throws java.rmi.RemoteException {
+// byte[] output = new byte[n];
+// for (int i = 0; i < n; i++)
+// {
+// output[i] = (byte) i;
+// }
+// return output;
+// }
+
+ public String[] sendStrings(int n) throws java.rmi.RemoteException {
+ String[] output = new String[n];
+ for (int i = 0; i < n; i++)
+ {
+ output[i] = "s"+i;
+ }
+ return output;
+ }
+
+ public int[] sendInts(int n) throws java.rmi.RemoteException {
+ int[] output = new int[n];
+ for (int i = 0; i < n; i++)
+ {
+ output[i] = (int) i;
+ }
+ return output;
+ }
+
+ public double[] sendDoubles(int n) throws java.rmi.RemoteException {
+ double[] output = new double[n];
+ for (int i = 0; i < n; i++)
+ {
+ output[i] = (double) i;
+ }
+ return output;
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1PortType.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1PortType.java?view=auto&rev=153343
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1PortType.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample2/src/benchmark1/Benchmark1PortType.java Thu Feb 10 20:13:27 2005
@@ -0,0 +1,76 @@
+/**
+ * Benchmark1PortType.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis 1.2beta May 11, 2004 (03:05:50 EST) WSDL2Java emitter.
+ */
+
+package benchmark1;
+
+public interface Benchmark1PortType extends java.rmi.Remote {
+
+ /**
+ * pings the server
+ */
+ public void echoVoid() throws java.rmi.RemoteException;
+
+ /**
+ * echos base64 content
+ */
+ //public byte[] echoBase64(byte[] input) throws java.rmi.RemoteException;
+
+ /**
+ * echos string arrays
+ */
+ public java.lang.String[] echoStrings(java.lang.String[] input) throws java.rmi.RemoteException;
+
+ /**
+ * echos int arrays
+ */
+ public int[] echoInts(int[] input) throws java.rmi.RemoteException;
+
+ /**
+ * echos double arrays
+ */
+ public double[] echoDoubles(double[] input) throws java.rmi.RemoteException;
+
+ /**
+ * receives base64 content
+ */
+ //public int receiveBase64(byte[] input) throws java.rmi.RemoteException;
+
+ /**
+ * receives strings
+ */
+ public int receiveStrings(java.lang.String[] input) throws java.rmi.RemoteException;
+
+ /**
+ * receives ints
+ */
+ public int receiveInts(int[] input) throws java.rmi.RemoteException;
+
+ /**
+ * receives doubles
+ */
+ public int receiveDoubles(double[] input) throws java.rmi.RemoteException;
+
+ /**
+ * sends base64 content
+ */
+ //public byte[] sendBase64(int size) throws java.rmi.RemoteException;
+
+ /**
+ * sends strings
+ */
+ public java.lang.String[] sendStrings(int size) throws java.rmi.RemoteException;
+
+ /**
+ * sends ints
+ */
+ public int[] sendInts(int size) throws java.rmi.RemoteException;
+
+ /**
+ * sends doubles
+ */
+ public double[] sendDoubles(int size) throws java.rmi.RemoteException;
+}