An introduction to Wired

You can contact us at help-wired - AT - wubook - DOT - net

Protocol

The system is developed with the XML-RPC protocol.

The URL to access the Wired function is https://wired.wubook.net/xrws/ (and notice the final slash: it matters).

Many libraries are available for almost all programming languages. Those libraries often allow a very easy development, by completely hiding the XML handling, which is built and sent by the libraries without the need to care about xml formatting.

To better understand this concept, check the following examples:

>>> import xmlrpclib
>>> s= xmlrpclib.Server(url)
>>> res, tok= s.acquire_token(user, pwd, pkey)
<?php
  include("xmlrpc.inc");
  $server = new xmlrpc_client($url);
  $args= array(new xmlrpcval($user, 'string'), new xmlrpcval($pass, 'string'), new xmlrpcval($pkey, 'string'));
  $message = new xmlrpcmsg('acquire_token', $args);
  $struct = $server->send($message)->value();
?>
public String getToken(String username, String password, String pkey) throws Exception {
  Vector<String> params = new Vector<String>();
  params.addElement(username);
  params.addElement(password);
  params.addElement(pkey);
  Object[] objects = (Object[]) xmlRpcClient.execute(config, "acquire_token", params);
  return (String) objects[1];
}
# ruby (code provided by Intelligent Mobile, see below)
require 'xmlrpc/client'
token_data = server.call("acquire_token", @config['account_code'], @config['password'], @config['provider_key'])
status = token_data[0]
@token = token_data[1]

Need additional information about the XML-RPC protocol? Wikipedia is obviously a good starting point and already lists several well known libraries for each programming language:

If you use Ruby, have a look at the following library on github (here). A gem file is also available there.

So, by using a library you will have to deal with Simple Data (integers, strings, floats and so on), Arrays and Structs. If you don’t want to use an high level library and you want to produce and post XML, make sure to develop propedeutic functions to represent these data types. A good resource is available at this link.

Anti Flood Policies

This part is very important to understand and implement, otherwise you might get marked as a flooder and, based on the kind of floodin, have your access restricted in different ways.

There are several kind of anti-abuses policies:

  • Token: there are limits on acquiring tokens and using them

  • Per function: almost all functions have limits. This means you can not call them more then N times in M seconds (N and M depending on the fucction).

  • Global: global number of calls

  • Room values: to prevent too many updates for the same room

Token limits

Please, while developing the authentication layer, keep in mind the following limits:

  • A token can be used, at maximum, for 60 operations

  • A token expires after 3600 seconds

More info can be found in the Policies Section.

Push Notification

Note

Enabling the Push Notification and Marking is essential to develop a faster, elegant and reliable approach.

There are several ways to download reservations from WuBook. Before describing some strategies, let’s considere the following concepts:

  • Marking: WuBook is able to remember what you already fetched: you don’t need to specify filters (for example dates), because in that case only not-read reservations will be returned. Marking can be done automatically or on demand.

  • Push notification: instead of periodically asking our servers for new reservations, consider the idea to establish a notification layer. WuBook is able to notify you when a new reservation is ready to be fetched. This will optmize a lot your/our servers load.

Note

Once the Push Notification has been deployed, to be safer, you can eventually schedule a fetching call with a 4 hours frequence, just in case some notification will be lost. If you are a corporate user, also check the corporate_fetchable_properties() function

During your development, use the fetch_booking() call, because it easily allows to download the same reservation and focusing this way on the integration process.

Once your integration process is done, you will then begin to setup Notifications and Marking features.

Development and debugging

During the first steps of the development, rely on our collaboration. This is -obviously- the moment when we provide more support to our providers. If you need help, for example because you can’t succesfully call a function, it’s very important to send us the XML you’re sending to our servers.

As stated before, if you use high level libraries, you will probably skip the XML production. However, each library, given a call and its arguments, allows to produce the related xml (instead of automatically producing it under the hood and sending it to the servers).

So, please, as one of your first step, try to understand how to use your library to produce XML without sending it, so that we will be able to help you in the case you will encounter issues.