vaclavvanik/soap-wsdl

An easy way to handle WSDL data with zero dependencies

1.0.0 2022-12-05 13:38 UTC

This package is auto-updated.

Last update: 2024-10-05 17:35:43 UTC


README

This package provides an easy way to handle WSDL data with zero dependencies.

Install

You can install this package via composer.

composer require vaclavvanik/soap-wsdl

Usage

StringProvider

Returns WSDL from string variable.

<?php

declare(strict_types=1);

use VaclavVanik\Soap\Wsdl;

$wsdl = (new Wsdl\StringProvider('wsdl-in-string-variable'))->provide();

FileProvider

Returns WSDL from file.

<?php

declare(strict_types=1);

use VaclavVanik\Soap\Wsdl;

$wsdl = (new Wsdl\FileProvider('my-file.wsdl'))->provide();

CacheFileProvider

Loads and save $wsdl from delegated WsdlResourceProvider to cache file.

<?php

declare(strict_types=1);

use VaclavVanik\Soap\Wsdl;

$fileProvider = new Wsdl\FileProvider('my-file.wsdl');
$directory = '/tmp';
$ttl = 3600;

$wsdl = (new Wsdl\CacheFileProvider($fileProvider, $directory, $ttl))->provide();

ChainProvider

Returns WSDL from first available WsdlProvider.

<?php

declare(strict_types=1);

use VaclavVanik\Soap\Wsdl;

$fileProvider1 = new Wsdl\FileProvider('/may-be-unreachable/my-file.wsdl');
$fileProvider2 = new Wsdl\FileProvider('/should-be-reachable/my-file.wsdl');

$wsdl = (new Wsdl\ChainProvider($fileProvider1, $fileProvider2))->provide();

HttpProvider

HttpProvider is in separate package vaclavvanik/soap-wsdl-http.

Exceptions

provide methods throw:

Run check - coding standards and php-unit

Install dependencies:

make install

Run check:

make check

Changelog

Please see CHANGELOG for more information what has changed recently.

License

The MIT License (MIT). Please see License File for more information.