1 Reply Latest reply on Nov 14, 2016 4:38 PM by rareddy

    REST services using embedded TEIID

    david.b.martin

      I have TEIID working like a champ using JDBC connections to execute SQL and retrieve result sets.

       

      I would like to setup my embedded TEIID as a REST service.  I want to be able to POST sql in JSON format, and get back results in JSON.

       

      I did find some documentation:  REST Service Through VDB - Teiid 8.4 - Project Documentation Editor

       

      But what happens to the generated WAR if you're not running JBoss?   I've played with a few different VDBs, but I can't seem to get a REST service of any kind, including the GET shown in the example...

       

      Are there any more VDB examples I should use?  How do I manually generate a WAR that I could, for example, embed in a Jetty instance I have handy...

       

      Thanks for your help.

       

      David

        • 1. Re: REST services using embedded TEIID
          rareddy

          David,

           

          Currently this is WildFly container enabled feature and does not work as is in "embedded". There are lot of assumptions this makes, like using jaxrs framework, being in the JBoss container, being able to deploy the generated WAR file etc. Being able to submit an arbitrary SQL and getting response in JSON is not what this does anyway. If the VDB's procedures are decorated with metadata specific to REST interface, it exposes that procedure as REST service. So, I see what you want and what it does is different.

           

          This morning I committed change to explicitly call a method to generate a WAR file, see teiid/RestASMBasedWebArchiveBuilder.java at master · teiid/teiid · GitHub

          but this needs to be wired in, I am sure it works in jetty or not. Take a look.

           

          Have you seen OData? OData is in same situation, but that may be what you are looking for IMO, which does ad-hoc queries and JSON responses etc.

           

          Ramesh..