4 Replies Latest reply on Apr 8, 2010 10:07 AM by dhryvastov

    Question regarding Restlet Web Services as data provider

    dhryvastov

      Hello –

      I have a question regarding using Rest Web Services as data provider. I found the information that Teiid allows to use Rest Web Services as data provider and user has to use XML Schema as Relational Source Model in this case. In my case the response from the Rest Web Services (I use Restlet Framework 1.1.5) can have several available formats depending on the input parameters: Xml, Json, HTML or InputStream. Is it possible to use Rest Web Services as data provider in my case?

      Thanks in advance!

        • 1. Re: Question regarding Restlet Web Services as data provider
          jdoyle

          Hi Denys,

           

          Teiid can consume XML documents over the HTTP protocol.  This is the 'normal' was to do REST services, but REST adds a bunch of additioal concepts on top of XML over HTTP.  Teiid, and specifically the XML Relational HTTP connector, don't understand any of the addional rules about REST.  For instance, a REST service with information about People and Addresses will typically have a URL in a Person instance to link to the Address instance.  The connector does not understand this, for the connector the URL is just text.

           

          What we do offer is an importer (XML Schema as Relational Source Model) in the Designer that can convert an XSD to a relational model, just like the SOAP model you built for the SOAP weather service.  The Teiid XML Relational HTTP connector can be cound to this model and provides options to fetch the XML from the HTTP source via XML request document, or URL query params.

           

          If there are parameters that you need to send to the service, you will need to add them to the model by hand, because the XSDs that you might have or will have to create for the importer do not have any notion of what a request might look like.

           

          ~john

          • 2. Re: Question regarding Restlet Web Services as data provider
            dhryvastov

            Thank you, John!

            Several more quick question:

            1) should I be able to Preview Data after creating Model and Connector or I have to create VDB first?

            2) is there a way to add more than 1 parameter during creating connector?

            Thanks,

               Denys

            • 3. Re: Question regarding Restlet Web Services as data provider
              jdoyle

              Let's try again........

               

              You will have to create a VDB in this scenario.  All of the *-Relational connectors require this.  Internally, the query is satisfied by breaking it into several single table queries and and the join criteria on ResponseIn is the way we get the XML document to each query.

               

              You can add as many parameters as you want to the request table.

               

              ~john

              • 4. Re: Question regarding Restlet Web Services as data provider
                dhryvastov

                Hi John -

                First fo all, thank you for your reply.

                I was able to use REST Web Services as data provider using XML Schema as Relational Source Model but only in the case if I do not have input parameters. For instance the URL to my REST Web Service looks like http://localhost:8085/search/developers/teiid.

                Now I want to use the Web Service with the following URL http://localhost:8085/search/developers/teiid?language=java&expirience=5&city=kiev. I can't find the place to add these input parameters. I tried to add columns into the REQUEST table, but I do not see any result. Is it a right place for adding these parameters?

                Thanks,

                     Denys