PHPackages                             blackbird/mtomsoapclient - 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. blackbird/mtomsoapclient

ActiveLibrary

blackbird/mtomsoapclient
========================

This class overrides SoapClient::\_\_doRequest() method to implement MTOM for PHP. It decodes XML and integrate attachments in the XML response.

1.0.0(6y ago)0403MITPHPPHP &gt;=5.4

Since May 20Pushed 6y agoCompare

[ Source](https://github.com/blackbird-agency/MTOMSoapClient)[ Packagist](https://packagist.org/packages/blackbird/mtomsoapclient)[ Docs](https://github.com/debuss/MTOMSoapClient)[ RSS](/packages/blackbird-mtomsoapclient/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

MTOMSoapClient
==============

[](#mtomsoapclient)

Small PHP Soap class to deal with MTOM technology, fetching binaries as base64 string.

This class overrides SoapClient::\_\_doRequest() method to implement MTOM for PHP.
It decodes XML and integrate attachments in the XML response.

It replaces the

```

```

By the binary code contained in attachment

```
Content-ID:

```

Personal Note
=============

[](#personal-note)

The class is not perfect and not so optimized but it works for most cases and you can modify it as you wish to make it better.

**Enjoy !**

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

[](#installation)

Via composer :

```
$ composer require debuss-a/mtomsoapclient "dev-master"

```

Example
=======

[](#example)

Use it the same as a normal Soap call :

```
$client = new MTOMSoapClient($webservice, array(
    'trace' => true,
    'exceptions' => true,
    'soap_version' => SOAP_1_1,
    'encoding' => 'utf-8'
));

$result = $client->__call(
    $method,
    $parameters
);

if (!$result instanceof stdClass) {
    throw new Exception('Soap call response is not a valid stdClass instance.');
}

var_dump($result->path->to->my->data);
```

### Explanation

[](#explanation)

It will turn this answer (normal Soap Response, MTOM is not parsed by Soap) :

```

               0
               La requete a ete traitee avec succes
               INFOS

               6A11353659111

```

To this (MTOMSoap Response, tags are replaced by there base64 values) :

```

          0
          La requete a ete traitee avec succes
          INFOS

          EENUfn5DRCx+Q0NefkNUfg0KXlhBDQpeUF[... ZPL code shortened for the sake of this Readme.md ...]
          6A12097564594

```

A *var\_dump()* of \_$result = $client-&gt;\_\_call($url, $params) will look like this (**Note :** SoapClient auto base64\_decode()) :

```
object(stdClass)[2]
  public 'return' =>
    object(stdClass)[3]
      public 'messages' =>
        object(stdClass)[4]
          public 'id' => string '0' (length=1)
          public 'messageContent' => string 'La requete a ete traitee avec succes' (length=41)
          public 'type' => string 'INFOS' (length=5)
      public 'labelResponse' =>
        object(stdClass)[5]
          public 'label' => string '�CT~~CD,~CC^~CT~
^XA
^PW799
^FO0,0^GFA,11264,11264,00088,:Z64:
eJzt2UFv2zYUAGByKqIW8MKrD4bUnnbVsEsGuGH+wf[... ZPL code shortened for the sake of this Readme.md ...]' (length=5856)
          public 'parcelNumber' => string '6A12097564600' (length=13)
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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

Unknown

Total

1

Last Release

2547d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/95669?v=4)[Thom](/maintainers/thomasklein)[@thomasklein](https://github.com/thomasklein)

---

Top Contributors

[![debuss](https://avatars.githubusercontent.com/u/2537607?v=4)](https://github.com/debuss "debuss (7 commits)")[![thomas-kl1](https://avatars.githubusercontent.com/u/20971693?v=4)](https://github.com/thomas-kl1 "thomas-kl1 (1 commits)")

### Embed Badge

![Health badge](/badges/blackbird-mtomsoapclient/health.svg)

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

PHPackages © 2026

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