Xdataclient and server exception

I have servicefunction
function newtaxfreedocument(taxfreeDocumentdata: TTravellerInvoice): String;
TTravellerinvoice is an entity.

When service raises exception xdata client can't handle it correctly.
I get error exception cannot convert TJElement
Xdataclinet is newest 5.3.0.1 version

This is respose returned in this case is

HTTP/1.1 404 Not Found
Content-Length: 133
Content-Type: application/json
Server: Microsoft-HTTPAPI/2.0
xdata-version: 2
access-control-allow-origin: *
Date: Mon, 17 Jan 2022 14:59:49 GMT

{
    "error": {
        "code": "Exception",
        "message": "total amount 75,82 doesn't match to sum of vats  0,00"
    }
}

The response seems ok, and the JSON seems to be valid. Are you pretty sure that is the response it's trying to process?
Are you able to consistently reproduce the issue, and send us some code that we can reproduce on our side?

While writing simple test, I noticed that this error occurss only if exception code is 404.
Exception if forwarded to client correctly if code is something else.

I can live with this now, actually 404 was wrong code to my server at this point. should have been 406.

1 Like