0

I'm trying to run this code to call a WCF function from a phonegap application on Android

I tested the webservice using POSTER from firefox and can get through just fine, and returns the correct values (actually it only returns true or false)

function verifyAccount(username, password){
   $.ajax({
    type: "post",
    url:  "http://50.63.174.229/banknoteservice/service1.svc/verifyAccount",
    data:  JSON.stringify("{'username' : 'test' , 'password' : 'test'}"),
    contentType: "application/json",
    dataType: "json",
    success: function(msg) {    
        $("#myDiv").html(msg);
    },
    error: function(e){
        $("#myDiv").html('error');              
    }
});

}

Every time I try to run it on the phone, it shows the error message in the div

Nicolas R
  • 13,812
  • 2
  • 28
  • 57
KamalSalem
  • 495
  • 2
  • 8
  • 21
  • What's your service definition? What is the value of the error? – carlosfigueira Jan 03 '13 at 21:45
  • Have you seen what kind of error is happening? Can you validate that the request is making it to the server? If it is, can you see if there is any server side error? – Nick Roth Jan 03 '13 at 21:46
  • @NickRoth I edited the question, yes the function works on the server – KamalSalem Jan 03 '13 at 22:00
  • Did you get any more information on what kind of error is happening? Instead of filling #myDiv with a simple static message, try printing information from e to give you an indication about what is going wrong. – Nick Roth Jan 03 '13 at 22:07
  • @NickRoth That's one of the things I can't do, how would I print the error message? – KamalSalem Jan 06 '13 at 15:59

0 Answers0