[
https://issues.jboss.org/browse/TEIIDDES-2163?page=com.atlassian.jira.plu...
]
Ramesh Reddy updated TEIIDDES-2163:
-----------------------------------
Attachment: RestFix.png
{code}
CREATE VIRTUAL PROCEDURE
BEGIN
DECLARE STRING VARIABLES.qp =
QUERYSTRING('http://ws.cdyne.com/delayedstockquote/delayedstockquote....;,
ViewModel.getStockPrice.symbol AS StockSymbol, 0 AS LicenseKey);
SELECT A.price AS price FROM (EXEC SourceModel.invokeHttp('GET', null,
VARIABLES.qp, 'TRUE')) AS f, XMLTABLE(XMLNAMESPACES(DEFAULT
'http://ws.cdyne.com/'), '/decimal' PASSING XMLPARSE(DOCUMENT f.result)
COLUMNS price double PATH 'text()') AS A;
END
{code}
REST based importer design is wrong
-----------------------------------
Key: TEIIDDES-2163
URL:
https://issues.jboss.org/browse/TEIIDDES-2163
Project: Teiid Designer
Issue Type: Bug
Components: Import/Export
Affects Versions: 8.3.2
Reporter: Ramesh Reddy
Priority: Critical
Attachments: RestFix.png
OK, I tried the REST based import wizard for the first time today since none of WSDL
based solutions worked for me for those issues see TEIIDDES-2162
I believe the REST based importer is designed to generate wrong artifacts. It was
designed same as XML file, where a given XML file, Teiid designer aids the user to come up
with a "view". The difference between a XML file and REST based service is, a
REST service will have input parameters. It is the input parameters that makes it a
service, otherwise it just a remote URL.
Take for example WSDL based SOAP importer also gets XML as result, but it is designed to
produce a procedure to capture the input parameters and return tabular result. REST based
service MUST be doing exact same thing.
Teiid invokeHTTP does work with relative and absolute URLs, Teiid even has
"querystring" function
https://docs.jboss.org/author/display/TEIID/BNF+for+SQL+Grammar#BNFforSQL...
to help build the query parameter part of the URL, then you just need to concat it with
the URL to make the whole.
IMO the way we have does not serve any real usecase, like mine where I was trying to read
a quotes from REST service
http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx/GetQuickQuot...
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)