2 Replies Latest reply on Sep 19, 2014 9:20 AM by gadeyne.bram

    Query REST service with parameters

    gadeyne.bram Master

      Hi,

       

      I'm using Teiid designer 8.5. I've followed the instructions on Chapter 5. Importers to add a Rest webservice.

       

      Everything works fine when I use a URL that already contains filled out parameters. The wizard created a Model xmi and a ViewModel xmi containing one table based on the following statement.

       

      SELECT

              A.X1 AS X1, A.X2 AS X2, A.X3 AS X3, A.X4 AS X4, A.X5 AS X5

          FROM

              (EXEC EpisodeService.invokeHttp('GET', null, 'http://server/service/param1/param2/param3', 'TRUE')) AS f, XMLTABLE('/contacts' PASSING XMLPARSE(DOCUMENT f.result) COLUMNS X1 string PATH 'contact/X1/text()', X2 biginteger PATH 'contact/X2/text()', X3 string PATH 'contact/X3/text()', X4 string PATH 'contact/X4/text()', X5 string PATH 'contact/X5/text()') AS A

       

      Is there also a way to fill in the contents for param1, param2 and param3?

       

      I tried creating a virtual procedure using almost the same contents and some parameters. The idea was to replace the string url. But then I get this error message "The query defining a virtual procedure can only be of type Virtual procedure."

       

      With kind regards

      Bram