2 Web Service Client Module (wsclient)
3 ------------------------------------
4 by Klaus Purer (klausi), klaus.purer@epiqo.com
5 and Wolfgang Ziegler (fago), wolfgang.ziegler@epiqo.com
7 WSClient provides an interface to consume external web services. It focuses on
8 integrating web service operations as Rules actions, but can also be used as data
9 provider for other modules. It also offers a convenient API for developers to
10 quickly invoke web services.
12 WSClient ships with two sub-modules that support SOAP and REST endpoints.
18 * WSClient depends on the Entity API module, download and install it from
19 http://drupal.org/project/entity
20 * The WSClient user interface depends on Rules, download and install it from
21 http://drupal.org/project/rules
22 * Copy the whole wsclient directory to your modules directory
23 (e.g. DRUPAL_ROOT/sites/all/modules) and activate the Web service client and
24 Web service client UI modules.
25 * The administrative user interface can be found at
26 admin/config/services/wsclient
27 * If you want to use REST services you have to download and install the
28 http_client module (http://drupal.org/project/http_client) and you need to
29 activate the Web service client REST module.
30 * If you want to use SOAP services you have to activate the Web service client
34 Web service decriptions
35 -----------------------
37 * Before invoking a web service you need a description of it. Enable the Web
38 service client examples module to get some examples.
39 * The URL of a web service is the base URL for REST services and the link to a
40 WSDL file for SOAP services.
41 * Every web service has operations, each with parameters and a result.
42 * A web service can have custom data types that describe complex parameters or
49 * A web service operation can be executed as Rules action.
50 * Go to the Rules UI at admin/config/workflow/rules
51 * Add a new rule and choose an event (e.g. "After saving new content").
52 * Add an action and choose one in the Web Services group (e.g. "Google Ajax
53 APIs: Translate text").
54 * Fill out the required operation parameters either directly or use the data
55 selection to make use of other variables (e.g. "node:title").
56 * Add other follow-up actions to process the result of the web service call.
57 * If you need a complex operation parameter, create it beforehand in a "Create
58 a data structure" action.
64 * You can create web service descriptions in code, see for example
65 wsclient_examples.module
66 * You can easily invoke web services by loading the description and executing
67 an operation (the operation name can be used a dynamic method name):
69 $service = wsclient_service_load('google');
70 $result = $service->translate('Hallo Welt', 'de|en');