X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnet%2FSOAP.java;h=fbbb9bc018133b52721e74a8d633caee61178079;hp=946ccb784674e255284c8e8dae21f020d8925724;hb=a19b897271a8ab6b25aba63e4b30223c2477c28d;hpb=4daeeb4119b901d53b44913c86f8af3ce67db925 diff --git a/src/org/ibex/net/SOAP.java b/src/org/ibex/net/SOAP.java index 946ccb7..fbbb9bc 100644 --- a/src/org/ibex/net/SOAP.java +++ b/src/org/ibex/net/SOAP.java @@ -1,11 +1,11 @@ // Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] -package org.ibex; +package org.ibex.net; import java.io.*; import java.util.*; import org.ibex.js.*; import org.ibex.util.*; -import org.bouncycastle.util.encoders.Base64; +import org.ibex.crypto.*; /** * A partial RPC-style SOAP 1.1 client. Implemented from the SOAP 1.1 @@ -18,7 +18,7 @@ import org.bouncycastle.util.encoders.Base64; *
o
to sb
*/
- void appendObject(String name, Object o, StringBuffer sb) throws JSExn {
+ void appendObject(String name, JS o, StringBuffer sb) throws JSExn {
+ // FIXME: Update for new api
+ /*
if (o instanceof Number) {
if ((double)((Number)o).intValue() == ((Number)o).doubleValue()) {
sb.append(" <" + name + " xsi:type=\"xsd:int\">");
@@ -239,10 +242,10 @@ class SOAP extends XMLRPC {
}
sb.append("" + name + ">\r\n");
- }
+ }*/
}
- protected String buildRequest(JSArray args) throws JSExn, IOException {
+ protected String buildRequest(JS[] args) throws JSExn, IOException {
// build up the request
StringBuffer content = new StringBuffer();
content.append("SOAPAction: " + action + "\r\n\r\n");
@@ -257,23 +260,23 @@ class SOAP extends XMLRPC {
content.append(method);
content.append(nameSpace != null ? " xmlns=\"" + nameSpace + "\"" : "");
content.append(">\r\n");
- if (args.length() > 0) {
- Enumeration e = ((JS)args.elementAt(0)).keys();
+ if (args.length > 0) {
+ Enumeration e = args[0].keys();
while(e.hasMoreElements()) {
- Object key = e.nextElement();
- appendObject((String)key, ((JS)args.elementAt(0)).get(key), content);
+ JS key = e.nextElement();
+ appendObject(JS.toString(key), args[0].get(key), content);
}
}
content.append(" " + method + ">\r\n");
return content.toString();
}
- SOAP(String url, String methodname, String action, String nameSpace) {
+ public SOAP(String url, String methodname, String action, String nameSpace) {
super(url, methodname);
this.action = action;
this.nameSpace = nameSpace;
}
- SOAP(String url, String methodname, SOAP httpSource, String action, String nameSpace) {
+ public SOAP(String url, String methodname, SOAP httpSource, String action, String nameSpace) {
super(url, methodname, httpSource);
this.action = action;
this.nameSpace = nameSpace;