This is an old revision of the document!
You will need to create a web service client when you want to access any third party web service. All you need is the system function #http which takes 3 parameters, URL, http-method and an optional body. The body may be required for http-method POST and may need to be enclosed in a JSON, XML or any other format as required by the API.
str host="http://maps.googleapis.com/maps/api/geocode/json?address=American+Embassy,+Dhaka,+Bangladesh" str response=#http(host,"GET","")
The raw response from the host may be encoded in a JSON, XML or any other format as defined by the API. You will need to extract the relevant data from the raw response. Try the method ca_test_client.method for an example.
To publish a RESTful web service in DreamApps, you will need to define
While naming the resources, please follow the following convention to avoid confusion.
Query format - name_q.json Response format - name_r.json Method - name.method
DreamApps doesn't allow any web service without authentication. So, all calls to DreamApps web services need a sessionid which is obtained by a call to authentication web service zx_auth which returns a sessionid on successful authentication.
Try the method ca_test_server.method for an example of using the web service ca_test.