butek 02/04/01 06:42:18 Modified: java/samples/echo EchoService.java EchoServiceBindingStub.java EchoServicePortType.java TestClient.java Log: Oops! When I changed the mapping of xsd:dateTime from java.util.Date to java.util.Calendar, I left the echo sample with the Date type rather than change it to the Calendar type. This broke interoperability. Revision Changes Path 1.23 +2 -2 xml-axis/java/samples/echo/EchoService.java Index: EchoService.java =================================================================== RCS file: /home/cvs/xml-axis/java/samples/echo/EchoService.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- EchoService.java 29 Mar 2002 15:05:21 -0000 1.22 +++ EchoService.java 1 Apr 2002 14:42:18 -0000 1.23 @@ -58,7 +58,7 @@ import org.apache.axis.encoding.Hex; import java.math.BigDecimal; -import java.util.Date; +import java.util.Calendar; import java.util.HashMap; /** @@ -158,7 +158,7 @@ /** * This method accepts a Date/Time and echoes it back to the client. */ - public Date echoDate(Date input) { + public Calendar echoDate(Calendar input) { return input; } 1.8 +4 -4 xml-axis/java/samples/echo/EchoServiceBindingStub.java Index: EchoServiceBindingStub.java =================================================================== RCS file: /home/cvs/xml-axis/java/samples/echo/EchoServiceBindingStub.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- EchoServiceBindingStub.java 31 Mar 2002 23:09:33 -0000 1.7 +++ EchoServiceBindingStub.java 1 Apr 2002 14:42:18 -0000 1.8 @@ -431,13 +431,13 @@ } } - public java.util.Date echoDate(java.util.Date input) throws java.rmi.RemoteException{ + public java.util.Calendar echoDate(java.util.Calendar input) throws java.rmi.RemoteException{ if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call call = getCall(); - call.addParameter("inputDate", new javax.xml.rpc.namespace.QName("http://www.w3.org/2001/XMLSchema", "date"), javax.xml.rpc.ParameterMode.IN); - call.setReturnType(new javax.xml.rpc.namespace.QName("http://www.w3.org/2001/XMLSchema", "date")); + call.addParameter("inputDate", new javax.xml.rpc.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime"), javax.xml.rpc.ParameterMode.IN); + call.setReturnType(new javax.xml.rpc.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); call.setUseSOAPAction(true); String methodName = (addMethodToAction) ? "echoDate" : ""; call.setSOAPActionURI(soapAction+methodName); @@ -451,7 +451,7 @@ throw (java.rmi.RemoteException)resp; } else { - return (java.util.Date) resp; + return (java.util.Calendar) resp; } } 1.2 +1 -1 xml-axis/java/samples/echo/EchoServicePortType.java Index: EchoServicePortType.java =================================================================== RCS file: /home/cvs/xml-axis/java/samples/echo/EchoServicePortType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- EchoServicePortType.java 15 Feb 2002 19:41:57 -0000 1.1 +++ EchoServicePortType.java 1 Apr 2002 14:42:18 -0000 1.2 @@ -19,7 +19,7 @@ public void echoVoid() throws java.rmi.RemoteException; public byte[] echoBase64(byte[] input) throws java.rmi.RemoteException; public byte[] echoHexBinary(byte[] input) throws java.rmi.RemoteException; - public java.util.Date echoDate(java.util.Date input) throws java.rmi.RemoteException; + public java.util.Calendar echoDate(java.util.Calendar input) throws java.rmi.RemoteException; public java.math.BigDecimal echoDecimal(java.math.BigDecimal input) throws java.rmi.RemoteException; public boolean echoBoolean(boolean input) throws java.rmi.RemoteException; public java.util.Map echoMap(java.util.Map input) throws java.rmi.RemoteException; 1.60 +7 -6 xml-axis/java/samples/echo/TestClient.java Index: TestClient.java =================================================================== RCS file: /home/cvs/xml-axis/java/samples/echo/TestClient.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- TestClient.java 31 Mar 2002 23:09:33 -0000 1.59 +++ TestClient.java 1 Apr 2002 14:42:18 -0000 1.60 @@ -125,9 +125,11 @@ obj2 = ((Hex) obj2).getBytes(); } - if (obj1 instanceof Date && obj2 instanceof Date) - if (Math.abs(((Date)obj1).getTime()-((Date)obj2).getTime())<1000) + if (obj1 instanceof Calendar && obj2 instanceof Calendar) { + if (Math.abs(((Calendar)obj1).getTime().getTime() - ((Calendar)obj2).getTime().getTime()) < 1000) { return true; + } + } if ((obj1 instanceof Map) && (obj2 instanceof Map)) { Map map1 = (Map)obj1; @@ -353,12 +355,11 @@ } } } - Date inputDate = null; + Calendar inputDate = Calendar.getInstance(); + inputDate.setTimeZone(TimeZone.getTimeZone("GMT")); + inputDate.setTime(new Date()); { try { - SimpleDateFormat zulu = new SimpleDateFormat("yyyy-MM-dd"); - zulu.setTimeZone(TimeZone.getTimeZone("GMT")); - inputDate = zulu.parse(zulu.format(new Date())); output = binding.echoDate(inputDate); verify("echoDate", inputDate, output); } catch (Exception e) {