Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I tried all what is explained in the posts found in the forum but nothing works...
I want to call a REST WS with a JSON body like :
{
"format": "application/json",
"system": "euro",
"companyId": "1234",
"customerId": "CH003",
"filter": {
"boxNumber":"331135738"
}
}
Test n°1 : with Component tRestClient
Result
Test n°2 : with Component tRest
Result
<html><body><h1>Whitelabel Error Page</h1>
<p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>
<div id='created'>Tue Feb 01 02:59:48 EST 2022</div>
<div>There was an unexpected error (type=Internal Server Error, status=500).</div>
<div>Servlet execution threw an exception</div>
</body></html>|500
Thanks for any help !
You are nearly there. There is an extra step which you need to keep in mind. The tRestClient has a fixed inbound schema (body and string). For JSON, you need to send the data to the "string" column. The "body" column is for XML documents. The way to go about this is to first make sure your JSON String is perfect. To do this, output from the tWriteJSONField to a tLogRow and take a look. This needs to be precisely as specified by the API. Once you are happy with that, it needs to be sent to the "string" column.
If that doesn't get you any closer, could you post the API specification so that we can look at that? Web Services can be pretty tricky to get right sometimes.
You are nearly there. There is an extra step which you need to keep in mind. The tRestClient has a fixed inbound schema (body and string). For JSON, you need to send the data to the "string" column. The "body" column is for XML documents. The way to go about this is to first make sure your JSON String is perfect. To do this, output from the tWriteJSONField to a tLogRow and take a look. This needs to be precisely as specified by the API. Once you are happy with that, it needs to be sent to the "string" column.
If that doesn't get you any closer, could you post the API specification so that we can look at that? Web Services can be pretty tricky to get right sometimes.
Thanks for your help.
It's running fine.