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

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

debuss-a/mtomsoapclient
=======================

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

4.0.1(5mo ago)34170.3k↓28.1%72MITPHPPHP ^8.2CI passing

Since Jul 16Pushed 5mo ago4 watchersCompare

[ Source](https://github.com/debuss/MTOMSoapClient)[ Packagist](https://packagist.org/packages/debuss-a/mtomsoapclient)[ Docs](https://github.com/debuss/MTOMSoapClient)[ RSS](/packages/debuss-a-mtomsoapclient/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (2)

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

[](#mtomsoapclient)

[![Build Status](https://camo.githubusercontent.com/5f33cc7af22f8defccb1a4af9e796d9fb758cc243a3ae180c6b89318c0f6674e/68747470733a2f2f7472617669732d63692e636f6d2f6465627573732f6d746f6d736f6170636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/debuss/mtomsoapclient)[![Latest Stable Version](https://camo.githubusercontent.com/c97659599ec384df1d8c3dc86c81e584184c76302c3ce003c22b744179ec3306/68747470733a2f2f706f7365722e707567782e6f72672f6465627573732d612f6d746f6d736f6170636c69656e742f76)](//packagist.org/packages/debuss-a/mtomsoapclient)[![Total Downloads](https://camo.githubusercontent.com/b13ebfa109c28778188f5c7c055e1595f1cd6990adc93339ad2705acdf88c076/68747470733a2f2f706f7365722e707567782e6f72672f6465627573732d612f6d746f6d736f6170636c69656e742f646f776e6c6f616473)](//packagist.org/packages/debuss-a/mtomsoapclient)[![License](https://camo.githubusercontent.com/e5bd6ab5a83979a250ee353b79c9d5534ab2368245c2a6ca4fd2e7516828ab55/68747470733a2f2f706f7365722e707567782e6f72672f6465627573732d612f6d746f6d736f6170636c69656e742f6c6963656e7365)](//packagist.org/packages/debuss-a/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

```

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

56

—

FairBetter than 97% of packages

Maintenance73

Regular maintenance activity

Popularity44

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 60.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 ~333 days

Recently: every ~435 days

Total

7

Last Release

153d ago

Major Versions

1.0.0 → 2.0.02020-08-11

2.1.0 → 3.0.02023-02-09

3.0.1 → 4.0.02026-01-05

PHP version history (5 changes)1.0.0PHP &gt;=5.4

2.0.0PHP ^7.2

2.1.0PHP ^7.2|^8.0

3.0.0PHP ^7.3||^8.0

4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e1a70117520fe10a630d61c750bbe6888d174e9903825e741470f818ee2c5d1?d=identicon)[debuss-a](/maintainers/debuss-a)

---

Top Contributors

[![debuss](https://avatars.githubusercontent.com/u/2537607?v=4)](https://github.com/debuss "debuss (17 commits)")[![klapaudius](https://avatars.githubusercontent.com/u/610451?v=4)](https://github.com/klapaudius "klapaudius (11 commits)")

---

Tags

soapsoapclientmtom

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[econea/nusoap

Fixed NuSOAP for PHP 5.6 - 8.5

3395.7M27](/packages/econea-nusoap)[robrichards/wse-php

Libraries for adding WS-\* support to ext/soap in PHP.

1346.2M32](/packages/robrichards-wse-php)[clue/soap-react

Simple, async SOAP webservice client library, built on top of ReactPHP

64121.9k2](/packages/clue-soap-react)[meng-tian/async-soap-guzzle

An asynchronous SOAP client build on top of Guzzle.

992.5M4](/packages/meng-tian-async-soap-guzzle)[wsdltophp/wssecurity

Allows to easily add Ws Security header to a SOAP Request

42863.7k8](/packages/wsdltophp-wssecurity)[meng-tian/soap-http-binding

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

162.6M4](/packages/meng-tian-soap-http-binding)

PHPackages © 2026

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