X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FSOAP.java;h=5e6d46302f8395537fb0b59a12473385275379ff;hb=66088da8711e9855d6328732bbcce8788301a8bc;hp=1a279f4aa1721f900cbb7c88e62b25490848bce0;hpb=ac822316ceb6f9a709901870bd1e2dc2974285e5;p=org.ibex.core.git diff --git a/src/org/xwt/SOAP.java b/src/org/xwt/SOAP.java index 1a279f4..5e6d463 100644 --- a/src/org/xwt/SOAP.java +++ b/src/org/xwt/SOAP.java @@ -1,10 +1,11 @@ -// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL] +// FIXME +// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL] package org.xwt; import java.io.*; import java.net.*; import java.util.*; -import org.mozilla.javascript.*; +import org.xwt.js.*; import org.xwt.util.*; import org.bouncycastle.util.encoders.Base64; @@ -19,16 +20,16 @@ import org.bouncycastle.util.encoders.Base64; *
sb
*/
- void appendObject(String name, Object o, StringBuffer sb) throws JavaScriptException {
+ /&* Appends the SOAP representation of o
to sb
&/
+ 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 +182,10 @@ class SOAP extends XMLRPC {
sb.append(((Boolean)o).booleanValue() ? "true" : "false");
sb.append("" + name + ">\r\n");
- } else if (o instanceof ByteStream) {
+ } else if (o instanceof Res) {
try {
sb.append(" <" + name + " xsi:type=\"SOAP-ENC:base64\">\r\n");
- InputStream is = ((ByteStream)o).getInputStream();
+ InputStream is = ((Res)o).getInputStream();
byte[] buf = new byte[54];
while(true) {
int numread = is.read(buf, 0, 54);
@@ -199,7 +204,7 @@ class SOAP extends XMLRPC {
} 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 JavaScriptException("caught IOException while attempting to send a ByteStream via SOAP");
+ throw new JSExn("caught IOException while attempting to send a ByteStream via SOAP");
}
} else if (o instanceof String) {
@@ -221,24 +226,26 @@ class SOAP extends XMLRPC {
}
sb.append("" + name + ">\r\n");
- } else if (o instanceof NativeArray) {
- NativeArray na = (NativeArray)o;
- sb.append(" <" + name + " SOAP-ENC:arrayType=\"xsd:ur-type[" + na.jsGet_length() + "]\">");
- for(int i=0; i