webbj74/jsdl-loader

A stand-alone JSON Service Description loader for Guzzle based on the ServiceDescriptionLoader class from Guzzle 3.x

0.1.2 2019-05-08 17:47 UTC

This package is not auto-updated.

Last update: 2024-04-13 15:17:26 UTC


README

A stand-alone JSON Service Description loader for Guzzle 5.x based on the ServiceDescriptionLoader class from Guzzle 3.x

Usage

This software is still pre-release.

Add to composer:

$ composer require "webbj74/jsdl-loader:~0.1"

or

$ composer require "webbj74/jsdl-loader:dev-master"

Based on the guzzle/guzzle-services example.

use GuzzleHttp\Client;
use GuzzleHttp\Command\Guzzle\Description;
use GuzzleHttp\Command\Guzzle\GuzzleClient;
use Webbj74\JSDL\Loader\ServiceDescriptionLoader;

$client = new Client();
$jsdlLoader = new ServiceDescriptionLoader();
$description = new Description($jsdlLoader->load($pathToServiceDescription));

// Create a new Guzzle Service Description client
$guzzleClient = new GuzzleClient($client, $description);