PHPackages                             meng-tian/soap-http-binding - 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. meng-tian/soap-http-binding

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

meng-tian/soap-http-binding
===========================

A PHP library for binding SOAP messages to PSR-7 HTTP messages.

0.4.2(1mo ago)162.7M↓47.7%124MITPHPPHP ^8.2CI passing

Since Feb 29Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/meng-tian/soap-http-binding)[ Packagist](https://packagist.org/packages/meng-tian/soap-http-binding)[ RSS](/packages/meng-tian-soap-http-binding/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (8)Versions (15)Used By (4)

SOAP HTTP Binding [![codecov.io](https://camo.githubusercontent.com/dcd96fa3db6010692ece5cb0be7201358fd6828458c2b8cf3ea6b7f6f554e28f/68747470733a2f2f636f6465636f762e696f2f6769746875622f6d656e672d7469616e2f736f61702d687474702d62696e64696e672f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/meng-tian/soap-http-binding?branch=master) [![workflow](https://github.com/meng-tian/soap-http-binding/actions/workflows/main.yaml/badge.svg)](https://github.com/meng-tian/soap-http-binding/actions/workflows/main.yaml/badge.svg)
======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#soap-http-binding--)

This library binds `SOAP 1.1` and `SOAP 1.2` messages to PSR-7 HTTP messages.

Requirement
-----------

[](#requirement)

PHP 8.2 or newer. PHP 7.x and PHP 8.0-8.1 remain available only through older releases.

Install
-------

[](#install)

```
composer require meng-tian/soap-http-binding:^0.4.2

```

Usage
-----

[](#usage)

`HttpBinding::request` embeds SOAP reqeust messages into PSR-7 HTTP requests.

```
use Meng\Soap\HttpBinding\HttpBinding;
use Meng\Soap\HttpBinding\RequestBuilder;
use Meng\Soap\Interpreter;
use Laminas\Diactoros\RequestFactory;
use Laminas\Diactoros\StreamFactory;

$interpreter = new Interpreter('http://www.webservicex.net/airport.asmx?WSDL');
$streamFactory = new StreamFactory();
$requestFactory = new RequestFactory();
$builder = new RequestBuilder($streamFactory, $requestFactory);
$httpBinding = new HttpBinding($interpreter, $builder, $streamFactory);

$request = $httpBinding->request('GetAirportInformationByCountry', [['country' => 'United Kingdom']]);
echo \Laminas\Diactoros\Request\Serializer::toString($request);
```

Output:

```
POST /airport.asmx HTTP/1.1
Content-Length: 322
SOAPAction: http://www.webserviceX.NET/GetAirportInformationByCountry
Content-Type: text/xml; charset="utf-8"
Host: www.webservicex.net

United Kingdom

```

`HttpBinding::response` retrieves SOAP response messages from PSR-7 HTTP responses:

```
use Meng\Soap\HttpBinding\HttpBinding;
use Meng\Soap\HttpBinding\RequestBuilder;
use Meng\Soap\Interpreter;
use Laminas\Diactoros\Response;
use Laminas\Diactoros\Stream;
use Laminas\Diactoros\RequestFactory;
use Laminas\Diactoros\StreamFactory;

$response =  'text/xml; charset=utf-8']);

$interpreter = new Interpreter('http://www.webservicex.net/airport.asmx?WSDL');
$streamFactory = new StreamFactory();
$requestFactory = new RequestFactory();
$builder = new RequestBuilder($streamFactory, $requestFactory);
$httpBinding = new HttpBinding($interpreter, $builder, $streamFactory);
$response = $httpBinding->response($response, 'GetAirportInformationByCountry');

print_r($response);
```

Output:

```
stdClass Object
(
    [GetAirportInformationByCountryResult] => some result
)

```

This library also support `SOAP 1.2` HTTP GET binding through `RequestBuilder` class :

```
use Meng\Soap\HttpBinding\RequestBuilder;
use Laminas\Diactoros\RequestFactory;
use Laminas\Diactoros\StreamFactory;

$streamFactory = new StreamFactory();
$requestFactory = new RequestFactory();
$builder = new RequestBuilder($streamFactory, $requestFactory);
$request = $builder->isSOAP12()
    ->setEndpoint('http://www.endpoint.com')
    ->setHttpMethod('GET')
    ->getSoapHttpRequest();
echo \Laminas\Diactoros\Request\Serializer::toString($request);
```

Output:

```
GET / HTTP/1.1
Accept: application/soap+xml
Host: www.endpoint.com

```

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
```

License
-------

[](#license)

This library is released under [MIT](https://github.com/meng-tian/soap-http-binding/blob/master/LICENSE) license.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance91

Actively maintained with recent releases

Popularity51

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 95.7% 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 ~343 days

Recently: every ~485 days

Total

12

Last Release

41d ago

PHP version history (4 changes)0.1.0PHP &gt;=5.4.0

0.3.0PHP &gt;=5.6.0

0.4.0PHP &gt;=7.1.0

0.4.2PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c250a32e9aa4cc18178efc26b28d5a542033110d5630733380087aadf5d8e4ee?d=identicon)[meng-tian](/maintainers/meng-tian)

---

Top Contributors

[![realmtian](https://avatars.githubusercontent.com/u/4396851?v=4)](https://github.com/realmtian "realmtian (45 commits)")[![andrewtweber](https://avatars.githubusercontent.com/u/2760420?v=4)](https://github.com/andrewtweber "andrewtweber (2 commits)")

---

Tags

httpphpsoaphttppsr-7soap

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/meng-tian-soap-http-binding/health.svg)

```
[![Health](https://phpackages.com/badges/meng-tian-soap-http-binding/health.svg)](https://phpackages.com/packages/meng-tian-soap-http-binding)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B4.4k](/packages/guzzlehttp-psr7)[league/uri

URI manipulation library

1.1k252.7M429](/packages/league-uri)[mezzio/mezzio

PSR-15 Middleware Microframework

3973.9M133](/packages/mezzio-mezzio)[sunrise/http-router

A powerful solution as the foundation of your project.

16852.3k12](/packages/sunrise-http-router)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

597.5M105](/packages/laminas-laminas-stratigility)[laudis/neo4j-php-client

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

187738.3k49](/packages/laudis-neo4j-php-client)

PHPackages © 2026

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