X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FSOAP.java;h=480b589da04824a88cb49285e286eb3fb7051063;hb=d4fc62b0a4738cdab3dd605d7ec34dab94341867;hp=2771304bc23bd81eb7815dddd566675e9a03cd59;hpb=8235361e8601ae7b36ab707058de3b52225d15a2;p=org.ibex.core.git diff --git a/src/org/xwt/SOAP.java b/src/org/xwt/SOAP.java index 2771304..480b589 100644 --- a/src/org/xwt/SOAP.java +++ b/src/org/xwt/SOAP.java @@ -29,7 +29,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(String name) { - return new SOAP(url.toString(), (methodname.equals("") ? "" : methodname + ".") + name, http, action, nameSpace); + return new SOAP(url.toString(), (method.equals("") ? "" : method + ".") + name, http, action, nameSpace); } @@ -43,7 +43,7 @@ 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.Obj()); + objects.addElement(new JS()); for(int i=0; io to sb */ - void appendObject(String name, Object o, StringBuffer sb) throws JS.Exn { + void appendObject(String name, Object o, StringBuffer sb) throws JSExn { if (o instanceof Number) { if ((double)((Number)o).intValue() == ((Number)o).doubleValue()) { sb.append(" <" + name + " xsi:type=\"xsd:int\">"); @@ -177,10 +181,10 @@ class SOAP extends XMLRPC { sb.append(((Boolean)o).booleanValue() ? "true" : "false"); sb.append("\r\n"); - } else if (o instanceof Res) { + } else if (o instanceof Stream) { try { sb.append(" <" + name + " xsi:type=\"SOAP-ENC:base64\">\r\n"); - InputStream is = ((Res)o).getInputStream(); + InputStream is = ((Stream)o).getInputStream(); byte[] buf = new byte[54]; while(true) { int numread = is.read(buf, 0, 54); @@ -197,9 +201,9 @@ class SOAP extends XMLRPC { sb.append(((Boolean)o).booleanValue() ? "1" : "0"); sb.append("\r\n"); } catch (IOException e) { - if (Log.on) Log.log(this, "caught IOException while attempting to send a ByteStream via SOAP"); - if (Log.on) Log.log(this, e); - throw new JS.Exn("caught IOException while attempting to send a ByteStream via SOAP"); + if (Log.on) Log.info(this, "caught IOException while attempting to send a ByteStream via SOAP"); + if (Log.on) Log.info(this, e); + throw new JSExn("caught IOException while attempting to send a ByteStream via SOAP"); } } else if (o instanceof String) { @@ -221,8 +225,8 @@ class SOAP extends XMLRPC { } sb.append("\r\n"); - } else if (o instanceof JS.Array) { - JS.Array a = (JS.Array)o; + } else if (o instanceof JSArray) { + JSArray a = (JSArray)o; sb.append(" <" + name + " SOAP-ENC:arrayType=\"xsd:ur-type[" + a.length() + "]\">"); for(int i=0; i\r\n"); @@ -230,13 +234,17 @@ class SOAP extends XMLRPC { } else if (o instanceof JS) { JS j = (JS)o; sb.append(" <" + name + ">"); - Object[] ids = j.keys(); - for(int i=0; i\r\n"); + } } - protected String send(JS.Array args, HTTP http) throws JS.Exn, IOException { + protected String buildRequest(JSArray args) throws JSExn, IOException { // build up the request StringBuffer content = new StringBuffer(); content.append("SOAPAction: " + action + "\r\n\r\n"); @@ -248,19 +256,23 @@ class SOAP extends XMLRPC { content.append(" xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\">\r\n"); content.append("\r\n"); content.append(" <"); - content.append(methodname); + content.append(method); content.append(nameSpace != null ? " xmlns=\"" + nameSpace + "\"" : ""); content.append(">\r\n"); if (args.length() > 0) { - Object[] o = ((JS)args.elementAt(0)).keys(); - for(int i=0; i\r\n"); + content.append(" \r\n"); return content.toString(); } - SOAP(String url, String methodname, String action, String nameSpace) { this(url, methodname, new HTTP(url), action, nameSpace); } + SOAP(String url, String methodname, String action, String nameSpace) { + this(url, methodname, new HTTP(url), action, nameSpace); + } SOAP(String url, String methodname, HTTP http, String action, String nameSpace) { super(url, methodname, http); this.action = action;