5 Replies Latest reply on Apr 3, 2015 8:08 PM by Ramesh Reddy

    Calling a procedure(requiring multiple query parameters via OData/RestEasy) performing another REST call to a remote system

    Fabio Salvarezza Newbie

      Hi guys,

      I hope you can help me with this as I do not seem to find any clear solution to this problem anywhere in the Internet and so it would be great if anyone could share some knowledge or experience on how to integrate Jboss DV with rest web services. A little background to start with, I have a Spring application on a remote server which exposes some REST endpoints performing CRUD operations on a Postgresql database hosted on the same machine and I have another Java application on another remote system which  captures some user input via HTML form and sends it to an underlining Java application via a Rest POST with JSON, this input should be passed to a procedure on the Teiid layer(via OData or Rest) which then performs a Rest call to the remote Spring application causing that input to be inserted in the Postgresql. In Teiid Designer I created a new REST Web Service source using the wizard available from the import menu which created a new source and view model containing a procedure to perform the Rest call to the remote Spring app with parameters passed to the procedure. If I preview the data within Teiid Designer passing parameters to the procedure everything works fine and it returns the three values in the Json response correctly but the problem is I don't know how to expose the procedure outside so that the Java layer can pass input parameters to the procedure on the Teiid layer. I followed these resources:

      How to Consume a JSON REST Web Service in Teiid Designer

      https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Data_Virtualization/6.1/html/User_Guide/chap-Metadata-specific_Modeling.html#sect-Web_Services_War_Generation

      https://access.redhat.com/sites/default/files/attachments/consumerest-ws-datasource_version2.pdf

       

      But I do not seem to figure how to pass multiple query parameters to this procedure via a Rest call to the Teiid layer out, all the examples I found all mention one parameter, I need to pass 6 of them, and even if I pass one it still does not work. I am definitely missing something but I don't know what as the official documentation is not helping at all. Therefore I would be extremely grateful if anyone could help with this or could point to some helpful resource for me to read further.

       

      Thanks very much in advance.

       

      Best Regards

       

      Fabio