rubys 01/07/09 08:48:09
Modified: java/samples/interop EchoTestClient.java
Log:
Conform to the provided WSDL, and be tolerant of dates rounded or
truncated to the nearest second.
Revision Changes Path
1.7 +17 -13 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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- EchoTestClient.java 2001/07/08 17:39:20 1.6
+++ EchoTestClient.java 2001/07/09 15:48:07 1.7
@@ -81,6 +81,7 @@
* DOES NOT SUPPORT DIFFERENT SOAPACTION URIS YET.
*
* @author Glen Daniels ([EMAIL PROTECTED])
+ * @author Sam Ruby ([EMAIL PROTECTED])
*/
public class EchoTestClient
{
@@ -112,6 +113,9 @@
private static boolean equals(Object obj1, Object obj2) {
if ((obj1==null) || (obj2==null)) return (obj1==obj2);
if (obj1.equals(obj2)) return true;
+ if (obj1 instanceof Date && obj2 instanceof Date)
+ if (Math.abs(((Date)obj1).getTime()-((Date)obj2).getTime())<1000)
+ return true;
if (!obj2.getClass().isArray()) return false;
if (!obj1.getClass().isArray()) return false;
if (Array.getLength(obj1) != Array.getLength(obj2)) return false;
@@ -135,19 +139,19 @@
Integer i = new Integer(5);
Parameter p = new Parameter("inputInteger", Integer.class, i, null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
intDser);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
intDser);
doCall(url, "echoInteger", p);
p = new Parameter("inputFloat", Float.class, new Float(55.5), null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
floatDser);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
floatDser);
doCall(url, "echoFloat", p);
p = new Parameter("inputString", String.class, "Hi there!", null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
stringDser);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
stringDser);
doCall(url, "echoString", p);
p = new Parameter("inputStruct", Data.class, new Data(5, "Hola, baby",
(float)10.0), null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
dataSer);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
dataSer);
doCall(url, "echoStruct", p);
p = new Parameter("inputIntegerArray", Integer[].class, new Integer[]{
@@ -156,7 +160,7 @@
new Integer(3),
new Integer(2),
new Integer(1)}, null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
arraySer);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
arraySer);
doCall(url, "echoIntegerArray", p);
p = new Parameter("inputFloatArray", Float[].class, new Float[]{
@@ -165,7 +169,7 @@
new Float(3.3),
new Float(2.2),
new Float(1.1)}, null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
arraySer);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
arraySer);
doCall(url, "echoFloatArray", p);
p = new Parameter("inputStringArray", String[].class, new String[]{
@@ -174,7 +178,7 @@
"Fifth (just kidding :))",
"Fourth",
"Last"}, null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
arraySer);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
arraySer);
doCall(url, "echoStringArray", p);
p = new Parameter("inputStructArray", Data[].class, new Data[]{
@@ -183,25 +187,25 @@
new Data(3, "tres", (float)3.333),
new Data(2, "duet", (float)2.22),
new Data(1, "un", (float)1.1)}, null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
arraySer);
+ 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);
+ 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);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
dateSer);
doCall(url, "echoDate", p);
p = new Parameter("inputDecimal", BigDecimal.class, new BigDecimal("3.14159"),
null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
decimalSer);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
decimalSer);
doCall(url, "echoDecimal", p);
p = new Parameter("inputBoolean", Boolean.class, new Boolean(true), null);
- smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Return"), null, null,
booleanSer);
+ smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"), null, null,
booleanSer);
doCall(url, "echoBoolean", p);
}
@@ -222,7 +226,7 @@
call.setHeader(header);
String soapAction = ACTION_URI;
- if (true) {
+ if (false) {
soapAction = soapAction + methodName;
}