PHPackages                             ibsciss/zend-soap-service-provider - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. ibsciss/zend-soap-service-provider

ActiveLibrary[Framework](/categories/framework)

ibsciss/zend-soap-service-provider
==================================

A soap service provider, based on ZendSoap from ZendFramwork project.

v2.3.2(11y ago)65.8k3[1 issues](https://github.com/Ibsciss/zend-soap-service-provider/issues)MITPHP

Since Feb 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Ibsciss/zend-soap-service-provider)[ Packagist](https://packagist.org/packages/ibsciss/zend-soap-service-provider)[ RSS](/packages/ibsciss-zend-soap-service-provider/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (8)Used By (0)

zend-soap-service-provider
==========================

[](#zend-soap-service-provider)

A soap service provider for Silex, based on the ZendSoap component from ZendFramework project.

[![Build Status](https://camo.githubusercontent.com/4a8923f6020cdb1fbda6a145bfe3200073f32495264df1b7e4274d97487aace3/68747470733a2f2f7472617669732d63692e6f72672f496273636973732f7a656e642d736f61702d736572766963652d70726f76696465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Ibsciss/zend-soap-service-provider) [![Coverage Status](https://camo.githubusercontent.com/4ddd660461ae9be998726a79de69c886fdcd171fcde8027e032df2dac6f4869c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f496273636973732f7a656e642d736f61702d736572766963652d70726f76696465722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/Ibsciss/zend-soap-service-provider?branch=master) [![Latest Stable Version](https://camo.githubusercontent.com/d16072806e785c6684d0482ed0b4228ba6686478a93ea324e3c59f99419f54ee/68747470733a2f2f706f7365722e707567782e6f72672f696273636973732f7a656e642d736f61702d736572766963652d70726f76696465722f762f737461626c652e706e67)](https://packagist.org/packages/ibsciss/zend-soap-service-provider) [![Latest Unstable Version](https://camo.githubusercontent.com/41ed24365cf39877dd4974e17aae7db8391d3dee7f8696aadf0889def7917df2/68747470733a2f2f706f7365722e707567782e6f72672f696273636973732f7a656e642d736f61702d736572766963652d70726f76696465722f762f756e737461626c652e706e67)](https://packagist.org/packages/ibsciss/zend-soap-service-provider) [![License](https://camo.githubusercontent.com/ade45ef94eeb34db70857685f764f4479c12642545d8eb9e93d48c131edaf9c2/68747470733a2f2f706f7365722e707567782e6f72672f696273636973732f7a656e642d736f61702d736572766963652d70726f76696465722f6c6963656e73652e706e67)](https://packagist.org/packages/ibsciss/zend-soap-service-provider)

For more informations about Zend Soap, check the Zend Framework documentation :

- [Zend Soap Server](http://framework.zend.com/manual/2.2/en/modules/zend.soap.server.html)
- [Zend Soap Client](http://framework.zend.com/manual/2.2/en/modules/zend.soap.client.html)

\##Why a Zend Soap silex service provider ?

- For testing
- For a better integration
- For simplicity

\##Install

1. Add `"ibsciss/zend-soap-service-provider": "dev-master"` in the require section of your `composer.json` and run the `composer install` command.
2. Register service : `$app->register(new ZendSoapServiceProvider());` and don't forget the `use \Ibsciss\Silex\Provider\ZendSoapServiceProvider` statement.

\##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`

```
$app = new Application();
$app->register(new ZendSoapServiceProvider());

//client method call
$app['soap.client']->methodCall();

//server handling
$app['soap.server']->handle();
```

\###Multiple instances

If you need more connection, you can define several instances using `soap.instances` parameters.

```
//during registration
$app->register(new ZendSoapServiceProvider(), array(
    'soap.instances' => array(
        'connection_one',
        'connection_two'
    )
));

// --- OR ---
$app->register(new ZendSoapServiceProvider());
$app['soap.instances'] = array(
    'connection_one',
    'connection_two'
);
```

You have access to your instances with the two services :

- `soap.clients`
- `soap.servers`

*The first defined service is the default one and became accessible from `soap.client` and `soap.server` services.*

```
$app['soap.clients']['connection_one']; //same as $app['soap.client'];
$app['soap.servers']['connection_two'];
```

\###WSDL management

You can provide a (optional) WSDL for the global service with the `soap.wsdl` parameter.

```
//during registration
$app->register(new ZendSoapServiceProvider(), array(
    'soap.wsdl' => '';
));
// --- OR ---
$app['soap.wsdl'] = '';

$app['soap.server']->getWsdl(); //return
```

For multiple instances, its possible to define wsdl for a specific instance :

```
//during registration
$app->register(new ZendSoapServiceProvider(), array(
    'soap.wsdl' => '',
    'soap.instances' => array(
        'connection_one',
        'connection_two' => array('wsdl' => 'anotherOne')
    );
));

// --- OR ---
$app['soap.wsdl'] = '';
$app['soap.instances'] = array(
    'connection_one'
    'connection_two' => array('wsdl' => 'anotherOne')
);
```

**Note :** if you provide one wsdl per instance you don't have to specify a global one

```
//if you provide one wsdl per instance you don't have to specify a global one
$app->register(new ZendSoapServiceProvider(), array(
    'soap.instances' => array(
        'connection_one' => array('wsdl' => ''),
        'connection_two' => array('wsdl' => 'anotherOne')
    );
));

$app['soap.servers']['connection_one']->getWsdl() //return
$app['soap.servers']['connection_two']->getWsdl() //return anotherOne
```

About \\Zend\\Soap implementation
---------------------------------

[](#about-zendsoap-implementation)

The package use now the official `\Zend\Soap` package

### In `\Zend\Soap\Server`

[](#in-zendsoapserver)

#### Debug mode

[](#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 &amp; 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 :

```
//enable:
$app['soap.server']->setDebugMode(true);

//disable:
$app['soap.server']->setDebugMode(false);
```

**In debug mode, the Server send all exceptions to the soap client.**

#### Exception management

[](#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:

```
$app['soap.server']->fault(new \Exception('test'));

$app['soap.server']->getException(); //return the Exception instance given as attribute to the fault method.
```

### Internal '\\SoapServer' instance

[](#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:

```
$app['soap.server']->getSoap()->fault(new \SoapFault('an error occured'));
```

\##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).

```
//global level
$app->register(new ZendSoapServiceProvider());

$app['soap.server.class'] = '\stdClass';
$app['soap.client.class'] = '\stdClass';

$app['soap.client']; //instanceOf stdClass;
$app['soap.server']; //instanceOf stdClass;

//----------------
//you can also override at the instance scope
$app = new Application();
$app->register(new ZendSoapServiceProvider(), array(
    'soap.instances' => array(
        'connection_one' => array('server.class' => '\stdClass'),
        'connection_two' => array('client.class' => '\stdClass')
    )
));

$app['soap.clients']['connection_one']; //instanceOf Zend\Soap\Client
$app['soap.servers']['connection_one']; //instanceOf stdClass

$app['soap.clients']['connection_two']; //instanceOf stdClass
$app['soap.servers']['connection_two']; //instanceOf Zend\Soap\Server
```

\###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)

```
    $app->register(new ZendSoapServiceProvider(), array(
        'soap.version' => SOAP_1_1
    ));

    // ----- OR -----

    $app['soap.version'] = SOAP_1_1;

    //results :
    $app['soap.client']->getSoapVersion(); // SOAP_1_1;
    $app['soap.server']->getSoapVersion(); // SOAP_1_1;

    // -----------------------
    //like others options, you can define it at the instance level :

    $app->register(new ZendSoapServiceProvider(), array(
        'soap.instances' => array(
            'connection_one' => array('version' => SOAP_1_1),
            'connection_two' => array('dotNet' => true),
            'connection_three'
        )
    ));

    $app['soap.clients']['connection_one']->getSoapVersion(); // SOAP_1_1
    $app['soap.servers']['connection_one']->getSoapVersion(); // SOAP_1_1

    //dotNet use 1.1 by default;
    $app['soap.clients']['connection_two']->getSoapVersion(); // SOAP_1_1
    $app['soap.servers']['connection_two']->getSoapVersion(); // SOAP_1_2

    //default config
    $app['soap.clients']['connection_three']->getSoapVersion(); // SOAP_1_2
    $app['soap.servers']['connection_three']->getSoapVersion(); // SOAP_1_2
```

\###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`.

```
$app['soap.dotNet'] = true;
$app['soap.client'] // instanceOf Zend\Soap\Client\DotNet

//you can also define it at the instance scope
$app->register(new ZendSoapServiceProvider(), array(
    'soap.instances' => array(
        'connection_one' => array('dotNet' => true),
        'connection_two'
    )
));

$app['soap.clients']['connection_one']; //instanceOf Zend\Soap\Client\DotNet
$app['soap.clients']['connection_two']; //instanceOf Zend\Soap\Client
```

*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 :

```
$app['soap.instances'] = array(
    'connection_two' => array(
        'wsdl' => 'anotherOne',
        'client.class' => '\stdClass',
        'server.class' => '\stdClass',
        'dotNet' => true,
        'client.dotNet.class' => '\stdClass',
        'version' => SOAP_1_1
    )
);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~29 days

Total

7

Last Release

4360d ago

Major Versions

v1.0.1 → v2.1.02014-02-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/499e3e54d4bef172ed65ffeb52b7b044177ac73a7075dd559792dead496c6807?d=identicon)[lilobase](/maintainers/lilobase)

---

Top Contributors

[![lilobase](https://avatars.githubusercontent.com/u/335501?v=4)](https://github.com/lilobase "lilobase (31 commits)")

---

Tags

frameworkzendservice providersoapsilexzend-soapzendsoap

### Embed Badge

![Health badge](/badges/ibsciss-zend-soap-service-provider/health.svg)

```
[![Health](https://phpackages.com/badges/ibsciss-zend-soap-service-provider/health.svg)](https://phpackages.com/packages/ibsciss-zend-soap-service-provider)
```

###  Alternatives

[vesparny/silex-simple-rest

A simple silex skeleton for rest api

3346.8k](/packages/vesparny-silex-simple-rest)[tobiassjosten/responsible-service-provider

A Silex ServiceProvider for automagic response formatting.

3490.8k](/packages/tobiassjosten-responsible-service-provider)[dcousineau/orlex

Silex extension for providing an organized, annotated controller infrastructure, designed to blend the simplicity of Silex and organization of Symfony 2

3412.2k1](/packages/dcousineau-orlex)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
