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

Web and WebWorks Development

Reply
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Getting no response from webservice.

Hi ..

can you please help me to get response from web service..i am getting erroe alert..

 


Ext.application({
launch: function () {



var divToBeWorkedOn = '#AjaxPlaceHolder';
var webMethod = 'http://184.106.159.143:8080/FirstGroupRailApps/services/RailAppsCAWS/getDestinationStationDashboard'
var parameters = "{'crsCode':'AAP'}";

$.ajax({
type: "GET",
url: webMethod,
data: parameters,
contentType: "application/XML; charset=utf-8",
dataType: "XML",
success: function(msg,xml) {
alert("Hi")
var responseXML = xml.documentElement;
alert(responseXML);
alert(msg.stationName);
$(divToBeWorkedOn).html(msg.d);
},
error: function(e){
alert("p")
alert(e);
$(divToBeWorkedOn).html("Unavailable");
}
});
}

 

Please use plain text.
Developer
The_Anomaly
Posts: 322
Registered: ‎08-06-2012
My Device: Dev Alpha / Playbook / Curve 9300

Re: Getting no response from webservice.

Best answered on a sencha forum.

If it helped you, click like. :smileyhappy:
Please use plain text.
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Getting no response from webservice.

..:smileysad:

Please use plain text.
Developer
jamesgibbons
Posts: 26
Registered: ‎06-01-2010
My Device: Dev Alpha, PlayBook

Re: Getting no response from webservice.

In order to make an AJAX request to another website, make sure you have the following entry in your config.xml file:

 

<access subdomains="true" uri="*"/>

 

 

Cheers!

___________________________________________________________
My latest Blackberry 10 app Audiobooks! :smileyhappy:

My latest PlayBook app Photojam!

Find me on Twitter: GoGibbons
Please use plain text.
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Getting no response from webservice.

Actually recently i am checking response on browser , but i am not getting any thing..:smileysad:

Please use plain text.
Developer
jamesgibbons
Posts: 26
Registered: ‎06-01-2010
My Device: Dev Alpha, PlayBook

Re: Getting no response from webservice.

If you are using Chrome, switch alert(e); to console.log(e); 


Then open the console, control-shift-i, to see what error message you are receiving, which will help you debug the problem further.

 

 

___________________________________________________________
My latest Blackberry 10 app Audiobooks! :smileyhappy:

My latest PlayBook app Photojam!

Find me on Twitter: GoGibbons
Please use plain text.
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Getting no response from webservice.

yes you are right ...can you please check i am getting response here.. i am using same web service but not getting response..
http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/why-it-goes-to-if-condiation/m-p...
Please use plain text.
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Getting no response from webservice.

getting error : object

Object
abort: function (a){a=a||"abort",p&&p.abort(a),w(0,a);return this}
always: function (){i.done.apply(i,arguments).fail.apply(i,arguments);return this}
complete: function (){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this}
done: function (){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this}
error: function (){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this}
fail: function (){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this}
getAllResponseHeaders: function (){return s===2?n:null}
getResponseHeader: function (a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c}
isRejected: function (){return!!e}
isResolved: function (){return!!e}
overrideMimeType: function (a){s||(d.mimeType=a);return this}
pipe: function (a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()}
progress: function (){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this}
promise: function (a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}
readyState: 4
responseText: "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

↵<html xmlns="http://www.w3.org/1999/xhtml">
↵ <head>
↵ <title>
↵ Login
↵ </title>
↵ <!--[if IE 6]><link rel="stylesheet" href="css/ie6.css" type="text/css"/><![endif]-->
↵ <!--[if IE 7]><link rel="stylesheet" href="css/ie6.css" type="text/css"/><![endif]-->
↵ <link href="css/reset.css" rel="stylesheet" type="text/css" media="screen,projection"/>
↵ <link rel="stylesheet" type="text/css" title="original" href="css/style.css" media="screen,projection">
↵ <link rel="stylesheet" type="text/css" title="original" href="css/popup.css" media="screen,projection">
↵ <link rel="stylesheet" type="text/css" title="original" href="css/jqueryui/jquery.ui.all.css" media="screen,projection">
↵ &lt;script type="text/javascript" src="js/jquery-1.4.2.min.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/jqueryui/jquery.ui.core.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/jqueryui/jquery.ui.widget.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/jqueryui/jquery.ui.position.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/jqueryui/jquery.ui.autocomplete.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/popup.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/ajax.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/todayrunning.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/journeyDetails.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/addCloneBusJourney.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/validation.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" src="js/selectstation.js">&lt;/script&gt;
↵ &lt;script type="text/javascript" language="javascript">
↵ $(document).ready(function(){
↵ var height1 = $(window).height(); // height of full document
↵ var height2 = $('#firstPart').height(); // height of header
↵ var height3 = $('#headerNext').height();
↵ var height4 = $('#footerFixed').height();
↵ var height5 = $('#firstContain').height();
↵ var height_diff = height1 - (height2 + height3 + height5);
↵ var bodyHeight = height_diff - height4 + "px";
↵ document.getElementById('secondContain').style.height = bodyHeight; // Set the remaining height in test DIV.
↵ });
↵ &lt;/script&gt;
↵ <style>
↵ .ui-autocomplete-loading { background: white url('css/jqueryui/images/ui-anim_basic_16x16.gif') right center no-repeat; }
↵ </style>

↵ </head>

↵ <body>
↵ <div id="warper">
↵ <div id="firstPart">
↵ <div id="logo"></div>

↵ </div>


↵&lt;script type="text/javascript">
↵function validateLogin(form){
↵ value = form.j_username.value;
↵ valuePassword = form.j_password.value;
↵ if(value == ''){
↵ alert("Login ID cannot be left blank.");
↵ return false;
↵ } else if(valuePassword == ''){
↵ alert("Password cannot be left blank.");
↵ return false;
↵ } else {
↵ return true;
↵ }
↵}
↵&lt;/script&gt;

↵<div id="headerNext">
↵ <div id="navBg">
↵ <div class="mainNav"></div>
↵ </div>
↵</div>

↵<div id="secondContain">
↵ <div id="mainBody">
↵ <center>
↵ <form id="loginForm" name="loginForm" action="j_spring_security_check" method="POST" onsubmit="return validateLogin(this);">
↵ <div class="login">
↵ <label for="j_username">Login ID</label>
↵ <input class="inputText" type="text" id="j_username" name="j_username" />
↵ <br>
↵ <br>
↵ <label for="j_password">Password</label>
↵ <input class="inputText" type="password" id="j_password" name="j_password" />
↵ <br>
↵ <br>
↵ <label for="submit">&nbsp;</label>
↵ <input class="inputBtn_img" type="submit" value="Login" class="close" align="right"/>
↵ <br>
↵ </div>
↵ <div><p class="errorLog"><b></b></p></div>
↵ </form>
↵ </center>
↵ </div>
↵</div>





↵ <div id="footerFixed"></div>
↵ </div>
↵ </body>
↵</html>"
setRequestHeader: function (a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this}
state: function (){return e}
status: 200
statusCode: function (a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this}
statusText: "OK"
success: function (){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this}
then: function (a,b,c){i.done(a).fail(b).progress(c);return this}
__proto__: Object
Please use plain text.