Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 32339 invoked from network); 11 Feb 2005 04:13:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Feb 2005 04:13:34 -0000 Received: (qmail 14961 invoked by uid 500); 11 Feb 2005 04:13:33 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 14877 invoked by uid 500); 11 Feb 2005 04:13:32 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 14864 invoked by uid 99); 11 Feb 2005 04:13:32 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 10 Feb 2005 20:13:31 -0800 Received: (qmail 32324 invoked by uid 65534); 11 Feb 2005 04:13:30 -0000 Message-ID: <20050211041330.32323.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Fri, 11 Feb 2005 04:13:30 -0000 Subject: 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 To: axis-cvs@ws.apache.org From: ajith@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: ajith Date: Thu Feb 10 20:13:27 2005 New Revision: 153343 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D153343 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/encod= ing/sample2/bench.wsdl URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/samples/encoding/sample2/bench.wsdl?view=3Dauto&rev=3D153343 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encod= ing/sample2/build.xml URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/samples/encoding/sample2/build.xml?view=3Dauto&rev=3D153343 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ + + + + + + + + + + + + + + + + +=09 + + + + + + + + +=09 + + + + + + + + + + + + + + +=09 + + + + + + + + + + + +=09 + Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encod= ing/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=3Daut= o&rev=3D153343 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ + + + + + + + + + + + + + \ No newline at end of file Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encod= ing/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?v= iew=3Dauto&rev=3D153343 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 =3D System.currentTimeMillis= (); + XMLStreamReader xpp =3D + msgContext.getSoapOperationElement().getPullParser(true); + Class[] parms =3D method.getParameterTypes(); + Object[] objs =3D new Object[parms.length]; + + try { + int event =3D xpp.next(); + while (XMLStreamConstants.START_ELEMENT !=3D event + && XMLStreamConstants.END_ELEMENT !=3D event) { + event =3D xpp.next(); + } + //now we are at the opearion element event + event =3D xpp.next(); + while (XMLStreamConstants.START_ELEMENT !=3D event + && XMLStreamConstants.END_ELEMENT !=3D event) { + event =3D xpp.next(); + } + //now we are at the parameter element event + + if (XMLStreamConstants.END_ELEMENT =3D=3D event) { + return null; + } else { + for (int i =3D 0; i < parms.length; i++) { + if (int.class.equals(parms[i])) { + objs[i] =3D + new Integer( + SimpleTypeEncodingUtils.deserializeInt(xpp)); + } else if (String.class.equals(parms[i])) { + objs[i] =3D SimpleTypeEncodingUtils.deserializeString(xpp); + } else if (String[].class.equals(parms[i])) { + objs[i] =3D SimpleTypeEncodingUtils.deserializeStringArray(xpp); + } else if (double.class.equals(parms[i])) { + objs[i] =3Dnew Double(SimpleTypeEncodingUtils.deserializeDouble(xpp)= ); + } else if (double[].class.equals(parms[i])) { + objs[i] =3D SimpleTypeEncodingUtils.deserializeDoubl= eArray(xpp); + } else if (int[].class.equals(parms[i])) { + objs[i] =3D SimpleTypeEncodingUtils.deserializeIntAr= ray(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 =3D getTheImplementationObject(msgContext); + + //find the WebService method + Class ImplClass =3D obj.getClass(); + AxisOperation op =3D msgContext.getOperation(); + String methodName =3D op.getName().getLocalPart(); + + + Method[] methods =3D ImplClass.getMethods(); + for (int i =3D 0; i < methods.length; i++) { + if (methods[i].getName().equals(methodName)) { + this.method =3D methods[i]; + break; + } + } + //deserialize (XML-> java) + Object[] parms =3D deserializeParameters(msgContext, method); + //invoke the WebService + + Benchmark1PortType benchmark =3D (Benchmark1PortType)obj; + Object result =3D null; + if("echoVoid".equals(methodName)) { + result =3D "";//benchmark.echoVoid(); + }else if ("echoStrings".equals(methodName)) { + result =3D benchmark.echoStrings((String[])parms[0]); + }else if ("echoInts".equals(methodName)) { + result =3D benchmark.echoInts((int[])parms[0]); + }else if ("echoDoubles".equals(methodName)) { + result =3D benchmark.echoDoubles((double[])parms[0]); + }else if ("receiveStrings".equals(methodName)) { + result =3D new Integer(benchmark.receiveStrings((String[])parms[0])); + } else if ("receiveInts".equals(methodName)) { + result =3D new Integer(benchmark.receiveInts((int[])parms[0])); + } else if ("receiveDoubles".equals(methodName)) { + result =3D new Integer(benchmark.receiveDoubles((double[])parms[0])); + } else if ("sendStrings".equals(methodName)) { + result =3D benchmark.sendStrings(((Integer)parms[0]).intValue()); + } else if ("sendInts".equals(methodName)) { + result =3D benchmark.sendInts(((Integer)parms[0]).intValue()); + }else if ("sendDoubles".equals(methodName)) { + result =3D benchmark.sendDoubles(((Integer)parms[0]).intValue()); + } + + Encoder outobj =3D null; + + Class clazz =3D result.getClass(); + if (clazz =3D=3D String.class || + clazz =3D=3D String[].class || + clazz =3D=3D int.class || + clazz =3D=3D Integer.class || + clazz =3D=3D int[].class || + clazz =3D=3D double.class || + clazz =3D=3D Double.class || + clazz =3D=3D double[].class ) { + outobj =3D new SimpleTypeEncoder(result); + } + + OMFactory fac =3D OMFactory.newInstance(); + SOAPEnvelope responseEnvelope =3D fac.getDefaultEnvelope(); + + OMNamespace ns =3D fac.createOMNamespace("http://soapenc/", "res"); + OMElement responseMethodName =3D + fac.createOMElement(methodName + "Response", ns); + responseEnvelope.getBody().addChild(responseMethodName); + OMElement returnelement =3D + 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/encod= ing/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=3Dauto&rev=3D153343 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 emitte= r=2E + */ + +package benchmark1; + +public class Benchmark1Impl implements benchmark1.Benchmark1PortType{ + public void echoVoid() throws java.rmi.RemoteException { + } + +// public byte[] echoBase64(byte[] input) throws java.rmi.RemoteExcepti= on { +// 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.RemoteExce= ption { + return input; + } + + +// public int receiveBase64(byte[] input) throws java.rmi.RemoteExcepti= on { +// return input.length; +// } + + public int receiveStrings(String[] input) throws java.rmi.RemoteExcept= ion { + return input.length; + } + + public int receiveInts(int[] input) throws java.rmi.RemoteException { + return input.length; + } + + public int receiveDoubles(double[] input) throws java.rmi.RemoteExcept= ion { + return input.length; + } + +// public byte[] sendBase64(int n) throws java.rmi.RemoteException { +// byte[] output =3D new byte[n]; +// for (int i =3D 0; i < n; i++) +// { +// output[i] =3D (byte) i; +// } +// return output; +// } + + public String[] sendStrings(int n) throws java.rmi.RemoteException { + String[] output =3D new String[n]; + for (int i =3D 0; i < n; i++) + { + output[i] =3D "s"+i; + } + return output; + } + + public int[] sendInts(int n) throws java.rmi.RemoteException { + int[] output =3D new int[n]; + for (int i =3D 0; i < n; i++) + { + output[i] =3D (int) i; + } + return output; + } + + public double[] sendDoubles(int n) throws java.rmi.RemoteException { + double[] output =3D new double[n]; + for (int i =3D 0; i < n; i++) + { + output[i] =3D (double) i; + } + return output; + } + +} Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encod= ing/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.j= ava?view=3Dauto&rev=3D153343 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 emitte= r=2E + */ + +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.RemoteExcepti= on; + + /** + * 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.RemoteExce= ption; + + /** + * receives base64 content + */ + //public int receiveBase64(byte[] input) throws java.rmi.RemoteExcepti= on; + + /** + * receives strings + */ + public int receiveStrings(java.lang.String[] input) throws java.rmi.Re= moteException; + + /** + * receives ints + */ + public int receiveInts(int[] input) throws java.rmi.RemoteException; + + /** + * receives doubles + */ + public int receiveDoubles(double[] input) throws java.rmi.RemoteExcept= ion; + + /** + * sends base64 content + */ + //public byte[] sendBase64(int size) throws java.rmi.RemoteException; + + /** + * sends strings + */ + public java.lang.String[] sendStrings(int size) throws java.rmi.Remote= Exception; + + /** + * sends ints + */ + public int[] sendInts(int size) throws java.rmi.RemoteException; + + /** + * sends doubles + */ + public double[] sendDoubles(int size) throws java.rmi.RemoteException; +}