/
How to Call RESTful Web Service
How to Call RESTful Web Service
Migrated from http://intranet.wavelet.asia/projects/wavelet-ms/wiki/How_to_call_RESTful_Web_Service
Web Service Structure in EMP has mainly 3 parts:
- Web Service Access Address
- Service Name
- Action Name
URL to access web service: http://empdomain.biz/ws/api/webservicename/actionname
Example:
http://cloud.wavelet.biz/demo/ws/api/itemService/get
- Web Service Access Address: http://empdomain.biz/ws/api/ (Ask System Admin for this)
- Service Name: itemService
- Action Name: get
Actions
EMP has following Actions:
Action Name: get
get action mainly used to retrieve data from server. It has 3 parameters:
Parameter Name | Data Type | Required/Optional | Sample Data | Description |
userName | String | Required | chin | userName is being used for Authentication of the user to perform this action |
password | String | Required | 123456 | password is being used for Authentication of the user to perform this action |
queryObject | String | Required | Sample json data of queryObject parameter | This is a json data of SQL query |
Sample Code to call get action using JAVA Platform
Action Name: getCount
getCount action mainly used to retrieve number of records available in server for a particular query. It has 3 parameters:
Parameter Name | Data Type | Required/Optional | Sample Data | Description |
userName | String | Required | chin | userName is being used for Authentication of the user to perform this action |
password | String | Required | 123456 | password is being used for Authentication of the user to perform this action |
queryObject | String | Required | Sample json data of queryObject parameter | This is a json data of SQL query |
Sample Code to call getCount action using JAVA Platform
Action Name: add
add action mainly used to send records to server to add in particular table. It has 3 parameters:
Parameter Name | Data Type | Required/Optional | Sample Data | Description |
userName | String | Required | chin | userName is being used for Authentication of the user to perform this action |
password | String | Required | 123456 | password is being used for Authentication of the user to perform this action |
txqueueJson | String | Required | Sample json data of txqueueJson parameter | This is a json data with all information required to create a Tx Queue. It can hold data for Sales Order Index, Sales Order Item, Cust Invoice Index, Cust Invoice Item, Receipt Index and Tc Terminal |
Private & Confidential