trim down public api
[org.ibex.core.git] / src / org / ibex / net / SOAP.java
index 3d998d5..fbbb9bc 100644 (file)
@@ -67,7 +67,7 @@ public class SOAP extends XMLRPC {
                     objects.addElement(null);
                 } else if (value.endsWith("arrayType") || value.endsWith("JSArray") || key.endsWith("arrayType")) {
                     objects.removeElementAt(objects.size() - 1);
-                    objects.addElement(new JSArray());
+                    objects.addElement(JS.newArray());
                 }
             }
         }
@@ -145,11 +145,12 @@ 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(JS.S(name), me);
@@ -244,7 +245,7 @@ public class SOAP extends XMLRPC {
         }*/
     }
 
-    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");
@@ -259,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, args.elementAt(0).get((JS)key), content);
+                JS key = e.nextElement();
+                appendObject(JS.toString(key), args[0].get(key), content);
             }
         }
         content.append("    </" + method + "></SOAP-ENV:Body></SOAP-ENV:Envelope>\r\n");