fixed bug 372
authoradam <adam@megacz.com>
Tue, 10 Feb 2004 01:24:09 +0000 (01:24 +0000)
committeradam <adam@megacz.com>
Tue, 10 Feb 2004 01:24:09 +0000 (01:24 +0000)
darcs-hash:20040210012409-5007d-70be0c6953fbffb6dea9622b4efd253a83912e66.gz

src/org/ibex/SOAP.java
src/org/ibex/XMLRPC.java
src/org/ibex/js/JS.java

index 70e0a63..946ccb7 100644 (file)
@@ -28,7 +28,7 @@ class SOAP extends XMLRPC {
 
     /** When you get a property from an SOAP, it just returns another SOAP with the property name tacked onto methodname. */
     public Object get(Object name) {
-        return new SOAP(url, (method.equals("") ? "" : method + ".") + name.toString(), http, action, nameSpace); }
+        return new SOAP(url, (method.equals("") ? "" : method + ".") + name.toString(), this, action, nameSpace); }
 
 
     // Methods to Recieve and parse SOAP Responses ////////////////////////////////////////////////////
@@ -269,10 +269,12 @@ class SOAP extends XMLRPC {
     }
 
     SOAP(String url, String methodname, String action, String nameSpace) {
-        this(url, methodname, new HTTP(url), action, nameSpace);
+        super(url, methodname);
+        this.action = action;
+        this.nameSpace = nameSpace;
     }
-    SOAP(String url, String methodname, HTTP http, String action, String nameSpace) {
-        super(url, methodname, http);
+    SOAP(String url, String methodname, SOAP httpSource, String action, String nameSpace) {
+        super(url, methodname, httpSource);
         this.action = action;
         this.nameSpace = nameSpace;
     }
index 5d88d6c..195e3cf 100644 (file)
@@ -31,9 +31,15 @@ import org.bouncycastle.util.encoders.Base64;
  */
 class XMLRPC extends JS {
 
-    public XMLRPC(String url, String method) { this(url, method, new HTTP(url)); }
-    public XMLRPC(String url, String method, HTTP http) { this.http = http; this.url = url; this.method = method; }
-    public Object get(Object name) { return new XMLRPC(url, (method.equals("") ? "" : method + ".") + name.toString(), http); }
+    public XMLRPC(String url, String method) {
+        this.http = url.startsWith("stdio:") ? HTTP.stdio : new HTTP(url);
+        this.url = url;
+        this.method = method;
+    }
+    public XMLRPC(String url, String method, XMLRPC httpSource) {
+        this.http = httpSource.http; this.url = url; this.method = method; }
+    public Object get(Object name) {
+        return new XMLRPC(url, (method.equals("") ? "" : method + ".") + name.toString(), this); }
 
 
     /** this holds character content as we read it in -- since there is only one per instance, we don't support mixed content */
index 3158851..378e125 100644 (file)
@@ -130,7 +130,7 @@ public class JS extends org.ibex.util.BalancedTree {
             if((int)d == d) return Integer.toString((int)d);
             return o.toString();
         }
-        throw new RuntimeException("can't coerce that!");
+        throw new RuntimeException("can't coerce "+o+" [" + o.getClass().getName() + "]");
     }
 
     // Instance Methods ////////////////////////////////////////////////////////////////////