-
15. Re: 401 Unauthorized in REST Web Service Source
vijayjose Oct 14, 2017 12:35 AM (in response to shawkins)Steven,
It worked,But still execution of vdb failing with 401.
Attaching server.log
-
server.log.zip 53.5 KB
-
-
16. Re: 401 Unauthorized in REST Web Service Source
rareddy Oct 14, 2017 9:32 AM (in response to vijayjose)Then you need to figure out else is needed by your web service to authenticate. Any other headers etc. If you have any wire sniffing tools Wireshark/TCPMon you can see what Teiid is sending then fix it accordingly.
Ramesh..
-
17. Re: 401 Unauthorized in REST Web Service Source
vijayjose Oct 17, 2017 6:45 AM (in response to rareddy)Ramesh,
This is the only header required.
With this header i am getting success (200) in preview-data (procedure) and in another 1 application.
It is giving 401 only after creating vdb.
-
18. Re: 401 Unauthorized in REST Web Service Source
rareddy Oct 17, 2017 12:10 PM (in response to vijayjose)The only thing you can do now is watching the http traffic to make sure header is being sent. You can also enable CXF logging to see the same. See the section "All CXF Usage" at https://teiid.gitbooks.io/documents/content/admin/Web_Service_Data_Sources.html
Ramesh..
-
19. Re: 401 Unauthorized in REST Web Service Source
vijayjose Oct 20, 2017 12:31 AM (in response to rareddy)Ramesh,
The token value is not passing through the Header
Headers: {User-Agent=[Teiid Server], Content-Type=[text/xml; charset=utf-8], Accept=[*/*]}
attaching server.log
-
server.log.zip 44.2 KB
-
-
20. Re: 401 Unauthorized in REST Web Service Source
rareddy Oct 20, 2017 9:03 AM (in response to vijayjose)If you want to attach your VDB and also mention the Teiid Server version, then I can take a look why there is a discrepancy. I suspect, something still wrong with how you are sending your authorization header.
Ramesh..
-
21. Re: 401 Unauthorized in REST Web Service Source
vijayjose Oct 24, 2017 12:17 AM (in response to rareddy)-
proc.vdb.zip 37.4 KB
-
-
22. Re: 401 Unauthorized in REST Web Service Source
rareddy Oct 24, 2017 5:53 PM (in response to vijayjose)Vijay,
Sorry it taking long, but my local Designer got wiped out and having little difficulty looking at your VDB. Using your Designer can you convert this into a Dynamic VDB and attach it, that way I do not need to reinstall Designer right now.
Thanks
Ramesh.. -
23. Re: 401 Unauthorized in REST Web Service Source
vijayjose Oct 26, 2017 12:35 AM (in response to rareddy)Ramesh,
Attaching Dynamic vdb and server.log
-
server.log.zip 61.4 KB
-
test-vdb.xml.zip 888 bytes
-
-
24. Re: 401 Unauthorized in REST Web Service Source
rareddy Oct 26, 2017 2:14 PM (in response to vijayjose)Vijay,
I took your VDB deployed on my latest 10.CR2 version of Teiid, and then using a JDBC client I executed
EXEC proc();
The following log output I saw on the console
--------------------------- ID: 1 Address: http://google.com/ Http-Method: GET Content-Type: text/xml; charset=utf-8 Headers: {X-Auth-Token=[9af7d953-f5a3-4a89-8126-60177269708a], User-Agent=[Teiid Server], Content-Type=[text/xml; charset=utf-8], Accept=[*/*]} --------------------------------------
Note above http://google.com is dummy site to replace your service endpoint. So, I do see the header.
Ramesh..
-
25. Re: 401 Unauthorized in REST Web Service Source
vijayjose Oct 27, 2017 12:12 AM (in response to rareddy)Ramesh,
This is the output for me
ID: 1
Address: http:(service endpoint)
Http-Method: GET
Content-Type: text/xml; charset=utf-8
Headers: {User-Agent=[Teiid Server], Content-Type=[text/xml; charset=utf-8], Accept=[*/*]}
Attaching the log in console
The header is present correctly in procedure and also in the starting portion of execution of vdb.
Then why is it showing 401.
-
log.zip 2.5 KB
-
-
26. Re: 401 Unauthorized in REST Web Service Source
shawkins Oct 27, 2017 3:45 PM (in response to vijayjose)Vijay,
> Then why is it showing 401.
I cannot reproduce this either using the vdb.xml. Based upon your -vdb.xml, or something similar the headers are passed. I tried this on both Teiid 9.3.1 and master/10.0.0.CR3. And with or without the metadata tag defining the invokeHttp procedure (if you omit that, the metadata will be pulled from the translator).
However using the .vdb file reproduces the issue.
Unfortunately several versions of designer used metadata definitions for the invokeHttp method that were not recognizable, see [TEIIDDES-2329] WS translator Procedure definition defined in correctly - JBoss Issue Tracker This is a variation of that issue.
What version of designer are you using?
In short what is happening is that RESULT parameters are always expected to be in position 0 for a procedure - matching to the JDBC calling semantics of "? = EXEC ...", however the parser is flexible and will allow the RESULT parameter to appear anywhere and will reorder accordingly. This does not occur for metadata coming from designer, thus the parameters no longer match positions at runtime. I can't find the doc note on the ddl result param behavior, so I'll probably need to add one.
Steve
-
27. Re: 401 Unauthorized in REST Web Service Source
vijayjose Oct 30, 2017 1:58 AM (in response to shawkins) -
28. Re: 401 Unauthorized in REST Web Service Source
shawkins Oct 30, 2017 9:59 AM (in response to vijayjose)> How can i solve this issue?
The simplest workaround would be to change the web service physical model invokeHttp procedure in designer so that the result is the first parameter. The runtime will then understand the position of the header parameter with the metadata that designer provides regardless of whether it's a -vdb.xml or a .vdb.
> Should I change the designer version or any other patches are currently available ?
There looks to be an active support case on this as well. The will likely be patches made that will applied to both community and product versions. The Designer folks will need to weigh in though on the approach they want to take to fix this.
-
29. Re: 401 Unauthorized in REST Web Service Source
blafond Oct 30, 2017 11:16 AM (in response to shawkins)I would recommend upgrading to Designer 11.1. There was work done on cleaning up Designer's procedure definition logic with expected Teiid runtime definitions, especially exporting/importing from -vdb.xml.