Download the PHP package dynweb/zend-soap-service-provider without Composer
On this page you can find all versions of the php package dynweb/zend-soap-service-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dynweb/zend-soap-service-provider
More information about dynweb/zend-soap-service-provider
Files in dynweb/zend-soap-service-provider
Package zend-soap-service-provider
Short Description A soap service provider, based on ZendSoap from ZendFramwork project.
License MIT
Informations about the package zend-soap-service-provider
zend-soap-service-provider
A soap service provider for Silex, based on the ZendSoap component from ZendFramework project.
For more informations about Zend Soap, check the Zend Framework documentation :
Why a Zend Soap silex service provider ?
- For testing
- For a better integration
- For simplicity
Install
- Add
"dynweb/zend-soap-service-provider": "dev-master"in the require section of yourcomposer.jsonand run thecomposer installcommand. - Register service :
$app->register(new ZendSoapServiceProvider());and don't forget theuse \Ibsciss\Silex\Provider\ZendSoapServiceProviderstatement.
Usages
Basic use
When the service provider is registered, you have access to the two basic services :
- soap.server, instance of Zend\Soap\Server`
- soap.client, instance of Zend\Soap\Client`
Multiple instances
If you need more connection, you can define several instances using soap.instances parameters.
You have access to your instances with the two services :
soap.clientssoap.servers
The first defined service is the default one and became accessible from soap.client and soap.server services.
WSDL management
You can provide a (optional) WSDL for the global service with the soap.wsdl parameter.
For multiple instances, its possible to define wsdl for a specific instance :
Note : if you provide one wsdl per instance you don't have to specify a global one
About \Zend\Soap implementation
The package use now the official \Zend\Soap package
In \Zend\Soap\Server
Debug mode
When an exception is raised in your code the \Zend\Soap\Server catch it and check if this is an authorized exception. If not, and for security reason, it send an "Unknow error" message. And if in production its a sane behavior, its really annoying during development & tests process.
So the serviceProvider extends the Server class to add a debugMode method which is automatically activated when the silex debug options is true (manual enable/disable debug mode is provide with the setDebugMode($boolean) server method).
Example :
`
In debug mode, the Server send all exceptions to the soap client.
Exception management
As described below, when an exception is catch by the Zend\Soap\Server, the error message became "Unknown error". So even if you write the exception in logs, you have no ideas of the failure root cause, to avoid this trouble a getException method is available in the provider's server class.
Example:
Internal '\SoapServer' instance
The Zend\Soap\Server use internally a \SoapServer instance to handle request. In certain case, you need an access to this instance (for example to send a SoapFault when the setReturnResponse is set at true). That's why, the provider add a getSoap() method which provide the current internal \SoapServer instance.
Example:
Advanced topic
Change Soap class
If you want to use your own personal soap class, or for test purpose. You can override the soap, server or client, class with the soap.client.class and soap.server.class.
Warning: If you are in dotNet mode, you have to use soap.client.dotNet.class (or client.dotNet.class for an instance override).
Change Soap version
You are able to specify the soap version using the soap.version attribute.
The allowed values are :
- SOAP_1_1
- SOAP_1_2 (default value)
DotNet specific mode
The dotNet framework process soap parameters a little different than PHP or Java implementations.
So, if you have to integrate your soap web services with a dotNet server, set the soap.dotNet option at true.
If you want to override the dotNet class, use the soap.client.dotNet.class attribute instead of soap.client.class.
Summary
Services
- soap.client : default soap client instance, alias of the first defined instances
- soap.server : default soap server instance, alias of the first defined instances
- soap.clients : soap clients instances container
- soap.servers : soap servers instances container
parameters
- soap.wsdl : global wsdl
- soap.client.class : override client factory class
- soap.server.class : override server factory class
- soap.dotNet : enable dotNet mode, use of Soap\Client\DotNet class
- soap.client.dotNet.class : override client factory class in dotNet mode
- soap.version : define SOAP version, accept constant SOAP_1_1 or SOAP_1_2 as value (default is SOAP_1_2 unless in dotNet mode)
All parameters can be define at the instance level :




