From 29b0b0be4eff6d56d54e89225fc81142b6c2a1de Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 10 Feb 2004 01:24:09 +0000 Subject: [PATCH] fixed bug 372 darcs-hash:20040210012409-5007d-70be0c6953fbffb6dea9622b4efd253a83912e66.gz --- src/org/ibex/SOAP.java | 10 ++++++---- src/org/ibex/XMLRPC.java | 12 +++++++++--- src/org/ibex/js/JS.java | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/org/ibex/SOAP.java b/src/org/ibex/SOAP.java index 70e0a63..946ccb7 100644 --- a/src/org/ibex/SOAP.java +++ b/src/org/ibex/SOAP.java @@ -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; } diff --git a/src/org/ibex/XMLRPC.java b/src/org/ibex/XMLRPC.java index 5d88d6c..195e3cf 100644 --- a/src/org/ibex/XMLRPC.java +++ b/src/org/ibex/XMLRPC.java @@ -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 */ diff --git a/src/org/ibex/js/JS.java b/src/org/ibex/js/JS.java index 3158851..378e125 100644 --- a/src/org/ibex/js/JS.java +++ b/src/org/ibex/js/JS.java @@ -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 //////////////////////////////////////////////////////////////////// -- 1.7.10.4