Download the PHP package php-soap/ext-soap-engine without Composer
On this page you can find all versions of the php package php-soap/ext-soap-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download php-soap/ext-soap-engine
More information about php-soap/ext-soap-engine
Files in php-soap/ext-soap-engine
Package ext-soap-engine
Short Description An ext-soap engine implementation
License MIT
Informations about the package ext-soap-engine
Ext-SOAP powered SOAP engine
This package is a SOAP engine that leverages the built-in functions from PHP's ext-soap
extension.
It basically flips the SoapClient
inside out: All the built-in functions for encoding, decoding and HTTP transport can be used in a standalone way.
If your package contains a SoapClient
, you might consider using this package as an alternative:
- It gives you full control over the HTTP layer.
- It validates the
$options
you pass to theSoapClient
and gives you meaningful errors. - It transforms the types and methods into real objects so that you can actually use that information.
- It makes it possible to use the encoding / decoding logic without doing any SOAP calls to a server.
- ...
Want to help out? 💚
Want more information about the future of this project? Check out this list of the next big projects we'll be working on.
Installation
Example usage:
This example contains an advanced setup for creating a flexible ext-soap based engine.
It shows you the main components that you can use for configuring PHP's SoapClient
and to transform it into a SOAP engine:
Fetching a SOAP Resource:
You can still set advanced configuration on the actual SOAP client:
Reading / Parsing metadata
Engine
This package provides following engine components:
- ExtSoapEncoder: Uses PHP's
SoapClient
in order to encode a mixed request body into a SOAP request. - ExtSoapDecoder: Uses PHP's
SoapClient
in order to decode a SOAP Response into mixed data. - ExtSoapMetadata: Parses the methods and types from PHP's
SoapClient
into something more usable. - ExtSoapDriver: Combines the ext-soap encoder, decoder and metadata tools into a usable
ext-soap
preset.
Transports
- ExtSoapClientTransport: Uses PHP's
SoapClient
to handle SOAP requests. - ExtSoapServerTransport: Uses PHP's
SoapServer
to handle SOAP requests. It can e.g. be used during Unit tests. - TraceableTransport: Can be used to decorate another transport and keeps track of the last request and response. It should be used as an alternative for fetching it on the SoapClient.
In ext-soap, there are some well known issues regarding the HTTP layer. Therefore we recommend using the PSR-18 based transport instead of the ones above. Besides dealing with some issues, it also provides a set of middleware for dealing with some common issues you might not be able to solve with the regular SoapClient.
Configuration options
ExtSoapOptions
This package provides a little wrapper around all available \SoapClient
options.
It provides sensible default options. If you want to set specific options, you can do so in a sane way:
It will validate the options before they are passed to the \SoapClient
.
This way, you'll spend less time browsing the official PHP documentation.
WsdlProvider
A WSDL provider can be used in order to load a WSDL. Since ext-soap requires a loadable URL, it works slightly different from the wsdl loaders inside php-soap/wsdl.
This package contains some built-in providers:
InMemoryWsdlProvider
By using the in-memory WSDL provider, you can use a complete XML version of the WSDL as source. This one might come in handy during tests, but probably shouldn't be used in production.
PassThroughWsdlProvider
The pass-through WSDL provider is used by default.
You can pass every string you would normally pass to the built-in SOAP client's wsdl option.
No additional checks are executed, the loading of the file will be handled by the internal SoapClient
class.
PermanentWsdlLoaderProvider
This provider can permanently cache a (remote) WSDL. This one is very useful to use in production, where the WSDL shouldn't change too much. You can force it to load to a permanent location in e.g. a cronjob. It will improve performance since the soap-client won't have to fetch the WSDL remotely. You can use any WSDL loader
TemporaryWsdlLoaderProvider
This provider can temporarily fetch a (remote) WSDL through a WSDL loader. This one can be used in development, where WSDL files might change frequently. You can use any WSDL loader
Writing your own WSDL provider
Didn't find the WSDL provider you needed?
No worries! It is very easy to create your own WSDL provider. The only thing you'll need to do is implement the WsdlProvider
interface:
ClassMap
By providing a class map, you let ext-soap
know how data of specific SOAP types can be converted to actual classes.
Usage:
TypeConverter
Some exotic XSD types are hard to transform to PHP objects. A typical example are dates: some people like it as a timestamp, some want it as a DateTime, ... By adding custom TypeConverters, it is possible to convert a WSDL type to / from a PHP type.
These TypeConverters are added by default:
- DateTimeTypeConverter
- DateTypeConverter
- DoubleTypeConverter
- DecimalTypeConverter
You can also create your own converter by implementing the TypeConverterInterface
.
Usage:
All versions of ext-soap-engine with dependencies
ext-soap Version *
ext-dom Version *
azjezz/psl Version ^3.0
php-soap/engine Version ^2.13
php-soap/wsdl Version ^1.12
symfony/options-resolver Version ^5.4 || ^6.0 || ^7.0