Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
As the title says I'm trying to parse data from a WordPress/WooCommerce API.
I use a fresh install downloaded this weekend from the official site.
When testing my connection with postman using settings below i get the JSON back with all the orders as expected.
I do have to mention that i have to press get twice in postman to get the desired JSON results.
url https://{domainname}/wp-json/wc/v3/orders
Query parameters with off course correct values:
consumer_key
consumer_secret
After these settings all i needed to do was turn off SSL certificate verification in Postman options.
So i used the same values in Trestclient added a Tmap with error logs behind it that intercept any 3xx, 4xx or 5xx errorCode and it seems so far it works as predicted. (i found a YouTube guide for it ).
So now i wanted to parse the response so i can do something with the retrieved JSON order data, but no matter what i try i keep getting compiling errors like shown below. i marked the text red that is indicated to be the problem, would be nice if someone could point me in the right direction
row1.statusCode = webClientResponseStatus_tRESTClient_1; { Object responseObj_tRESTClient_1 = responseDoc_tRESTClient_1; if (responseObj_tRESTClient_1 != null) { if (responseClass_tRESTClient_1 == String.class) { row1.string = (String) responseObj_tRESTClient_1; } else { routines.system.Document responseTalendDoc_tRESTClient_1 = null; if (null != responseObj_tRESTClient_1) { responseTalendDoc_tRESTClient_1 = new routines.system.Document(); responseTalendDoc_tRESTClient_1 .setDocument((org.dom4j.Document) responseObj_tRESTClient_1); } row1.body = responseTalendDoc_tRESTClient_1; } } }
After testing a bit more i think it's definitely the response handling that has some wrong configurations.
When using only the error output from the Trestclient into a Tmap that has 2 columns
errorCode and errorMessage and 4 filters that each sends to a Tlog depending on the errorCode starting with 3, 4 or 5 or any other using this kind of filter;
String.valueOf(row2.errorCode).startsWith("3")
When i don't attach a response output to the Trestclient it works. first try ends up in 500 error and second 1 gets succesfull and won't be outputted since there is nothing connected to the response output of the Trestclient.
No matter what i tried to connect to the output of the Trestclient component the same error keeps popping up on building the job.
I suspect it has something todo with my schema or headers and maybe even query parameters.
I added some screenshots of the settings, hope someone sees what i'm doing wrong and can send me in the right direction.
Trestclient settings
Row1 scheme
Tlogrow settings
Advanced settings
Thanks in advance for the possible answers