WebRatio Mobile Platform Community edition - Restful request

06 Jul '17, 03:27 PM
21,259 Views
No Forum Badges

Hello,

I'm using the community edition of WebRatio Mobile Platform. I would like to ask about how to consume rest api from the mobile platform. 

From what I see, it should be through an action. Inside such action it should be defined an operation called "restful request response". I have checked the options for response and I saw there are two: JSON and text. 

My questions are next:

1- Is it possible to use "restful request response" for downloading files like images of pdf documents.

2- Or alternatively,  are there mobile units to perform downloads or uploads?

3- By the way, is there constraints or limitations about remote connections (like, doing a login with a backend or consume a rest service from the mobile side) due to the community edition?

Thanks!

 
x 0
Follow
Answer Answer at this question and get points!
Forum Hero - Level 9

Hi Emanuel,

first of all if you want to manage files (upload and download) you have to define blob as Type on the dedicated "file" Attribute available on your Class and expose the desired options (Read, Create, Update and Delete ). To upload or download files you can refer to the available and default methods of the Data Service (File Services) or you can prepare and invoke your custom Web Service methods.

You have to:

- Create your Class (e.g. myClass) and add the attribute blob (e.g. myFile) to this Class in the Domain Model available for the Data Service Project.

- Expose this Class through the "Data Services" node of the Domain Model available in the Data Service Project (enable for example all available operations Read, Create, Update and Delete)

- Perform the Domain Model Synchronization in order to export the Domain Model structure to the database

- Generate the Data Service project

If you are also creating a mobile app associated to your Data Service, the upload and download actions will be automatically performed by the mobile Synchronizer process. In fact you can use the usual Create, Update and Delete Components and the Synchronizer process will perform the related Web Service invocations and will update the remote and local data.

If you want to manually upload and download files through the Restful Request Response Components you have to manually invoke the specific methods exposed by the Data Service (see the content of the swagger.do page available in the generated Data Service project).

Anyway for more details about how to expose and invoke REST Web Services refer to the logic described in these guides:

https://my.webratio.com/learn/learningobject/exposing-rest-web-service-v-72

https://my.webratio.com/learn/learningobject/invoking-rest-web-service-v-72

 
x 1
Answer at this question and get points!

Related questions

Access wsdl in https aggiornamento fallito a causa di un errore interno Avvio chiamata dispositivo Bluetooth Cambiare dimensioni bottoni - Change button size Can not get generate and run option for DataService Project Cannot invoke method selectSingleNode() on null object Can't generate and run database or start tomcat server! CelsiusToFahrenheit Example Codigo QR com.webratio.rtx.RTXException: An error occurred dispatching the SOAP message Confirm dialog for mobile Could not create service Customize layout mobile platform Custom Unit and AJAX / SOAP Database connection, Host and Port number Database List is not showing up in App Emulator Data Management: Updating Data - Attachments - Updating Data Sample Project Final DataService Projects and Mobile Projects in WebRatio Community Description: Unknown tag 'wr:LinkResource' Emular una App Errore su mobile-custom-components Error testing mobil app in android Exception REST Post request Exposing SOAP Web SERVICE on port different from 80 Form template Generation options problem Getting started with Web Services Grabar informacion localmente - WebRatio mobile How can I interact using a iOS (iPhone/iPad) client with a WebRatio app? How can I invoke a Rest Web Service having dynamic parameters? How to change smtp port integrate framework to webratio mobile invoke rest web service that returns a pdf invoking a webservice using REST is possible integrate CartoDB in WebRatio Mobbile apps? java.lang.NullPointerException Make a call from Mobile APP [MOBILE] Can't synchronize domain model with beck end DB [MOBILE] Errore Field Mandatory [MOBILE] How I extract information from JSON client side? Mobile platform : List view - add / remove row Mobile Platform - using device specific features [MOBILE] Script doesn't work! Mostrare un bottone solo in determinati casi No cloud accounts available No database on my cloud account Parameters order in a webservice request Problema generando la logica de un proyecto Problemas al invocar webservice Properties of the XSD Resource (File) Publish a web service publish web service for storing information in PostgreSQL DB following XSD Resource REST connection and Mobile App deploy Supoort for Mobile and Desktop display Sync DataService Project with Mobile Project Trying to Synchronize Domain Model usuarios y grupos WebRatio and MySQL Web Ratio Mobile and Foreign Key Web Ratio Mobile plateform Macos Sierra Web Ratio Mobile - Remote data mapping problem WebService DateTime value is not parsed to Date. Web service provider newline problem web service request using XSD Web service - Synchronize XSD When stars web ratio between dofollow and nofollow backlink has affected? When using web services, what kind authentication is used? which of these three models is closer to webratio/ifml way of creating web applications XML Out Unit and Soap Request Response Unit XML Schema Definition Support XML Schema Definition Support