WCF Service Post Request from JQuery in window phone not working

Answered WCF Service Post Request from JQuery in window phone not working

  • Wednesday, April 11, 2012 9:59 AM
     
     

    I am working on window phone and use PhoneGap I create WCF service and call it from AJAX JQuery Its working Fine when ever i send a GET request but it occure error when i send a POST request

    My WCF service code here:

    [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)]
    Container LoginService(string username, string password);

    Calling JQuery Code Here:

    $.ajax({ type: "POST",
                    url:"http://localhost:8021/Service1.svc/loginservice" ,
                   // dataType: 'jsonp',
                    data: '{ "username":"abdul","password":"pass"}',
                    success: function (val) { navigator.notification.alert(val.Message, alertdismiss, 'Message', 'ok'); },
                    error: OnError,
                    async: false,
                    cache: false
                });

    What wrong with this code when it run on window phone ???

    any help will be great appreciated 

All Replies