Submitting XML as parameter using Form Builder

classic Classic list List threaded Threaded
2 messages Options
Jez
Reply | Threaded
Open this post in threaded view
|

Submitting XML as parameter using Form Builder

Jez
Hi - I'm an Orbeon Forms Newbie and was hoping to get help with sending XML to a web service.

The Service is described as "The XML Document should be posted uriencoded, with a UTF-8 character set as paramaeter 'xml' to ~/api/xmlapi.php" and there is an example script:

        xmlHttp=GetXmlHttpObject(receiveXML);
        var url = "api/xmlapi.php";
        var params = "xml=" + document.getElementById('xml').value;
        xmlHttp.open("POST", url, true);

        //Send the proper header information along with the request
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.setRequestHeader("Content-length", params.length);
        xmlHttp.setRequestHeader("Connection", "close");
        xmlHttp.send(params);

I'm trying to use Form Builder to create an HTTP service, and have tried all the standard options with no success (valid http - 200. but no response). Maybe something to do with the "xml=" parameter setting.

Do I need to customise the source code of the submission?
Reply | Threaded
Open this post in threaded view
|

Re: Submitting XML as parameter using Form Builder

Alessandro  Vernet
Administrator
For those who might find this thread in the future, this has been addressed on Stack Overflow:

http://stackoverflow.com/questions/15189269/how-can-i-submit-xml-in-an-html-form-post-parameter-using-form-builder

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet