X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnet%2FSOAP.java;fp=src%2Forg%2Fibex%2Fnet%2FSOAP.java;h=0000000000000000000000000000000000000000;hp=d54ebce9a77d1fe0d42db7735b049806f3048f22;hb=ac84b5a03467c0853c7275105712ece6c71be1f1;hpb=3f8aa5300e178e8975b0edc896a5a9d303e7bdf3 diff --git a/src/org/ibex/net/SOAP.java b/src/org/ibex/net/SOAP.java deleted file mode 100644 index d54ebce..0000000 --- a/src/org/ibex/net/SOAP.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] -package org.ibex.net; - -import java.io.*; -import java.util.*; -import org.ibex.js.*; -import org.ibex.util.*; -import org.ibex.crypto.*; - -/** - * A partial RPC-style SOAP 1.1 client. Implemented from the SOAP 1.1 - * Spec and Dave Winer's "SOAP for Busy Developers". This class - * extends XMLRPC in order to share some networking logic. - * - * Currently unsupported features/hacks: - *
o
to sb
*/
- void appendObject(String name, JS o, StringBuffer sb) throws JSExn {
- // JS:FIXME: Update for new api
- /*
- if (o instanceof Number) {
- if ((double)((Number)o).intValue() == ((Number)o).doubleValue()) {
- sb.append(" <" + name + " xsi:type=\"xsd:int\">");
- sb.append(((Number)o).intValue());
- sb.append("" + name + ">\r\n");
- } else {
- sb.append(" <" + name + " xsi:type=\"xsd:double\">");
- sb.append(o);
- sb.append("" + name + ">\r\n");
- }
-
- } else if (o instanceof Boolean) {
- sb.append(" <" + name + " xsi:type=\"xsd:boolean\">");
- sb.append(((Boolean)o).booleanValue() ? "true" : "false");
- sb.append("" + name + ">\r\n");
-
- } else if (o instanceof Stream) {
- try {
- sb.append(" <" + name + " xsi:type=\"SOAP-ENC:base64\">\r\n");
- InputStream is = ((Stream)o).getInputStream();
- byte[] buf = new byte[54];
- while(true) {
- int numread = is.read(buf, 0, 54);
- if (numread == -1) break;
- byte[] writebuf = buf;
- if (numread < buf.length) {
- writebuf = new byte[numread];
- System.arraycopy(buf, 0, writebuf, 0, numread);
- }
- sb.append(" ");
- sb.append(new String(Base64.encode(writebuf)));
- sb.append("\r\n");
- }
- sb.append(((Boolean)o).booleanValue() ? "1" : "0");
- sb.append("" + name + ">\r\n");
- } catch (IOException e) {
- 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) {
- sb.append(" <" + name + " xsi:type=\"xsd:string\">");
- String s = (String)o;
- if (s.indexOf('<') == -1 && s.indexOf('&') == -1) {
- sb.append(s);
- } else {
- char[] cbuf = s.toCharArray();
- while(true) {
- int oldi = 0, i=0;
- while(i < cbuf.length && cbuf[i] != '<' && cbuf[i] != '&') i++;
- sb.append(cbuf, oldi, i);
- if (i == cbuf.length) break;
- if (cbuf[i] == '<') sb.append("<");
- else if (cbuf[i] == '&') sb.append("&");
- i = oldi = i + 1;
- }
- }
- sb.append("" + name + ">\r\n");
-
- } 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