11 Replies Latest reply on Mar 20, 2013 11:13 AM by Matej Plch

    How to create VDB from WS resource in embedded mode?

    Matej Plch Newbie

      I'm trying to get working embedded Teiid with XML Rest resource.

      I used resource from this dissussion:

      https://community.jboss.org/thread/201199?start=0&tstart=0

       

      So bassically, the definition of VDB table should be:

       

      SELECT

              long_name AS long_name, short_name AS short_name, type AS type

          FROM

              (EXEC geocode.invokeHttp('GET', null, 'http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true')) AS f, XMLTABLE('/GeocodeResponse' PASSING XMLPARSE(DOCUMENT result) COLUMNS long_name string PATH 'result/address_component/long_name/text()', short_name string PATH 'result/address_component/short_name/text()', type string PATH 'result/address_component/type/text()') AS A

       

      The thing is, that I don't know where to put it into my code (taken from Teiid embedded example):

       

      https://gist.github.com/matejuh/5196313

       

      I tried to set it as model schema, but it's not working.

       

      xmlModel.setSchemaText("SELECT" +

              "long_name AS long_name, short_name AS short_name, type AS type" +

               " FROM " +

              " (EXEC Csm.invokeHttp('GET', null, 'http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true')) AS f, XMLTABLE('/GeocodeResponse' PASSING XMLPARSE(DOCUMENT result) COLUMNS long_name string PATH 'result/address_component/long_name/text()', short_name string PATH 'result/address_component/short_name/text()', type string PATH 'result/address_component/type/text()') AS A");

       

      How to get it working?

       

      Thanks.