PHPackages                             cadoles/soap - 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. [API Development](/categories/api)
4. /
5. cadoles/soap

ActiveLibrary[API Development](/categories/api)

cadoles/soap
============

Build and consume SOAP and WSDL based web services

5.2.1(5y ago)12362[1 issues](https://github.com/Cadoles/BeSimpleSoap/issues)MITPHPPHP &gt;=7.0

Since Nov 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Cadoles/BeSimpleSoap)[ Packagist](https://packagist.org/packages/cadoles/soap)[ Docs](https://github.com/Cadoles/BeSimpleSoap)[ RSS](/packages/cadoles-soap/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (8)Versions (40)Used By (0)

BeSimpleSoap (Symfony 3.4 / 4.x)
================================

[](#besimplesoap-symfony-34--4x)

This fork provides the BeSimpleSoap bundle, updated to be compatible with Symfony 3.4 and 4.x (as well as with PHP 7.0-7.4).

We forked the official [BeSimpleSoap](https://github.com/BeSimple/BeSimpleSoap) repository in order to sucessfully maintain some of our projects.

We now have integrated changes and fixes from sub-forks (thank you guys!), and we should be up to date now :)

This fork is maintained by people from [Cadoles](https://www.cadoles.com/).

Contributing
============

[](#contributing)

We do welcome pull requests :) please include tests if you can.

Running tests can be done by running `php vendor/bin/phpunit`.

Installation
============

[](#installation)

If you do not yet have composer, follow instructions on the [Composer website](https://getcomposer.org/download/) to install it.

Then just running:

```
$ composer require cadoles/soap

```

should be enough to get you up and running.

Components
==========

[](#components)

BeSimpleSoap consists of five components ...

BeSimpleSoapClient
------------------

[](#besimplesoapclient)

**Refactored** BeSimpleSoapClient is a component that extends the native PHP SoapClient with further features like SwA and WS-Security.

BeSimpleSoapServer
------------------

[](#besimplesoapserver)

**Refactored** BeSimpleSoapServer is a component that extends the native PHP SoapServer with further features like SwA and WS-Security.

BeSimpleSoapCommon
------------------

[](#besimplesoapcommon)

**Refactored** BeSimpleSoapCommon component contains functionality shared by both the server and client implementations.

BeSimpleSoapWsdl
----------------

[](#besimplesoapwsdl)

**Untouched!**The component is not affected by refactoring so it should work properly. For further information see the original [README](https://github.com/BeSimple/BeSimpleSoap/blob/master/src/BeSimple/SoapWsdl/README.md).

BeSimpleSoapBundle
------------------

[](#besimplesoapbundle)

**Unsupported!**The BeSimpleSoapBundle is a Symfony2 bundle to build WSDL and SOAP based web services. For further information see the the original [README](https://github.com/BeSimple/BeSimpleSoap/blob/master/src/BeSimple/SoapBundle/README.md). *Will not work since the Symfony libraries were removed and usages of other components were not refactored. Feel free to fork this repository and fix it!*

How to use
==========

[](#how-to-use)

You can investigate the unit tests dir `tests` in order to get a clue. Forget about associative arrays, vague configurations, multiple extension and silent errors! This may look a bit more complex at the first sight, but it will guide you to configure and set up your client or server properly.

Example of soap client call
---------------------------

[](#example-of-soap-client-call)

```
$soapClientBuilder = new SoapClientBuilder();
$soapClient = $soapClientBuilder->build(
    SoapClientOptionsBuilder::createWithDefaults(),
    SoapOptionsBuilder::createWithDefaults('http://path/to/wsdlfile.wsdl')
);
$myRequest = new MyRequest();
$myRequest->attribute = 'string value';
$soapResponse = $soapClient->soapCall('myMethod', [$myRequest]);

var_dump($soapResponse); // Contains Response, Attachments
```

### Something wrong?!

[](#something-wrong)

Turn on the tracking and catch `SoapFaultWithTracingData` exception to get some sweets :)

```
try {
    $soapResponse = $soapClient->soapCall('myMethod', [$myRequest]);
} catch (SoapFaultWithTracingData $fault) {
    var_dump($fault->getSoapResponseTracingData()->getLastRequest());
}
```

In this example, a `MyRequest` object has been used to describe request. Using a ClassMap, you help SoapClient to turn it into XML request.

Example of soap server handling
-------------------------------

[](#example-of-soap-server-handling)

Starting a SOAP server is a bit more complex. I recommend you to inspect SoapServer unit tests for inspiration.

```
$dummyService = new DummyService();
$classMap = new ClassMap();
foreach ($dummyService->getClassMap() as $type => $className) {
    $classMap->add($type, $className);
}
$soapServerBuilder = new SoapServerBuilder();
$soapServerOptions = SoapServerOptionsBuilder::createWithDefaults($dummyService);
$soapOptions = SoapOptionsBuilder::createWithClassMap($dummyService->getWsdlPath(), $classMap);
$soapServer = $soapServerBuilder->build($soapServerOptions, $soapOptions);

$request = $soapServer->createRequest(
    $dummyService->getEndpoint(),
    'DummyService.dummyServiceMethod',
    'text/xml;charset=UTF-8',
    ''
);
$response = $soapServer->handleRequest($request);

var_dump($response); // Contains Response, Attachments
```

In this example, a `DummyService` service has been used to handle request. Using a service can help you create coherent SoapServer endpoints. Service can hold an endpoint URL, WSDL path and a class map as associative array. You can hold a class map as `ClassMap` object directly in the `DummyService` instead of array.

In the service you should describe SOAP methods from given WSDL. In the example, the dummyServiceMethod is called. The method will receive request object and return response object that are matched according to the class map.

See a simplified implementation of `dummyServiceMethod` to get a clue:

```
/**
 * @param DummyServiceRequest $dummyServiceRequest
 * @return DummyServiceResponse
 */
public function dummyServiceMethod(DummyServiceRequest $dummyServiceRequest)
{
    $response = new DummyServiceResponse();
    $response->status = true;

    return $response;
}
```

For further information and getting inspiration for your implementation, see the unit tests in `tests` dir.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~69 days

Recently: every ~257 days

Total

36

Last Release

2133d ago

Major Versions

v0.4 → v4.12017-02-14

v4.4.7 → 5.1.02019-08-06

PHP version history (3 changes)v0.1.0PHP &gt;=5.3.0

v4.1PHP &gt;=5.3.0|&gt;=7.0

5.1.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7e59be870f9eb78e48369717dc2bf67bed91940d3687f463321b712f5a71cdf?d=identicon)[cadoles](/maintainers/cadoles)

---

Top Contributors

[![francisbesset](https://avatars.githubusercontent.com/u/471525?v=4)](https://github.com/francisbesset "francisbesset (305 commits)")[![aschamberger](https://avatars.githubusercontent.com/u/1042049?v=4)](https://github.com/aschamberger "aschamberger (97 commits)")[![christiankerl](https://avatars.githubusercontent.com/u/425341?v=4)](https://github.com/christiankerl "christiankerl (72 commits)")[![tuscanicz](https://avatars.githubusercontent.com/u/5862953?v=4)](https://github.com/tuscanicz "tuscanicz (63 commits)")[![cocciagialla](https://avatars.githubusercontent.com/u/5726017?v=4)](https://github.com/cocciagialla "cocciagialla (24 commits)")[![gloaec](https://avatars.githubusercontent.com/u/902567?v=4)](https://github.com/gloaec "gloaec (21 commits)")[![cameronmurphy](https://avatars.githubusercontent.com/u/1300032?v=4)](https://github.com/cameronmurphy "cameronmurphy (7 commits)")[![mremi](https://avatars.githubusercontent.com/u/548536?v=4)](https://github.com/mremi "mremi (5 commits)")[![timmtim](https://avatars.githubusercontent.com/u/1760124?v=4)](https://github.com/timmtim "timmtim (4 commits)")[![alemorozov](https://avatars.githubusercontent.com/u/1452075?v=4)](https://github.com/alemorozov "alemorozov (4 commits)")[![sarunas](https://avatars.githubusercontent.com/u/250523?v=4)](https://github.com/sarunas "sarunas (2 commits)")[![milanmimra](https://avatars.githubusercontent.com/u/11173214?v=4)](https://github.com/milanmimra "milanmimra (2 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (2 commits)")[![vytautasgimbutas](https://avatars.githubusercontent.com/u/1172971?v=4)](https://github.com/vytautasgimbutas "vytautasgimbutas (1 commits)")[![ceesco53](https://avatars.githubusercontent.com/u/2687998?v=4)](https://github.com/ceesco53 "ceesco53 (1 commits)")[![ch3ric](https://avatars.githubusercontent.com/u/858068?v=4)](https://github.com/ch3ric "ch3ric (1 commits)")[![davefx](https://avatars.githubusercontent.com/u/292309?v=4)](https://github.com/davefx "davefx (1 commits)")[![hason](https://avatars.githubusercontent.com/u/288535?v=4)](https://github.com/hason "hason (1 commits)")[![ldantunez](https://avatars.githubusercontent.com/u/2373448?v=4)](https://github.com/ldantunez "ldantunez (1 commits)")[![matthiasnoback](https://avatars.githubusercontent.com/u/1193078?v=4)](https://github.com/matthiasnoback "matthiasnoback (1 commits)")

---

Tags

soap

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cadoles-soap/health.svg)

```
[![Health](https://phpackages.com/badges/cadoles-soap/health.svg)](https://phpackages.com/packages/cadoles-soap)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[besimple/soap

Build and consume SOAP and WSDL based web services

112560.2k2](/packages/besimple-soap)[besimple/soap-client

Build and consume SOAP Client based web services

582.2M14](/packages/besimple-soap-client)[besimple/soap-bundle

Build and consume SOAP and WSDL based web services with Symfony2

62200.1k2](/packages/besimple-soap-bundle)[besimple/soap-common

Build and consume SOAP Common based web services

122.4M8](/packages/besimple-soap-common)[noiselabs/nusoap-bundle

Symfony2 bundle for NuSOAP - SOAP Toolkit for PHP

22535.2k](/packages/noiselabs-nusoap-bundle)

PHPackages © 2026

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