Client side examples

A few client-side implementations are given here, in different languages.

The called api is config/get on an api controller mounted on ‘/api’, and the server is supposed to be listening on http://127.0.0.1:8080/.

The actual controller implementation would look like this:

class ConfigController(WebServicesController):
    @wsexpose(str)
    @wsvalidate(str)
    @require(not_anonymous())
    def get(self, varname):
        '''
        Returns a value from the configuration

        :param varname: The value name
        '''
        try:
            return turbogears.config.get(varname)
        except:
            return None

REST+[XML|JSON]

A few REST+XML or REST+JSON client-side implementations are given here.

The calls are done on http://127.0.0.1:8080/api/config/get.

Note that these examples are adapted from working examples but have not been tested themselves.

Todo

Create a sample project with a fully functionnal server and usable client examples.

SOAP

The wsdl file that describe the api is available at the following URL: http://127.0.0.1:8080/api/api.wsdl.

From this file any decent SOAP framework should give you access to your server API.

Table Of Contents

Previous topic

MyService documentation

Next topic

A C# example

This Page