We can expose applications on Code2 as services in a few minutes.
Go to REST Servers (under Business on menu) and click on button.
We will create REST web service with name and web service link icbService.
Now that service is created we need to add its methods. Go to Methods of icbService and click on button.
Let's expose our query for city table. Select both with and without session in access control so that even if request doesn't have session it can still get response. It will be kind of public web service.
Now, insert method parameters from source object (query) by clicking on button.
country and then reload cache.
That's it, we exposed our query for city table as service. To see service definition and properties click on caption under
icbService id which is 1094 in this project.
Long string between rest and service name in the link is project id. So to test
cities method of service
icbService open this link:
http://icb.world/rest/YOUR_PROJECT_ID/icbService/cities. In this case, the link is http://icb.world/rest/ea5e3078-4ddc-4e30-9ecf-433558767b26/icbService/cities.
Two records in city table are sent as response:
Let's expose a form as well. You can create new city record by sending POST request.
Using Postman let's add city Paris with country value 2 which is value of France in
lkp_country static lookup.
Open preview of page City and you will see new record Paris, France.