2017 © Pedro Peláez
 

symfony-bundle wsclient-bundle

Simple webservices client to call external urls

image

m6web/wsclient-bundle

Simple webservices client to call external urls

  • Wednesday, July 8, 2015
  • by M6Web
  • Repository
  • 9 Watchers
  • 2 Stars
  • 39,731 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 1 Forks
  • 1 Open issues
  • 28 Versions
  • 0 % Grown

The README.md

this bundle is deprecated

usage of https://github.com/M6Web/GuzzleHttpBundle is recommended, (*1)

Bundle WSClient Build Status

This bundle give a simple webservices client to call external urls. By default, it is based on Guzzle but you can plug any other client library., (*2)

Services

No default service is defined. You must set a configuration to instanciate one or more services., (*3)

Configuration

The main configuration key is m6_ws_client. Each subkey defines an instance of a webservice client. These services are named m6_ws_client_ + the subkey except for the default subkey that defines the main service m6_ws_client. For each instance, several parameters can be set :, (*4)

  • base_url : the base domain of each url called with the service. If an absolute url is passed to the client, the base url is ignored.
  • config (optional) : additional parameters to configure the client, must be an array. See http://guzzle.readthedocs.org/en/latest/clients.html#request-options
  • cache (optional) :
    • ttl : 86400s by default. Max ttl if force_request_ttl is FALSE, forced ttl if force_request_ttl is TRUE
    • force_request_ttl (optional) : FALSE by default. If TRUE, request TTL is the same than the cache TTL, otherwise the request TTL is calculated according to response headers.
    • service : low level cache service (must implement M6Web\Bundle\WSClientBundle\Cache\CacheInterface)
    • adpater : adapter class name (must implement \Doctrine\Common\Cache\Cache)
    • storage : (optional) storage class name (must implement \GuzzleHttp\Subscriber\Cache\CacheStorageInterface)
    • subscriber : (optional) subscriber class (must implement \GuzzleHttp\Subscriber\Cache\SubscriberInterface)
    • can_cache : (optional) a callable to determine if a request can be cached

Here is an example of a simple configuration :, (*5)

m6_ws_client:
    clients:
        default:
            base_url: 'toto.m6web.fr'
            config:
                timeout: 10
                allow_redirects: {max: 5, strict: false, referer: true}
                exceptions: false
            cache:
                ttl: 3600
                adapter: M6\Bundle\RedisBundle\Guzzle\RedisCacheAdapter
                service: m6_redis

Simple use case

For instance, in a controller :, (*6)

$wsclient = $this->get('m6_ws_client');
$response = $wsclient->get('http://toto.m6web.fr/parse/?content=my_content');

echo $response->getBody();

unit test

composer install --dev
./bin/atoum

The Versions

08/07 2015

dev-master

9999999-dev

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

15/06 2015

dev-feature/v4-compatibility-symfony-2.6

dev-feature/v4-compatibility-symfony-2.6

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

15/06 2015

v4.1.2

4.1.2.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

12/06 2015
28/05 2015
27/05 2015
28/04 2015

v5.3.3

5.3.3.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

23/04 2015

v5.3.2

5.3.2.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

10/04 2015

v5.3.1

5.3.1.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

10/04 2015

v5.3.0

5.3.0.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

09/04 2015

dev-feature/put-patch-requests

dev-feature/put-patch-requests

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

06/04 2015

v5.2.0

5.2.0.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

03/11 2014

v5.1.0

5.1.0.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

29/09 2014

v5.0.0

5.0.0.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

16/09 2014

dev-feature/guzzle4

dev-feature/guzzle4

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

21/07 2014

v4.1.1

4.1.1.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

07/07 2014

v4.1.0

4.1.0.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

07/07 2014

dev-feature/scalar-header

dev-feature/scalar-header

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

07/07 2014

v4.0.0

4.0.0.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

04/06 2014

v3.0.0

3.0.0.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

23/05 2014

v2.0.5

2.0.5.0

Simple webservices client to call external urls

  Sources   Download

The Requires

 

The Development Requires

by Olivier Mansour
by Florent DUBOST

10/05 2014

v2.0.4

2.0.4.0

Simple webservices client to call external urls

  Sources   Download

The Development Requires

by Olivier Mansour
by Florent DUBOST

29/04 2014

v2.0.3

2.0.3.0

Simple webservices client to call external urls

  Sources   Download

The Development Requires

by Olivier Mansour
by Florent DUBOST

29/04 2014

v2.0.2

2.0.2.0

Simple webservices client to call external urls

  Sources   Download

The Development Requires

by Olivier Mansour
by Florent DUBOST

22/04 2014

v2.0.1

2.0.1.0

Simple webservices client to call external urls

  Sources   Download

The Development Requires

by Olivier Mansour
by Florent DUBOST

16/04 2014

v2.0.0

2.0.0.0

Simple webservices client to call external urls

  Sources   Download

The Development Requires

by Olivier Mansour
by Florent DUBOST

15/04 2014

v1.0.1

1.0.1.0

Simple webservices client to call external urls

  Sources   Download

The Development Requires

by Olivier Mansour
by Florent DUBOST

04/03 2014

v1.0.0

1.0.0.0

Simple webservices client to call external urls

  Sources   Download

The Development Requires

by Olivier Mansour
by Florent DUBOST