Hi folks,
I've been asked to post data from a form to a message broker system being tested by another team. I've been told all I should need to do is post the data using http request in the following format to a server so I tried the following script:
Code:
var http =new HttpClient();
var url="http://...";
http.contentType = "'text/xml'";
http.requestHeader = ['SOAPAction: "http://..."'];
http.postData ='';
http.postData +='';
http.postData +='';
http.postData +='';
http.postData +='';
http.postData +='';
http.postData +=''+firstname+'';
http.postData +=''+surname+'';
http.postData +='
'+address+'
';
http.postData +=''+county+'';
http.postData +=''+postcode+'';
http.postData +=''+emailaddress+'';
http.postData +=''+telno+'';
http.postData +=''+requestdetails+'';
http.postData +=''+requestRef+'';
http.postData +=''+entryDate+'';
http.postData +='';
http.postData +='';
http.postData +='';
http.postData +='';
//http.postData = escape(http.postData);
var sendMyRequest = http.sendRequest(url);
It posts but breaks off after the first line of post data.
Basically I need a way to post the xml formatted values from the form to the message broker. The guy who's working with the message broker thinks that using the SOAP client is over the top and we only need to send the values formatted as xml, as in the script but I can't get it to post in that format. The message broker is expecting an XML string formatted in this way.
I'm pretty new to XML and would appreciate anyone's help or at least pointed in the right direction.
Thanks