2002/08/07 05:08:23
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:49:52 +0000 (06:49 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:49:52 +0000 (06:49 +0000)
darcs-hash:20040130064952-2ba56-9dc5ed278a36d142736e789fa5426bdb41526949.gz

CHANGES
src/org/xwt/SOAP.java

diff --git a/CHANGES b/CHANGES
index a498193..53820e0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
 
 06-Jul megacz XMLRPC.java: new HTTP stack, better verbose output
 
+06-Jul megacz SOAP.java: new HTTP stack
+
 
index a36e9a9..3c3ed7d 100644 (file)
@@ -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, Scriptable start) {
-        return new SOAP(url.toString(), (methodname.equals("") ? "" : methodname + ".") + name, action, nameSpace);
+        return new SOAP(url.toString(), (methodname.equals("") ? "" : methodname + ".") + name, http, action, nameSpace);
     }
 
 
@@ -241,6 +241,7 @@ class SOAP extends XMLRPC {
     protected String send(Object[] args, HTTP http) throws JavaScriptException, IOException {
         // build up the request
         StringBuffer content = new StringBuffer();
+        content.append("SOAPAction: " + action + "\r\n\r\n");
         content.append("<?xml version=\"1.0\"?>\n");
         content.append("<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\n");
         content.append("                   xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\n");
@@ -258,12 +259,12 @@ class SOAP extends XMLRPC {
                 appendObject(o[i].toString(), ((Scriptable)args[0]).get(o[i].toString(), (Scriptable)args[0]), content);
         }
         content.append("    </" + methodname + "></SOAP-ENV:Body></SOAP-ENV:Envelope>");
-        http.addHeader("SOAPAction", action);
         return content.toString();
     }
 
-    SOAP(String url, String methodname, String action, String nameSpace) {
-        super(url, methodname);
+    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;
         this.nameSpace = nameSpace;
     }