There is no license information available for the latest version (v0.5.6) of this package.

Web Service Client

v0.5.6 2014-07-22 07:26 UTC


What is this repository ?

It's the place for the Web Service client library. Essentially to use with External Rest service and JSON-RCP (Internal API).

Installation and setup

Juste add the following lines is your deps file:


You have now to tell Symfony2 autoloader where to find the API and the files that will be generated. Fire up your text editor and add the following lines to the app/autoload.php file:


    'Overblog'         => __DIR__.'/../vendor/bundles',

Let's register the WsClientBundle in the application kernel:

    // register your bundles
    new Overblog\WsClientBundle\OverblogWsClientBundle(),

You can now define your service settings in your main configuration file. The example below uses the yaml format:

# app/config/config.yml
          url: http://api.domain.tld/
          type: rest
          timeout: 2000
          url: http://api.domain.tld/json-rpc/user
          type: json

The cnct_name here is a name for your service. You can define several services using different names on different web service...


Use the ws client is very simple. A simple Rest call look like this:

$results = $this->get('ws_client')

You can call together several services by chaining call like this:

$results = $this->get('ws_client')
                ->get('getMethod', array('param' => 'value'))
                ->get('setMethod', array('param' => 'value'))

The execution time call will be the longuest call.