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
Highlighted
Visitor
Posts: 1
Registered: ‎07-03-2012
My Device: BlackBerry Curve 8520
My Carrier: rogers

Connecting to webservice from OS 6 and 7 not working

I would really appreciate it if some one can point me in the right direction. I am able to connect to a webservice with code below  form blackberry os 5.0, but not from 6 and 7.

 

function

CallService() {

    alert(

"at CallService()");

   

if (!data) data = {};

   

try{

        $.ajax({

            type:

"POST",

            url:

"http://www.pointsmaster.com/events/Service.asmx/SLAgeGroups",

            data: data,

            contentType:

"application/json; charset=utf-8",

            dataType:

"json",

            success: OnSuccess1,

            error: OnError1,

            dataFilter:

function (data) {

                alert(

"data is: " + data);

            }

        });

}

catch

(e) {

    alert(

"error @ _ajax: " + e);

}

}

function

OnSuccess1(data, status) {

    alert(

"@ OnSuccess1");

   

try {

        alert(

"data is : " + data);

  

}

catch

(e) {

    alert(

"error @ OnSuccess1: " + e);

}

}

function

OnError1(request, status, error) {

  

    alert(

"at  OnError1");

   

try {

        alert(

"request " + request.statusText);

    alert(

" error " + error);

    alert(

" status " + status );

  

    $(

"#lblResult").html(request.statusText);

}

catch

(e) {

    alert(

"error @  OnError1: " + e);

}

           }

when i call CallService() , only the first alert fires in os 6 and 7, but it works as expected in os 5.