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

  • SEARCH
  • Home
  • 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 8409107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:48:54+00:00 2026-06-09T23:48:54+00:00

I get a Bad Request Error 400 when I attempt to load Stats from

  • 0

I get a Bad Request Error 400 when I attempt to load Stats from my WCF Service. My call looks like so. I pulled out the date parameter to see if that was the cause, but no luck still getting the same error.

function WCFJSON() {
//var now = new Date();
//var getFromDate = dateToWcf(new Date(now - (60000 * 1440)));

var dt = new Date(now);
var dt1 = new Date(Date.UTC(dt.getFullYear(), dt.getMonth(), dt.getDate(), dt.getHours(), dt.getMinutes(), dt.getSeconds(), dt.getMilliseconds()));
var getFromDate = dt1.toMSJSON();

var userid = "1";
m_Type = "POST";
m_Url = "https://dev-04.boldgroup.int/ManitouDashboard/DashboardProxyService.svc/GetStats"
m_Data = JSON.stringify({getFromDate: "'" + getFromDate + "'",getValueList: [1,2,3]});
m_DataType = "json";
m_ProcessData = true;             
CallService();
}

Date.prototype.toMSJSON = function () {
var date = '//Date(' + this.getTime() + ')//'; //CHANGED LINE
return date;
}; 

function CallService() {
$.ajax({
    type: m_Type,           //GET or POST or PUT or DELETE verb                  
    url: m_Url,                 //Location of the service   
    data: m_Data,
    dataType: m_DataType,   //Expected data format fserver                  
    processdata: m_ProcessData, //True or False
    crossdomain: true,    
    contentType: "application/json; charset=utf-8",             
    success: function (msg) {   //On Successfull service call                      
        ServiceSucceeded(msg);
    },
    error: function (jqXHR, textStatus, errorThrown) {
        ServiceFailed("jqXHT: " + jqXHR.result + "Text Status: " + textStatus + " Error Thrown: " + errorThrown );
    } // When Service call fails              
});
}

The IDashboardWCFService Interface looks like this:

[ServiceContract]
public interface IDashboardWCFService
{
    [OperationContract]
    [WebInvoke(UriTemplate = "GetStats", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
    Dictionary<int,List<StatValue>> GetStats(DateTime getFromDate, List<int> getValueList);

    [OperationContract]
    [WebGet(UriTemplate = "GetStatTypes", ResponseFormat = WebMessageFormat.Json)]
    List<StatType> GetStatTypes();
}
  • 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-09T23:48:55+00:00Added an answer on June 9, 2026 at 11:48 pm

    Seems like you are trying to perform a cross domain web service call via $ajax method. In that case your m_dataType value should be "jsonp" rather than "json".

    Similar question here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why do I get a 400 - bad request error using the following URL?
I have a simple resftul wcf service. The .svc file looks like this <%@
When trying to install gems I run into Bad Request 400 error when it
I'm getting a The remote server returned an error: (400) Bad Request error when
I've been trying to get a json response from google's geocoding service. I'm using
Can optimizers get rid of bad uses of spatial locality? I'm maintaining some code
I seem to get an EXC_BAD_ACCESS error when I select a cell in my
We have some applications that sometimes get into a bad state, but only in
Is it a bad practice to mix GET and POST? (note this is in
Many a times I get the error EXC_BAD_ACCESS and my application terminates and I

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.