OverBlog NG Ws Client
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:
[OverblogWsClientBundle]
git=git@github.com:ebuzzing/OverblogWsClientBundle.git
target=/bundles/Overblog/WsClientBundle
version=v0.4
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:
#app/autoload.php
'Overblog' => __DIR__.'/../vendor/bundles',
Let's register the WsClientBundle in the application kernel:
#app/AppKernel.php
// 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
overblog_ws_client:
urls:
*cnct_name*:
url: http://api.domain.tld/
type: rest
timeout: 2000
*cnct_name_2*:
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...
Usage
Use the ws client is very simple. A simple Rest call look like this:
$results = $this->get('ws_client')
->getConnection('*cnct_name*')
->get('/ws/uri')
->exec();
You can call together several services by chaining call like this:
$results = $this->get('ws_client')
->getConnection('*cnct_name_2*')
->get('getMethod', array('param' => 'value'))
->get('setMethod', array('param' => 'value'))
->getConnection('*cnct_name*')
->get('/ws/uri')
->exec();
The execution time call will be the longuest call.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
overblog_ws_client:
urls:
# Prototype
name:
url: ~ # Required
type: json
timeout: 1000
-
Debug Ws Client
By xkobal, 6 months ago
-
Debug Ws Client
By xkobal, 6 months ago
-
Debug Ws Client
By xkobal, 6 months ago
-
Debug Ws Client
By xkobal, 6 months ago
-
Debug Ws Client
By xkobal, 6 months ago
-
Debug Ws Client
By xkobal, 6 months ago
-
Debug Ws Client
By xkobal, 6 months ago
-
Debug Ws Client
By xkobal, 6 months ago
-
Debug Ws Client
By xkobal, 6 months ago
-
Debug Ws Client
By xkobal, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Fix urls config constructor
By hadrienl, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
-
Add "on-the-fly" URLs
By xkobal, 6 months ago
