Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to call a simple 'Hello World' REST API via the GET verb. The API is only expecting one HTTP Header, Accept application/json which i've set in the advanced settings of my tRestClient component. However, Talend seems to automatically create another entry for the contents of the Accept Type dropdown. When i run I’m getting HTTP 406 Not Acceptable back because the API is not expecting 2 headers.
I've tested this API with other software and it responds correctly so it must be down to Talend configuration. Anybody know a way around this or had a similar issue they've resolved?
I have screenshots but unfortunately they're being blocked by my firewall at work. Sorry
Thanks
Matt
OK, I would recommend just reinstalling Studio. I have seen this sort of problem happen quite a few times. It is probably quicker to reinstall than try to hunt through the broken install. Ensure you have backed up your project if you are not using the Enterprise Edition.
Thanks, I did try just setting the accept type to JSON but the API i'm calling is expecting something like application/sofwarename1.0json rather than just JSON so i get a 406 error again.
I'm currently trying to use t_Rest as this doesn't set the accept type for you but i'm getting errors with the Jersey files
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey.client cannot be resolved to a variable
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey.api.client.Client cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
com.sun.jersey cannot be resolved to a type
when i run fiddler to intercept what Talend is sending i can see that the tRestClient component is indeed sending 2 accept headers (ignore the application/xml in the screenshot, i forgot to take a screenshot when i tried json, the result is the same, 2 headers).
Accept-Type JSON in the drop down is actually "application/json". It looks like you may have selected XML there. Have you tried setting this to JSON and not adding your own header in the Advanced settings tab?
Sorry that was the wrong screenshot. I did set it to JSON and get the same (Accept: application/JSON, application/*****+json. I have also tried removing what i've set in Advanced settings but still get the 406 error. I can get a response in Postman which is leading me to believe it is something with the component config in Talend.
What file were you sending there? I think we are going around in circles. I thought you wanted to send a file somewhere, but that does not look like you are sending anything other than a JSON String in the body of the message. What exactly needs to be sent?
Sorry for the confusion, i'm new to web services and may not be using the correct terminology. I've taken a screenshot of the API i'm trying to call and how i've configured tRestClient.
Sorry, my mistake. I am trying to help two people with web service issues and I got confused as to who I was talking to