PHPackages                             meng-tian/php-soap-interpreter - 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. meng-tian/php-soap-interpreter

ActiveLibrary

meng-tian/php-soap-interpreter
==============================

A PHP library for interpreting SOAP messages.

2.0.0(3y ago)212.6M—1.1%10[1 PRs](https://github.com/meng-tian/php-soap-interpreter/pulls)3MITPHPPHP &gt;=7.1.0CI failing

Since Feb 7Pushed 3y ago2 watchersCompare

[ Source](https://github.com/meng-tian/php-soap-interpreter)[ Packagist](https://packagist.org/packages/meng-tian/php-soap-interpreter)[ RSS](/packages/meng-tian-php-soap-interpreter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (10)Used By (3)

PHP SOAP Interpreter [![codecov.io](https://camo.githubusercontent.com/5e950ba980c89ac5a1af5963c9b4e194b371bf198625b2314f54cc7ea31e2e1c/68747470733a2f2f636f6465636f762e696f2f6769746875622f6d656e672d7469616e2f7068702d736f61702d696e7465727072657465722f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/meng-tian/php-soap-interpreter?branch=master) [![workflow](https://github.com/meng-tian/php-soap-interpreter/actions/workflows/main.yaml/badge.svg)](https://github.com/meng-tian/php-soap-interpreter/actions/workflows/main.yaml/badge.svg)
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#php-soap-interpreter--)

A PHP library for interpreting `SOAP 1.1` and `SOAP 1.2` messages. It can be used in WSDL or non-WSDL mode. The implementation is built on the top of PHP's [SoapClient](http://php.net/manual/en/class.soapclient.php).

### Prerequisite

[](#prerequisite)

PHP 7.1 --enablelibxml --enable-soap

### Install

[](#install)

```
composer require meng-tian/php-soap-interpreter

```

### Usage

[](#usage)

An `Interpreter` is responsible for generating SOAP request messages and translating SOAP response messages. The constructor of `Interpreter` class is the same as `SoapClient`. The first parameter is `wsdl`, the second parameter is an array of `options`.

It should be noted that *not* all `options` supported by `SoapClient` are supported by `Interpreter`. The supported `options` of `Interpreter` are: `location`, `uri`, `style`, `use`, `soap_version`, `encoding`, `exceptions`, `classmap`, `typemap`, `cache_wsdl` and `features`. More detailed explanations of those options can be found in [SoapClient::SoapClient](http://php.net/manual/en/soapclient.soapclient.php). The unsupported options are related to debugging or HTTP transport, which are not the intended responsibility of `Interpreter`.

### Basic Examples

[](#basic-examples)

###### Generate SOAP request message in WSDL mode

[](#generate-soap-request-message-in-wsdl-mode)

```
$interpreter = new Interpreter('http://www.webservicex.net/length.asmx?WSDL');
$request = $interpreter->request(
    'ChangeLengthUnit',
    [['LengthValue'=>'1', 'fromLengthUnit'=>'Inches', 'toLengthUnit'=>'Meters']]
);

print_r($request->getSoapMessage());
```

Output:

```

1InchesMeters

```

###### Translate SOAP response message

[](#translate-soap-response-message)

```
$interpreter = new Interpreter('http://www.webservicex.net/length.asmx?WSDL');
$response =  0.0254
)
*/
```

### Advanced Examples

[](#advanced-examples)

###### Generate SOAP request message in non-WSDL mode

[](#generate-soap-request-message-in-non-wsdl-mode)

```
// In non-WSDL mode, location and uri must be provided as they are required by SoapClient.
$interpreter = new Interpreter(null, ['location'=>'http://www.webservicex.net/length.asmx', 'uri'=>'http://www.webserviceX.NET/']);
$request = $interpreter->request(
    'ChangeLengthUnit',
    [
        new SoapParam('1', 'ns1:LengthValue'),
        new SoapParam('Inches', 'ns1:fromLengthUnit'),
        new SoapParam('Meters', 'ns1:toLengthUnit')
    ],
    ['soapaction'=>'http://www.webserviceX.NET/ChangeLengthUnit']
);

print_r($request->getSoapMessage());
```

Output:

```

1InchesMeters

```

###### SOAP input headers

[](#soap-input-headers)

```
$interpreter = new Interpreter('http://www.webservicex.net/CurrencyConvertor.asmx?WSDL');
$request = $interpreter->request('ConversionRate', [['FromCurrency' => 'AFA', 'ToCurrency' => 'ALL']], null, [new SoapHeader('www.namespace.com', 'test_header', 'header_data')]);
print_r($request->getSoapMessage());
```

Output:

```

header_data
AFAALL

```

###### SOAP output headers

[](#soap-output-headers)

TODO

###### Class map

[](#class-map)

TODO

###### Type map

[](#type-map)

TODO

### Relevant

[](#relevant)

- [SOAP HTTP Binding](https://github.com/meng-tian/soap-http-binding): binding SOAP messages to PSR-7 HTTP messages.
- [PHP Asynchronous SOAP](https://github.com/meng-tian/php-async-soap): asynchronous SOAP clients.

### License

[](#license)

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

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~412 days

Recently: every ~614 days

Total

7

Last Release

1277d ago

Major Versions

0.2.0 → 1.0.02016-02-26

1.0.3 → 2.0.02022-11-19

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

2.0.0PHP &gt;=7.1.0

### 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 (48 commits)")

---

Tags

soapwsdlsoap

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[artisaninweb/laravel-soap

A SoapClient wrapper integration for Laravel

6314.5M12](/packages/artisaninweb-laravel-soap)[econea/nusoap

Fixed NuSOAP for PHP 5.6 - 8.5

3315.5M26](/packages/econea-nusoap)[wsdltophp/packagegenerator

Generate hierarchical PHP classes based on a WSDL

4351.9M19](/packages/wsdltophp-packagegenerator)[robrichards/wse-php

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

1326.0M30](/packages/robrichards-wse-php)[laminas/laminas-soap

6121.8M37](/packages/laminas-laminas-soap)

PHPackages © 2026

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