1 Reply Latest reply on Dec 22, 2017 1:22 PM by Steven Hawkins

    Model Remote XML File as a Data Source using Teiid Admin API'S

    Kulbhushan Chaskar Master

      Hi,

       

      I am using Teiid Admin API 9.1.3 and WildFly 10.0.0. I need to Remote XML File as a datasource, While searching on internet I can across post: Model Remote XML File Data Source - Teiid Examples - Project Documentation Editor  , Its for using Teiid Designer, Could you please suggest me the similar steps using Teiid Admin API's.

      So here I am mainly looking for:

      1.     How to make connection with remote XML file?

      2.     Do we need to provide schema definition in VDB file or Teiid by default read XML file and provide schema structure?

       

      Thanks,

      Kulbhushan Chaskar

        • 1. Re: Model Remote XML File as a Data Source using Teiid Admin API'S
          Steven Hawkins Master

          > How to make connection with remote XML file?

           

          You need to use the Webservices resource adapter.  Adding through the admin api could look like:

           

          Properties p = new Properties();
          p.setProperty("class-name", "org.teiid.resource.adapter.ws.WSManagedConnectionFactory");
          p.setProperty("EndPoint", "http://...");
          admin.createDataSource("myWebse:rviceDS", "webservice", p);

           

          > Do we need to provide schema definition in VDB file or Teiid by default read XML file and provide schema structure?

           

          You always need a VDB.  You'll use the Webservices or WS translator with the resource adapter.  How you expose the XML from there is up to your needs.  If you want it as tabular data then you'll want a view or procedure that reads processes the xml - probably with the XMLTABLE table function.