[wsas-java-dev] svn commit r9420 - branches/wsas/java/2.1/wsf/javascript/native/src

svn at wso2.org svn at wso2.org
Fri Nov 2 05:19:25 PDT 2007


Author: saminda
Date: Fri Nov  2 05:19:21 2007
New Revision: 9420

Modified:
   branches/wsas/java/2.1/wsf/javascript/native/src/WSRequest.js
Log:
Sync 


Modified: branches/wsas/java/2.1/wsf/javascript/native/src/WSRequest.js
==============================================================================
--- branches/wsas/java/2.1/wsf/javascript/native/src/WSRequest.js	(original)
+++ branches/wsas/java/2.1/wsf/javascript/native/src/WSRequest.js	Fri Nov  2 05:19:21 2007
@@ -93,14 +93,14 @@
             throw new WebServiceError("Invalid input argument.", "WSRequest.send() unable to serialize XML payload.");
         }
 
-        // formulate the message envelope
-        if (this._soapVer == 0) {
-            var processed = WSRequest.util._buildHTTPpayload(this._optionSet, this._uri, content);
-            req = processed["body"];
-            this._uri = processed["url"];
-        } else {
-            req = WSRequest.util._buildSOAPEnvelope(this._soapVer, this._optionSet, this._uri, content);
-        }
+    }
+    // formulate the message envelope
+    if (this._soapVer == 0) {
+        var processed = WSRequest.util._buildHTTPpayload(this._optionSet, this._uri, content);
+        req = processed["body"];
+        this._uri = processed["url"];
+    } else {
+        req = WSRequest.util._buildSOAPEnvelope(this._soapVer, this._optionSet, this._uri, content);
     }
 
     // Note that we infer soapAction from the "action" parameter - also used for wsa:Action.
@@ -512,12 +512,12 @@
         if (browser == "ie" || browser == "ie7") {
             //create a DOM from content string.
             xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
-            if (content != "")
+            if (content != null && content != "")
                 xmlDoc.loadXML(content);
         } else {
             //create a DOMParser to get DOM from content string.
             var xmlParser = new DOMParser();
-            if (content != "")
+            if (content != null && content != "")
                 xmlDoc = xmlParser.parseFromString(content, "text/xml");
         }
 
@@ -544,7 +544,7 @@
             resultValues["url"] = WSRequest.util._joinUrlToLocation(url, resultValues["url"]);
 
             // Sending the XML in the request body.
-            if (inputSerialization == "application/xml") {
+            if (content != null && inputSerialization == "application/xml") {
                 resultValues["body"] = content;
             }
         } else if (inputSerialization == "multipart/form-data") {
@@ -689,7 +689,7 @@
                   '<s:Envelope xmlns:s="' + ns + '"' +
                   wsaNsDecl + '>\n' +
                   '<s:Header>' + headers + '</s:Header>\n' +
-                  '<s:Body>' + content + '</s:Body>\n' +
+                  '<s:Body>' + (content != null ? content : '') + '</s:Body>\n' +
                   '</s:Envelope>';
         return request;
     }




More information about the Wsas-java-dev mailing list