Skip to content Skip to sidebar Skip to footer

Bad Request When Making A Call To A Rest Wcf Webservice

I'm writing an Android application and a WCF REST service to call from it. When I try to make a call to a certain method I receive an 'Bad Request' message. In a previous test I ma

Solution 1:

Actually its not a problem with DateTime filed in your model classes but it is something from .NET.

There is no standard JSON format of Date.This is why you are facing this problem. There are two solutions for this:

  1. Use JSON.NET.

  2. Or, set the type of your date to String in model class and later on when you receive json, parse it into DateTime.

See these links:

The Right JSON Date Format and Incompatible date format in JSON from response.

Solution 2:

I discover that problem is the DateTime new fields in model classes of service.

Post a Comment for "Bad Request When Making A Call To A Rest Wcf Webservice"