rubys 01/07/03 19:08:42 Modified: java/samples/interop DeploymentDescriptor.xml EchoTestClient.java EchoTestService.java Log: Add void, base64, and date tests Revision Changes Path 1.3 +8 -1 xml-soap/java/samples/interop/DeploymentDescriptor.xml Index: DeploymentDescriptor.xml =================================================================== RCS file: /home/cvs/xml-soap/java/samples/interop/DeploymentDescriptor.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DeploymentDescriptor.xml 2001/05/30 20:08:00 1.2 +++ DeploymentDescriptor.xml 2001/07/04 02:08:38 1.3 @@ -3,7 +3,7 @@ checkMustUnderstands="true"> <isd:provider type="java" scope="Application" - methods="nop echoInteger echoString echoFloat echoStruct echoIntegerArray echoFloatArray echoStringArray echoStructArray"> + methods="nop echoInteger echoString echoFloat echoStruct echoIntegerArray echoFloatArray echoStringArray echoStructArray echoVoid echoBase64 echoDate"> <isd:java class="samples.interop.EchoTestService" static="false"/> </isd:provider> @@ -40,5 +40,12 @@ javaType="samples.interop.Data" java2XMLClassName="samples.interop.DataSerializer" xml2JavaClassName="samples.interop.DataSerializer"/> + + <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:x="" qname="x:inputBase64" + xml2JavaClassName="org.apache.soap.encoding.soapenc.Base64Deserializer"/> + <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:x="" qname="x:inputDate" + xml2JavaClassName="org.apache.soap.encoding.soapenc.DateDeserializer"/> </isd:mappings> </isd:service> 1.3 +18 -3 xml-soap/java/samples/interop/EchoTestClient.java Index: EchoTestClient.java =================================================================== RCS file: /home/cvs/xml-soap/java/samples/interop/EchoTestClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EchoTestClient.java 2001/06/28 21:16:37 1.2 +++ EchoTestClient.java 2001/07/04 02:08:39 1.3 @@ -67,6 +67,7 @@ import org.w3c.dom.*; import org.apache.soap.util.*; import java.lang.reflect.*; +import java.util.Date; /** A quick-and-dirty client for the Interop echo test services as defined * at http://www.xmethods.net/ilab. @@ -125,6 +126,8 @@ StringDeserializer stringDser = new StringDeserializer(); ArraySerializer arraySer = new ArraySerializer(); DataSerializer dataSer = new DataSerializer(); + DateSerializer dateSer = new DateSerializer(); + Base64Serializer base64Ser = new Base64Serializer(); smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(OBJECT_URI, "SOAPStruct"), Data.class, dataSer, dataSer); Integer i = new Integer(5); @@ -179,6 +182,17 @@ new Data(1, "un", (float)1.1)}, null); smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null, arraySer); doCall(url, "echoStructArray", p); + + doCall(url, "echoVoid", null); + + p = new Parameter("inputBase64", Byte[].class, "ciao".getBytes(), null); + smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null, base64Ser); + doCall(url, "echoBase64", p); + + p = new Parameter("inputDate", Date[].class, new Date(), null); + smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null, dateSer); + doCall(url, "echoDate", p); + } public void doCall(URL url, String methodName, Parameter param) @@ -186,7 +200,8 @@ try { Call call = new Call(); Vector params = new Vector(); - params.addElement(param); + if (param != null) + params.addElement(param); call.setSOAPMappingRegistry(smr); call.setTargetObjectURI(ACTION_URI); call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); @@ -205,8 +220,8 @@ // check response if (!resp.generatedFault()) { Parameter ret = resp.getReturnValue(); - Object output = ret.getValue(); - Object input = param.getValue(); + Object output = (ret==null) ? null : ret.getValue(); + Object input = (param==null) ? null : param.getValue(); if (equals(input,output)) { System.out.println(methodName + "\t OK"); 1.2 +16 -0 xml-soap/java/samples/interop/EchoTestService.java Index: EchoTestService.java =================================================================== RCS file: /home/cvs/xml-soap/java/samples/interop/EchoTestService.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- EchoTestService.java 2001/05/11 19:06:34 1.1 +++ EchoTestService.java 2001/07/04 02:08:39 1.2 @@ -55,6 +55,8 @@ package samples.interop; +import java.util.Date; + /** An implementation of the interop echo service as defined at * http://www.xmethods.net/ilab. * @@ -104,5 +106,19 @@ public Data [] echoStructArray(Data [] ds) { return ds; + } + + public void echoVoid() + { + } + + public byte[] echoBase64(byte[] b64) + { + return b64; + } + + public Date echoDate(Date d) + { + return d; } }