While the server side proxy and flash based transport both add an external dependency the script node can only make a GET request, and the hidden form approach can only send URL encoded key/value pairs... that's until we try a bit of trickery.
<form id="soap" method="POST" action="[SOAP entry point URL]" enctype="text/plain"> <textarea name="<?xml version"> "1.0" encoding="UTF-8"?> [SOAP message here] </textarea> </form> <script> document.getElementById("soap").submit(); </script>
And that's it. The key elements are highlighted. In particular, you set the form's
enctypeattribute to text/plain. This makes sure that none of the data is URL encoded. Then a clever trick that works well with XML documents. Set the text field's name to
<?xml version, ie, the starting text of an XML document. Omit the
=sign and set the value to everything else.
When the form is submitted, the browser sends form fields as
key=value, one on each line (that's how text/plain works). In this case, it sends the following:
<?xml version="1.0" encoding="UTF-8"?> [SOAP message here]Which essentially submits the SOAP payload to the web service.