9 Replies Latest reply on Apr 24, 2010 12:09 PM by Duncan Doyle

    Creating web service from Teiid Designer

    Nandini Mattapalli Newbie

      I'm trying to create a web service to submit queries to vdb created from Teiid Designer. VDB has relational (source and view) models. When I choose the option Modeling->Create Web Service, it is creating xxx_Input.xsd, xxx_Output_View.xmi, xxx_Output.xsd and xxx_WS.xmi but does not give me any details like url, step to create login credentials etc. I'm using version 6.2.

       

      Does Teiid Designer 6.2 provide this functionality? Is there any documentation to go over the steps to do so?

       

      Any help will be greatly appreciated!

       

      Thanks

        • 1. Re: Creating web service from Teiid Designer
          Ted Jones Master

          Nandini,

           

          The web service models pre-6.x were exposed via a web service implemented in Axis2. This web service was deprecated and eventually removed in the 6.0 release. In order to utilize the web service models, you will need to add them (and any other required relational models) to your VDB. There will be a WSDL file generated and added to your VDB archive file. Take this WSDL file and generate a webservice using JBossWS, Metro, etc. You will need to add an appropriate endpoint value in the WSDL depending upon your deployment configuration.

           

          The soapAction value will contain your procedure name. Your web service should execute this procedure (using any passed in parameters) against a valid Teiid connection (also created in your web service).

           

          Please let me know if I can assist further in any way.

           

          Thanks,

          Ted

          • 2. Re: Creating web service from Teiid Designer
            Ramesh Reddy Master

            Nandini,

             

            Please also note that in 7.x releases, Teiid team is working towards providing more tooling to around creating a web service using  technologies in the JBoss technology stack. If you are interested please follow https://jira.jboss.org/jira/browse/TEIID-673

             

            Meanwhile suggestion posted by Ted works quite well. Let us know how we can help.

             

            Thanks


            Ramesh..

            • 3. Re: Creating web service from Teiid Designer
              Nandini Mattapalli Newbie

              Ted,

               

              Sorry I took me a while to respond back. I tried to create a web service using the WSDL from Teiid Designer but am getting the following error. I'm trying to create Axis (1.4) webservice in Tomcat 5.5.26.

               

              $ java org.apache.axis.wsdl.WSDL2Java TeiidTestService.wsdl
              WSDLException (at /definitions/types/xsd:schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://www.metamatrix.com/metamodels/SimpleDatatypes-instance'.: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd: java.io.IOException: Server return
              ed HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
                      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
                      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
                      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
                      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
                      at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
                      at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
                      at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
                      at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
                      at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
                      at java.lang.Thread.run(Unknown Source)

               

                      at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
                      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
                      at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
                      at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
                      at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
                      at java.lang.Thread.run(Unknown Source)

               

              Appreciate your help,

              Nandini

              • 4. Re: Creating web service from Teiid Designer
                Ted Jones Master

                Nandini,

                 

                You may need to download the DTD locally and change the reference in the WSDL to point to the local location. The W3C server intentionally returns this code to decrease volume. You could also try disabling DTD validation. I don't *believe* the parser used by Axis2 fetches the DTD, so you could try switching clients as well.

                 

                Thanks,

                Ted

                • 5. Re: Creating web service from Teiid Designer
                  Duncan Doyle Newbie

                  Ted,

                   

                  Can you please tell me how I can access a Web Service created with Teiid Designer en deployed in Teiid server. I've been looking all over the web to find this info, but so far no luck.

                   

                  I've created a very simple Web Service Model from a MySQL database. Everything seems to work fine in Teiid Designer. I then export the VDB file to the Teiid server deployment directory and start the server. No errors appear in the log-file and the console says that the server started succesfully. I looked in the exploded VDB directory inside the deployment directory where I found the MetaMatrixDataServices.wsdl, which is the wsdl that describes the service I created in Teiid designer. However, the 'soap:address location' contains the value 'http://vdb.dataservice.metamatrix.com' (which obviously is not the correct endpoint :-)).

                   

                  Can you tell me what the correct endpoint of my Teiid Web Service is?

                   

                  Regards,

                   

                  Duncan

                  • 6. Re: Creating web service from Teiid Designer
                    Ted Jones Master

                    Hi Duncan,

                     

                    As I told Nandini above, the web service models pre-6.x were exposed via a web service implemented in Axis2 which is where the endpoint *used to* point to. This web service was deprecated and eventually removed in the 6.0 release. In order to utilize the web service models you created, take the WSDL file from the VDB and generate a webservice using JBossWS, Metro, etc. You will need to add an appropriate endpoint value in the WSDL depending upon your deployment configuration.

                     

                    The soapAction value will contain your procedure name. The way the Axis2 web service executed this procedure (using any passed in parameters) against a valid Teiid connection. You will need to implement a web service to emulate that behavior.

                     

                    We are implementing replacement functionality in the Teiid 7.* timeframe which will take advantage of the web service models and save you from all if this grunt work.

                     

                    Thanks,

                    Ted

                    • 7. Re: Creating web service from Teiid Designer
                      Duncan Doyle Newbie

                      Hi Ted,

                       

                      OK, I didn't understand that I had to write the Web service implementation myself and have it use the Teiid View model using JDBC. Thanks for the clarification.

                       

                      The Web Service Data Service feature is the core feature why I want to use Teiid, so I'll guess I'm gonna check the 7.0 M3. Has the Web Services feature already been implemented in that release? I'm also interested in REST support and saw that you guys are working on that as well. Is it save to say that you're going to provide similar features as the WSO2 Data Services platform?

                       

                      And a last question. One core feature I'm looking for in a Web Service Data Services platform is support for WS-AtomicTransaction. Will Teiid 7.0 provide support for Web service transactions (possibly using JBoss Transactions)?

                       

                      Thanks for the quick reply by the way.

                       

                      Regards,

                       

                      Duncan

                      • 8. Re: Creating web service from Teiid Designer
                        Ted Jones Master

                        The new web service implementation is not in MS3. It will be in a yet TBD MS. The initial release will at a minimum provide all the features the legacy web service provided (WSDL 1.1, WS-Security, HTTPBasic, other various WS-* support). REST and WS-AtomicTransaction support have been on our roadmap (especially since we are now using JBoss Transactions regarding the latter) and we intend to add both. I can't give you an exact timetable but I believe it will happen in a 7.* release. Both of these features are a high priority.

                         

                        Thanks,

                        Ted

                        • 9. Re: Creating web service from Teiid Designer
                          Duncan Doyle Newbie

                          OK, sounds good. I'll keep checking the release notes. Thanks for the information and again the quick reply.

                           

                          Regards,

                           

                          Duncan