Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2007, 10:03 AM
Registered User
 
Join Date: Jun 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default posting form data as XML string problem

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Posting XML data via XMLHTTP steelrose XML 1 November 15th, 2007 05:19 PM
AJAX form posting problem. NisarAhamed Ajax 0 November 21st, 2006 01:09 AM
Problem with Posting an ASP .Net web form eliea ASP.NET 1.0 and 1.1 Basics 4 September 11th, 2006 02:59 AM
ASP.NET not posting form data sqzgnlib ASP.NET 1.0 and 1.1 Basics 2 May 10th, 2005 09:59 AM
problem in posting info frm child form to parent aravwind General .NET 2 July 28th, 2004 06:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.