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

Web and WebWorks Development

New Contributor
Posts: 7
Registered: ‎12-11-2012
My Device: Alpha B
My Carrier: True

I have problem with Web Services always return status=0, responseXML is null

I created html from localhost apache web server

for webworks bb10 and got some problem


Please someone help 


<script type="text/JavaScript">

var xmlhttp = createXMLHttpRequest();
var url = 'http://www.webservicex.net/stockquote.asmx';


function createXMLHttpRequest() /*Add parameters and what not*/ {
try { return new XMLHttpRequest(); } catch(e) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
alert("XMLHttpRequest not supported");
return null;

function callWebservice() {

//Example of a xml request probably put this is the parameter
var soapMessage = "<?xml version='1.0' encoding='utf-8'?>";
soapMessage += "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' ";
soapMessage += "xmlns:xsd='http://www.w3.org/2001/XMLSchema' ";
soapMessage += "xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>";
soapMessage += "<soap:Body>";
soapMessage += "<GetQuote xmlns='<http://www.webserviceX.NET/'>";
soapMessage += " <symbol>AA</symbol>";
soapMessage += "</GetQuote>";
soapMessage += "</soap:Body></soap:Envelope>";


//var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
xmlhttp.onreadystatechange = stateChange;
xmlhttp.open("POST", url, true);
xmlhttp.setRequestHeader ("SOAPAction", "http://www.webserviceX.NET/GetQuote");
xmlhttp.setRequestHeader ("Content-Type", "text/xml");

function stateChange() {
if (xmlhttp.readyState==4)
// if "OK"
if (xmlhttp.status==200)
//[Get xmlhttp.responseXML.xml and do something with it]
alert ('ok');
//[Get xmlhttp.responseXML.xml and do something with it in the case of an error]
alert ('no ok');


<button onclick="callWebservice() ">Get Single Object Works</button>