Click here to Skip to main content
13,055,047 members (65,824 online)
Rate this:
Please Sign up or sign in to vote.

i have struggled with one problem.
ajax call with jquery for webservice working fine in ie but not working in googlechrome, firefox,safari.

in googlechrome,safari and firefox it gives response as undefined

this is my code..

in aspx page
                type: "POST",
                url: "xxx.svc/logindetails",
                contentType: "application/json",
                data: '{ "UserName": "' + UserName + '","Password": "' + Password + '"}',
                async: false,
                success: function (data) {
                    if (data.text == '') {
                       // xxxxxxxxx  
                error: function (data) {

in xxx.svc:

        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Xml
public string GetUserDetailsbyLogIn(string UserName, string Password)
string msg="";
// checking user exist or not
           return msg;

anyone can know about this pls help me
thanks in advance...
Posted 14-Nov-12 0:32am
Updated 14-Nov-12 21:35pm
n.podbielski 15-Nov-12 3:33am
So how do you know that it is not working? Any errors?
n.podbielski 15-Nov-12 3:36am
Also please format your question better next time.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I think problem lies in Accepts an Content-Type HTTP headers.
Please see my edited answer here, and try if this will work.[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 15 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100