Ask a Question

unexpected 400 bad request response

SOLVED
moolickj
New Contributor

unexpected 400 bad request response

Hi,

 

I'm attempting  a POST Request using SoapUI 5.3.0 but keep getting a 400 Bad Request response.

The annoying thing is, is that the exact same request works in a different API testing tool. Same Endpoint and resource.

 

The following headers are supplied in both SoapUI and other API Testing tool:

Content-Type: application/json
Accept: application/json

 

Below is the request body:

{
  "ProcessingStartTime": "2017-12-12T08:44:33.7437679+00:00",
  "ProcessingEndTime": "2017-12-12T08:47:06.2027702+00:00",
  "IssuesCommonData": {
    "ClaimId": "00000",
    "CwClaimId": "fgsfdgs546456",
    "ClientClaimId": "gfhgf546456",
    "FacilityCwId": 1,
    "CeCwId": 1,
    "PayorBucket": "Commercial",
    "DateOfService": "2017-01-02T00:00:00",
    "DischargeDate": "2017-10-09T00:00:00",
    "BillType": "131",
    "CwClaimVersion": 1,
    "Mrn": null,
    "CwDept": "fdssgsdfs"
  },
  "Issues": [
    {
      "Id": "fggfdfg433tdfg43",
      "IssueTypeName": "test",
      "IssueTypeId": 5,
      "IssueId": "fgs5464hhgfh",
      "InstanceId": "fgs5464hhgfh",
      "IssueCategory": "fgdfgdhfdgdg",
      "Description": "test",
      "Impact": 0.0,
      "GrossImpact": 10.0,
      "ActualImpact": null,
      "CmsPercentage": null,
      "CwClientPercentage": null,
      "CwDept": "dgdg",
      "DateCreated": "2017-07-13T13:29:56.277Z",
      "HcpcsCode": "fgdg",
      "Modifiers": "",
      "RevenueCode": "gdgfgdf",
      "PrimaryDiagCode": "4535ggfdg",
      "IssueData": {},
      "ExclusionTypeId": null
    }
  ],
  "CwClaimId": "fgsfdg563546",
  "CwClaimVersion": 1
}

 

In SoapUI I get the following response:

HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Content-Length: 127
Content-Type: application/json; charset=utf-8
Expires: -1
Access-Control-Allow-Origin: *
Date: Tue, 12 Dec 2017 14:35:28 GMT

{
  "message": "The request is invalid.",
  "modelState": {
    "claimDto": [
      "An error has occurred."
    ]
  }
}

 

In the other API Testing Tool using the exact same details I get a 200 OK.

 

Can someone shed some light on this. Is there a setting in SoapUI I need to change?

 

Thanks.

2 REPLIES 2
testhrishi
Frequent Contributor

Check your Raw request and also make sure you are using right method

Thanks, however that was not the issue. Found out what it was. The above request body was scrambled, my original request body had UTF-8 'Special Characters' in one of the fields. SoapUI cannot not deal with this and Postman can. However to bypass the issue I removed the characters.

 

This thread can be closed.

 

Thanks.

cancel
Showing results for 
Search instead for 
Did you mean: