PHPackages                             tbpixel/soap-client - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. tbpixel/soap-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

tbpixel/soap-client
===================

A WSDL supported SOAP client.

0.3.0(7y ago)080[1 issues](https://github.com/TBPixel/soap-client/issues)MITPHPPHP ^7.2

Since Mar 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/TBPixel/soap-client)[ Packagist](https://packagist.org/packages/tbpixel/soap-client)[ RSS](/packages/tbpixel-soap-client/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (9)Versions (4)Used By (0)

PHP Soap Client
===============

[](#php-soap-client)

A WSDL supported SOAP client built on top of [PSR-7](https://www.php-fig.org/psr/psr-7/) and [PSR-18](https://www.php-fig.org/psr/psr-18/).

### Content

[](#content)

- [Installation](#installation)
- [Rational](#rational)
- [Examples](#examples)
- [Creating your own handler](#creating-your-own-handler)
- [Contributing](#contributing)
- [Changelog](#changelog)
- [Support Me](#support-me)
- [License](#license)

Installation
------------

[](#installation)

Note that this package is still *in-development* and is subject to **breaking changes**.

You can install this package via composer:

```
composer require tbpixel/soap-client
```

*NOTE:* Version `0.2.0` pulled in Guzzle as the HTTP client of choice. Starting at `0.3.0`, the soap-client only relies on PSR-18. If you'd still like the convenience of using Guzzle without PSR-18 I'd recommend pulling version 0.2.0 with `composer require tbpixel/soap-client:^0.2.0`.

Rational
--------

[](#rational)

If you (like me) have to work with SOAP in 2019, you may find yourself in a tight spot when working with *aggregate* soap actions. If a particular soap action provides a lot of data, then not only will PHP's built-in soap client load the entire string response into memory but it will also instantiate a massive array of stdClass objects based on the response.

The above consumes a great deal of memory resources and can make it even more of a headache to deal with SOAP than it already is. This package aims to help with that by providing a PHP Soap Client built on top of PSR-18.

This, combined with another package I'm developing called [XML Streamer](https://github.com/TBPixel/xml-streamer), allows for some greatly improved memory management when working with soap API's.

Examples
--------

[](#examples)

If you just want to get started quickly, the ClientFactory class will do most of the heavy lifting.

```
use TBPixel\SoapClient\ClientFactory;

// @var \Psr\Http\Client\ClientInterface $http
$client = ClientFactory::new($http, 'http://example.com/service.wsdl');

// $response is a \Psr\Http\Message\StreamInterface
$response = $client->call('MyAction', [
    'foo' => 'bar',
]);
```

Creating your own handler
-------------------------

[](#creating-your-own-handler)

By inspecting the ClientFactory class, you'll notice it does a lot of setup that gets quite tedious. The following steps are taken:

1. A soap client is created. This is used to get available wsdl functions and types, as well as to throw an exception when an invalid WSDL file is parsed.
2. A soap request formatter is created; this is what turns your action and body into a WSDL compatible soap request string.
3. A PSR-18 compatible handler is created.
4. A new Client is created and returned.

That's quite a lot of boilerplate. This is because it allows package internals to be extended and changed quickly while limiting the impact of package integrations.

Thankfully creating a client is easy. The `TBPixel\SoapClient\Handler` interface is ultimately what is passed to the client for handling requests. If PSR-18 doesn't suit your needs, you can just build your own client that implements the interface and pass it in instead!

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

### Support Me

[](#support-me)

Hi! I'm a developer living in Vancouver, BC and boy is the housing market tough. If you wanna support me, consider following me on [Twitter @TBPixel](https://twitter.com/TBPixel), or consider [buying me a coffee](https://ko-fi.com/tbpixel).

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

Total

3

Last Release

2574d ago

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[sylius/sylius

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

8.4k5.6M648](/packages/sylius-sylius)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

184616.9k31](/packages/laudis-neo4j-php-client)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[huaweicloud/huaweicloud-sdk-php

Huawei Cloud SDK for PHP

1829.2k2](/packages/huaweicloud-huaweicloud-sdk-php)

PHPackages © 2026

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