X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnet%2FSOAP.java;h=fbbb9bc018133b52721e74a8d633caee61178079;hp=85670a300e8e70873e9b299b067d7638dae5dd71;hb=a19b897271a8ab6b25aba63e4b30223c2477c28d;hpb=8e190fb0ff508ccf4962bbfbf8295a431805c12b diff --git a/src/org/ibex/net/SOAP.java b/src/org/ibex/net/SOAP.java index 85670a3..fbbb9bc 100644 --- a/src/org/ibex/net/SOAP.java +++ b/src/org/ibex/net/SOAP.java @@ -41,7 +41,7 @@ public class SOAP extends XMLRPC { if (name.equals("SOAP-ENV:Fault")) fault = true; // add a generic struct; we'll change this if our type is different - objects.addElement(new JS()); + objects.addElement(new JS.O()); for(int i=0; i 1 ? objects.elementAt(objects.size() - 2) : null; @@ -145,14 +145,15 @@ public class SOAP extends XMLRPC { if (objects.size() < 2) return; // our parent "should" be an aggregate type -- add ourselves to it. - if (parent != null && parent instanceof JSArray) { + // FIXME: Can we get away without JSArray being public? + /*if (parent != null && parent instanceof JSArray) { objects.removeElementAt(objects.size() - 1); ((JSArray)parent).addElement(me); - } else if (parent != null && parent instanceof JS) { + } else */ if (parent != null && parent instanceof JS) { objects.removeElementAt(objects.size() - 1); try { - ((JS)parent).put(name, me); + ((JS)parent).put(JS.S(name), me); } catch (JSExn e) { throw new Error("this should never happen"); } @@ -162,7 +163,9 @@ public class SOAP extends XMLRPC { } /** Appends the SOAP representation of o to sb */ - void appendObject(String name, Object o, StringBuffer sb) throws JSExn { + void appendObject(String name, JS o, StringBuffer sb) throws JSExn { + // FIXME: Update for new api + /* if (o instanceof Number) { if ((double)((Number)o).intValue() == ((Number)o).doubleValue()) { sb.append(" <" + name + " xsi:type=\"xsd:int\">"); @@ -239,10 +242,10 @@ public class SOAP extends XMLRPC { } sb.append("\r\n"); - } + }*/ } - protected String buildRequest(JSArray args) throws JSExn, IOException { + protected String buildRequest(JS[] args) throws JSExn, IOException { // build up the request StringBuffer content = new StringBuffer(); content.append("SOAPAction: " + action + "\r\n\r\n"); @@ -257,11 +260,11 @@ public class SOAP extends XMLRPC { content.append(method); content.append(nameSpace != null ? " xmlns=\"" + nameSpace + "\"" : ""); content.append(">\r\n"); - if (args.length() > 0) { - Enumeration e = ((JS)args.elementAt(0)).keys(); + if (args.length > 0) { + Enumeration e = args[0].keys(); while(e.hasMoreElements()) { - Object key = e.nextElement(); - appendObject((String)key, ((JS)args.elementAt(0)).get(key), content); + JS key = e.nextElement(); + appendObject(JS.toString(key), args[0].get(key), content); } } content.append(" \r\n");