Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7987025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:01:37+00:00 2026-06-04T12:01:37+00:00

My ajax method always returns ServiceFailed although WCF service method returns successfully (I verified

  • 0

My ajax method always returns ServiceFailed although WCF service method returns successfully (I verified by setting breakpoints). The code is shown below. What could be the wrong?

function LoginToServer(name, password) {
    server = "localhost:1706";
    Type = "GET";
    var encodeusername = $.base64.encode(encode_utf8(name.value));
    var encodepwd = encode_utf8(password.value);
    var params = 'username=' + encodeusername + '&password=' + encodepwd + '&clientip=none';
    Url = "http://" + server + "/WCF/Test/TestService.svc/rest/Login?" + params;
    ContentType = "application/json; charset=utf-8";
    DataType = "jsonp";
    ProcessData = true;
    JsonpCallback = "alertResponse",
    method = "Login";
    CallService();
}


function CallService() {
    $.ajax({
        type: Type, //GET or POST or PUT or DELETE verb
        url: Url, // Location of the service
        data: Data, //Data sent to server
        contentType: ContentType, // content type sent to server
        dataType: DataType, //Expected data format from server
        processdata: ProcessData, //True or False
        jsonpCallback: JsonpCallback,
        success: function (msg) {//On Successfull service call
            ServiceSucceeded(msg);
        },
        error: ServiceFailed// When Service call fails
    });

WCF Service method is defined as below:

    [OperationContract]
    [WebGet(ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json,
            UriTemplate = "/Login?username={username}&password={password}&clientip={clientip}")]
    AuthenticationStatus SlideViewerLogin(string username, string password, string clientip);

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:01:39+00:00Added an answer on June 4, 2026 at 12:01 pm

    For cross domain call check this

    Calling Cross Domain WCF service using Jquery/JavaScript

    For WCF call

    there might be some issue with WCF service also have look to this blog post which help you to figure out the error you are facing :

    Create REST service with WCF and Consume using jQuery

    try to pass the data something as below in json format

    var msg2 = { "UserName": "Denny", "Password": "abc123" };
     Data = JSON.stringify(msg2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Visual Studio 2010 I created a new Ajax enabled WCF Service [ServiceContract(Namespace =
Possible Duplicate: jQuery Ajax always returns “undefined”? I'm trying to come up with a
this code always return 0: function myFunc() { var str = 0; JQuery.ajax({ type:
I have this EXT JS code: Ext.Ajax.request({ url : xxx, method : POST, params
$.ajax({ method: post , url: save.php , data: id=453&action=test , beforeSend: function(){ } ,
I am trying to call the .ajax() method when a button with id=go is
I am trying to execute ajax method from Dialog, but its not getting executed.
I'm loading a page containing a GMaps using the ajax() method of jQuery. The
I've created a wrapper function for jQuery's $.ajax() method so I can pass different
i am trying to send multiple data using j query $.ajax method to my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.