-
1. Re: HTTP header is not set in invokeHTTP
rareddy Apr 2, 2018 9:49 AM (in response to sanjay_chaturvedi)see this is of any help Teiid connect to REST DataSource with HTTP Header
-
2. Re: HTTP header is not set in invokeHTTP
sanjay_chaturvedi Apr 3, 2018 2:13 PM (in response to rareddy)Thanks Ramesh, but I had already visited that link.
That was the issue for authorization token while in my case authorization token is passed but not the content type header. authorization is set in standalone.xml as resourceadapter as AuthUserName. But Content-Type , I am passing as invokeHTTP parameter. See below the screen shot I made two changes in generated invokeHttp :1 : made headers as IN parameter and 2. set default value as {Content-Type:application/json}
I am also attaching TEST.vdb, I manually tried to edit vdb to ensure that there is no quote related issue(like in that post).
I tried following combinations to ensure that this header is passed but no luck, surprisingly rest of the params are passed :
Here is logs:
Address: <URL>
Http-Method: PUT
Content-Type: text/xml; charset=utf-8
Headers: {User-Agent=[Teiid Server], Content-Type=[text/xml; charset=utf-8], Authorization=[AUTHTOKEN], Accept=[*/*]}
Payload: {"expr1":"{\"select\":{\"from\":[\"TABLE\"]}}"}
here is query I tried:
EXEC TalendSrc.invokeHttp(action => 'PUT', request => jsonobject('{"select":{"from":["TABLE"]}}'),endpoint=>URI,Strea=>TRUE,
headers => JSONOBJECT('application/json' AS "Content-Type"))
Other combinations :
--'{"Content-Type":"application/json","Accepts":"application/json"}'
--'{"\"Content-Type\"":"application/json","\"Accepts\"":"application/json"}'
Please assist. Thanks.
-
TEST.vdb.zip 17.0 KB
-
-
3. Re: HTTP header is not set in invokeHTTP
rareddy Apr 3, 2018 3:11 PM (in response to sanjay_chaturvedi)I do not believe the default value for the clob is checked for the value. I suggest you provide that explicitly in your SQL query that is using the invokeHTTP. I can not open .VDB file and check contents without going through somewhat lengthy conversion (for me) if you can show the XML/DDL version that would save me time
Ramesh.. -
4. Re: HTTP header is not set in invokeHTTP
sanjay_chaturvedi Apr 4, 2018 2:20 AM (in response to rareddy)Thanks for looking into this. Well, this VDB is not long though, as i created this for you only It has limited meaning ful information contained in two Files : TalendSrc.xmi and vdb.xml.
TalendSrc.xmi itself contains "only one" virtual proc invokeHTTP. Attaching both the files.
-
vdb.xml.zip 503 bytes
-
TalendSrc.xmi.zip 15.3 KB
-
-
5. Re: HTTP header is not set in invokeHTTP
rareddy Apr 4, 2018 10:36 AM (in response to sanjay_chaturvedi)Sanjay,
What I was looking for is XML/DDL version of the VDB not crack open the .vdb and give me the individual files. Can you generate the XML/DDL version using Designer on the VDB Management editor.
Ramesh..
-
6. Re: HTTP header is not set in invokeHTTP
rptmat57 Apr 4, 2018 8:52 PM (in response to sanjay_chaturvedi)I just tried this:
headers => '{"Content-Type":"application/json","Accepts":"application/json"}'
and it worked fine
-
7. Re: HTTP header is not set in invokeHTTP
rptmat57 Apr 4, 2018 9:03 PM (in response to rptmat57)I might be wrong, but it seems maybe you are trying to do this in the wrong place.
you are editing the invokehttp source file, whereas I think the headers go in the transformation procedure (from invokehttp to your view model)