Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Academic Developer Network

Reply
New Developer
chakraborty7
Posts: 6
Registered: ‎10-31-2011
My Device: PlayBook
My Carrier: BlackBerry OS

HTML5 POSTing form data to a web service...

I am using HTML5 and web works for packaging....

 

I have a merchant application which uploads data in a registration form to a Web Service. 

The java Script code is::::

<script>


var myxmlhttp;
var params="MerchantId=string&BusinessName=string&Email=string&Password=string&MobileNumber=string&LandlineNumber=string&CompanyRegistrationNumber=string&WebURL=string&IsCanclled=string&IsBlocked=string&IsApproved=string";
doRequest();

function doRequest () {
	
	var url = "http://10.4.3.224/VerizonDealsWebservice/Service1.asmx/SaveMerchantData HTTP/1.1";
	myxmlhttp = CreateXmlHttpReq(resultHandler);

	if (myxmlhttp) {
		XmlHttpGET(myxmlhttp, url);
	} else {
		alert("An error occured while attempting to process your request.");
		
	}
}

function resultHandler () {
	
	if (myxmlhttp.readyState == 4) {
		// success
		if (myxmlhttp.status == 200) {
			alert("Success!");
			
		} else {
			alert("There was a problem retrieving the data:\n" + req.statusText);
		}
	}
}

function CreateXmlHttpReq(handler) {
	var xmlhttp = null;

	if (window.XMLHttpRequest) {
		xmlhttp = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		// users with activeX off
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {}
	}

	if (xmlhttp) xmlhttp.onreadystatechange = handler;

	return xmlhttp;
}


function XmlHttpGET(xmlhttp, url) {
	try {
		xmlhttp.open("POST", url, true);	

		xmlhttp.send(params);
	} catch (e) {}
}


</script>

 

 

 my form element looks like ::::::::

 

<form method="post" name="regForm" id="regForm" onsubmit="doRequest()" enctype="application/x-www-form-urlencoded" action='http://localhost/VerizonDealsWebservice/Service1.asmx/SaveMerchantData'>

 

 

why is it that i am not getting any confirmation message whether the data is getting saved or not????

 

moreover for ur information the webservice is using SOAP protocol......
has it gotta do with anything where about multipart/form data not accepted by SOAP???

Please use plain text.