PHPackages                             j3rrey/wsdl2phpgenerator - 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. [API Development](/categories/api)
4. /
5. j3rrey/wsdl2phpgenerator

ActiveLibrary[API Development](/categories/api)

j3rrey/wsdl2phpgenerator
========================

Simple class library for generating php classes from a wsdl file.

3.4.1(7y ago)27.5k↓10.4%MITPHPPHP &gt;=5.3.0

Since Oct 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/j3rrey/wsdl2phpgenerator)[ Packagist](https://packagist.org/packages/j3rrey/wsdl2phpgenerator)[ RSS](/packages/j3rrey-wsdl2phpgenerator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (9)Versions (32)Used By (0)

Quick PHP7.2 fix on count error. Just instatiated a paramater as an array and everything works as expected

wsdl2phpgenerator
=================

[](#wsdl2phpgenerator)

[![Latest Stable Version](https://camo.githubusercontent.com/bbec0bc33f943f57d940dac953b2d7c266db2f56d44dc9092470d013bc8dc089/68747470733a2f2f706f7365722e707567782e6f72672f7773646c3270687067656e657261746f722f7773646c3270687067656e657261746f722f762f737461626c652e706e67)](https://packagist.org/packages/wsdl2phpgenerator/wsdl2phpgenerator)[![Build Status](https://camo.githubusercontent.com/daac682d068d357cf279ea0a7aa39f94fdac9bf7ae0aeb9b294107ac6dd634a9/68747470733a2f2f7472617669732d63692e6f72672f7773646c3270687067656e657261746f722f7773646c3270687067656e657261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/wsdl2phpgenerator/wsdl2phpgenerator)[![Code Coverage](https://camo.githubusercontent.com/69bdfbe44d9e6d5a7b517e2af7230e3b370bf289f6a05b615a0c4632c5114445/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7773646c3270687067656e657261746f722f7773646c3270687067656e657261746f722f6261646765732f636f7665726167652e706e673f733d39313739383235356664393733393530623165326437343738663939643666366638306366366461)](https://scrutinizer-ci.com/g/wsdl2phpgenerator/wsdl2phpgenerator/)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/57bee216e7a9c52975565d4741f542053963185877b124a8f9ddc0725ab4d0fa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7773646c3270687067656e657261746f722f7773646c3270687067656e657261746f722f6261646765732f7175616c6974792d73636f72652e706e673f733d32336536303261383666373561373961326631303133636161633939353538663234363463653734)](https://scrutinizer-ci.com/g/wsdl2phpgenerator/wsdl2phpgenerator/)[![Dependency Status](https://camo.githubusercontent.com/b4ce9ad36ff1fd9e6b16db2c789fc79bc24b6285bf4396664395d95f53c8f355/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3532363937363135363332626163363762323030326539332f62616467652e706e67)](https://www.versioneye.com/user/projects/52697615632bac67b2002e93)

Simple WSDL to PHP classes converter. Takes a WSDL file and outputs class files ready to use.

Uses the [MIT license](http://www.opensource.org/licenses/mit-license.php).

> **Announcement**: We are looking to add one or two co-maintainers with commit access to help bring this project forward, review pull requests and respond to issues. If you have contributed to this project or are otherwise actively involved in open source and have a GitHub profile for review, ping [@kasperg](https://github.com/kasperg) to express your interest.

New major version: 3.0
----------------------

[](#new-major-version-30)

A new major version of wsdl2phpgenerator has recently been released: 3.0.

This introduces changes to both configuration and generated code. The changes makes it more flexible to use, easier to include in other projects, promotes contributions and reduces maintenance.

2.x users are encourage to read [a walkthrough of what is new in 3.0](docs/whats-new-in-3.0.md).

Contributors
------------

[](#contributors)

Originally developed by [@walle](https://github.com/walle) and includes bug fixes and improvements from [@vakopian](https://github.com/vakopian), [@statikbe](https://github.com/statikbe/), [@ecolinet](https://github.com/ecolinet), [@nuth](https://github.com/nuth/), [@chriskl](https://github.com/chriskl/), [@RSully](https://github.com/RSully/), [@jrbasso](https://github.com/jrbasso/), [@dypa](https://github.com/dypa/), [@Lafriks](https://github.com/Lafriks/), [@SamMousa](https://github.com/SamMousa/), [@xstefanox](https://github.com/xstefanox/), [@garex](https://github.com/garex/), [@honzap](https://github.com/honzap/), [@jk](https://github.com/jk/), [@sheeep](https://github.com/sheeep/), [@colinodell](https://github.com/colinodell/), [@red-led](https://github.com/red-led/), [@ivol84](https://github.com/ivol84/), [@wasinger](https://github.com/wasinger/), [@devlead](https://github.com/devlead/), [@NoUseFreak](https://github.com/nousefreak/), [@HighOnMikey](https://github.com/highonmikey/), [@theHarvester](https://github.com/theHarvester), [@fduch](https://github.com/fduch), [@methodin](https://github.com/methodin), [@nkm](https://github.com/nkm/), [@jongotlin](https://github.com/jongotlin/), [@yethee](https://github.com/yethee/), [@rindeal](https://github.com/rindeal/), [@vtsao](https://github.com/vtsao/), [@xoeoro](https://github.com/xoeoro/), [@lunetics](https://github.com/lunetics/), [@peter-vanpoucke](https://github.com/peter-vanpoucke/), [@jabiinfante](https://github.com/jabiinfante/), [@renatomefi](https://github.com/renatomefi/)and [@kasperg](https://github.com/kasperg/).

Pull requests are very welcome. Please read [our guidelines for contributing](https://github.com/wsdl2phpgenerator/wsdl2phpgenerator/blob/master/CONTRIBUTING.md).

Mailing list
------------

[](#mailing-list)

There is a mailing list for the project at

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

[](#installation)

Add wsdl2phpgenerator to your [Composer](https://getcomposer.org/doc/00-intro.md) project:

```
composer require wsdl2phpgenerator/wsdl2phpgenerator
```

The project will also be available as [a command line application](https://github.com/wsdl2phpgenerator/wsdl2phpgenerator-cli) which can be downloaded as a phar file.

Usage
-----

[](#usage)

To generate classes create a `Generator` instance and pass it a `Config` instance.

```
$generator = new \Wsdl2PhpGenerator\Generator();
$generator->generate(
	new \Wsdl2PhpGenerator\Config(array(
        'inputFile' => 'input.wsdl',
        'outputDir' => '/tmp/output'
    ))
);
```

After generating the code then configure your existing autoloader accordingly. The generated code also comes with a simple `autoload.php` file which can be included directly. This registers a simple autoloader for the generated classes.

#### Example usage

[](#example-usage)

The following example will generate code from a web service, load the generated classes, call the web service and return the result over the course of a single process.

```
$generator = new \Wsdl2PhpGenerator\Generator();
$generator->generate(
	new \Wsdl2PhpGenerator\Config(array(
        'inputFile' => 'http://www.webservicex.net/CurrencyConvertor.asmx?WSDL',
        'outputDir' => '/tmp/CurrencyConverter'
    ))
);

require '/tmp/CurrencyConverter/autoload.php';

// A class will generated representing the service.
// It is named after the element in the WSDL and has a method for each operation.
$service = new \CurrencyConvertor();
$request = new \ConversionRate(\Currency::USD, \Currency::EUR);
$response = $service->ConversionRate($request);

echo $response->getConversionRateResult();
```

Note that this is not recommended usage. Normally code generation and web services calls will be two separate processes.

### Options

[](#options)

The generator supports a range of options which can be set in the configuration.

#### `inputFile`

[](#inputfile)

The path or url to the WSDL to generate classes from.

#### `outputDir`

[](#outputdir)

The directory to place the generated classes in. It will be created if it does not already exist.

#### `namespaceName`

[](#namespacename)

The [namespace](http://php.net/manual/en/language.namespaces.php) to use for the generated classes. If not set classes will be generated without a namespace.

##### Example usage

[](#example-usage-1)

The following configuration will place generated code from the [CDYNE Weather web service](http://wiki.cdyne.com/?title=CDYNE_Weather) under the `CDyne\Weather` namespace:

```
$generator = new \Wsdl2PhpGenerator\Generator();
$generator->generate(
    new \Wsdl2PhpGenerator\Config(array(
        'inputFile' => 'http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl',
        'outputDir' => '/tmp/weather',
        'namespaceName' => 'CDyne\Weather'
    ))
);
```

#### `classNames`

[](#classnames)

A comma-separared list or array of class names to generate. All other classes in the WSDL will be ignored.

This option is deprecated and will be removed in 4.0.0. Use `operationNames` instead.

##### Example usage

[](#example-usage-2)

The following configuration will only generate `AmazonEC2` and `CopyImageType` classes from the Amazon EC2 webservice.

```
$generator = new \Wsdl2PhpGenerator\Generator();
$generator->generate(
    new \Wsdl2PhpGenerator\Config(array(
        'inputFile' => 'https://s3.amazonaws.com/ec2-downloads/2013-10-01.ec2.wsdl',
        'outputDir' => '/tmp/amazon',
        'classNames' => 'AmazonEC2, CopyImageType'
    ))
);
```

#### `operationNames`

[](#operationnames)

A comma-separated list or array of service operations to generate. This will only generate types that are needed for selected operations. The generated service class will only contain selected operation.

##### Example usage

[](#example-usage-3)

The following configuration will generate operations and types for `ReplaceRouteTableAssociation` and `RequestSpotInstances` operations.

```
$generator = new \Wsdl2PhpGenerator\Generator();
$generator->generate(
    new \Wsdl2PhpGenerator\Config(array(
        'inputFile' => 'https://s3.amazonaws.com/ec2-downloads/2013-10-01.ec2.wsdl',
        'outputDir' => '/tmp/amazon',
        'operationNames' => 'ReplaceRouteTableAssociation, RequestSpotInstances'
    ))
);
```

#### `sharedTypes`

[](#sharedtypes)

If enabled this makes all types with the same identify use the same class and only generate it once. The default solution is to prepend numbering to avoid name clashes.

#### `constructorParamsDefaultToNull`

[](#constructorparamsdefaulttonull)

If enabled this sets the default value of all parameters in all constructors to `null`. If this is used then properties must be set using accessors.

#### `proxy`

[](#proxy)

Specify a proxy to use when accessing the WSDL and other external ressources. This option should be used instead of \[the proxy options support by the PHP `SoapClient`\] () as wsdl2phpgenerator uses more than the SOAP client to extract information.

The following formats are supported:

- An array with the following keys `host`, `port`, `login` and `password` matching \[the proxy options support by the PHP `SoapClient`\] ()
- A string in an URL-like format

The proxy information is used by is used when accessing the WSDL to generate the code and for subsequent requests to the SOAP service.

##### Example usage

[](#example-usage-4)

The following configuration will use a proxy to access the [Google DoubleClick Ad Exchange Buyer SOAP API](https://developers.google.com/ad-exchange/buyer-soap/):

```
$generator = new \Wsdl2PhpGenerator\Generator();
$generator->generate(
    new \Wsdl2PhpGenerator\Config(array(
        'inputFile' => 'https://ads.google.com/apis/ads/publisher/v201306/ActivityService?wsdl',
        'outputDir' => '/tmp/amazon',
        'proxy' => 'tcp://user:secret@192.168.0.1:8080'
    ))
);
```

#### `soapClientClass`

[](#soapclientclass)

The base class to use for generated services. This should be a subclass of the [PHP `SoapClient`](http://php.net/manual/en/class.soapclient.php).

Examples of third party SOAP client implementations which can be used:

- [BeSimpleSoapClient](https://github.com/BeSimple/BeSimpleSoapClient)
- [ZendFramework2 SOAP Component](https://github.com/zendframework/Component_ZendSoap)
- [soap-plus](https://github.com/dcarbone/soap-plus)
- [SoapClientEx](https://gist.github.com/RobThree/4117914)

Note that it is the responsibility of the surrounding code to ensure that the base class is available during code generation and when calling web services.

##### Example usage

[](#example-usage-5)

The following configuration will use the BeSimple SOAP client as base class:

```
$generator = new \Wsdl2PhpGenerator\Generator();
$generator->generate(
    new \Wsdl2PhpGenerator\Config(array(
        'inputFile' => 'input.wsdl',
        'outputDir' => '/tmp/output',
        'soapClientClass' => '\BeSimple\SoapClient\SoapClient'
    ))
);
```

#### `soapClientOptions`

[](#soapclientoptions)

An array of configuration options to pass to the SoapClient. They will be used when accessing the WSDL to generate the code and as defaults for subsequent requests to the SOAP service. The PHP documentation has [a list of supported options](http://php.net/manual/en/soapclient.soapclient.php#refsect1-soapclient.soapclient-parameters).

The list of options for the client can be extended by using more advanced `SoapClient` implementations.

Note that wsdl2phpgenerator expects the `features` option to contain `SOAP_SINGLE_ELEMENT_ARRAYS`. [This ensures that type hints are consistent even if sequences only contain one element](http://php.net/manual/en/soapclient.soapclient.php#73082). If the `features` option is set explicitly in `soapClientOptions` the `SOAP_SINGLE_ELEMENT_ARRAYS` must also be added explicitly.

##### Example usage

[](#example-usage-6)

The following configuration will enable basic authentication and set the connection timeout to 60 seconds.

```
$generator = new \Wsdl2PhpGenerator\Generator();
$generator->generate(
    new \Wsdl2PhpGenerator\Config(array(
        'inputFile' => 'input.wsdl',
        'outputDir' => '/tmp/output',
        'soapClientOptions' => array(
        	'authentication' => SOAP_AUTHENTICATION_BASIC,
        	'login' => 'username',
        	'password' => 'secret',
        	'connection_timeout' => 60
    ))
));
```

Versioning
----------

[](#versioning)

This project aims to use [semantic versioning](http://semver.org/). The following constitutes the public API:

- `\Wsdl2PhpGenerator\GeneratorInterface`
- `\Wsdl2PhpGenerator\ConfigInterface`
- Generated code

Backwards incompatible changes to these means that the major version will be increased. Additional features and bug fixes increate minor and patch versions.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 77.6% 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 ~63 days

Recently: every ~262 days

Total

30

Last Release

2729d ago

Major Versions

2.5.5 → 3.0.02014-11-25

0.1 → 3.4.12018-11-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/776a9c3e2d51e5efd470886809cb8a16f94afa3e044690b6cf4e9ac4ae103bf9?d=identicon)[J3rrey](/maintainers/J3rrey)

---

Top Contributors

[![kasperg](https://avatars.githubusercontent.com/u/73966?v=4)](https://github.com/kasperg "kasperg (322 commits)")[![walle](https://avatars.githubusercontent.com/u/191136?v=4)](https://github.com/walle "walle (33 commits)")[![honzap](https://avatars.githubusercontent.com/u/342109?v=4)](https://github.com/honzap "honzap (10 commits)")[![red-led](https://avatars.githubusercontent.com/u/1540305?v=4)](https://github.com/red-led "red-led (7 commits)")[![chriskl](https://avatars.githubusercontent.com/u/1606651?v=4)](https://github.com/chriskl "chriskl (4 commits)")[![statik-olmo-archived](https://avatars.githubusercontent.com/u/1501928?v=4)](https://github.com/statik-olmo-archived "statik-olmo-archived (3 commits)")[![garex](https://avatars.githubusercontent.com/u/77981?v=4)](https://github.com/garex "garex (3 commits)")[![ivol84](https://avatars.githubusercontent.com/u/1837943?v=4)](https://github.com/ivol84 "ivol84 (3 commits)")[![jabiinfante](https://avatars.githubusercontent.com/u/2393956?v=4)](https://github.com/jabiinfante "jabiinfante (3 commits)")[![BerryJerry](https://avatars.githubusercontent.com/u/49227383?v=4)](https://github.com/BerryJerry "BerryJerry (2 commits)")[![j3rrey](https://avatars.githubusercontent.com/u/5716777?v=4)](https://github.com/j3rrey "j3rrey (2 commits)")[![RSully](https://avatars.githubusercontent.com/u/185004?v=4)](https://github.com/RSully "RSully (2 commits)")[![SamMousa](https://avatars.githubusercontent.com/u/547021?v=4)](https://github.com/SamMousa "SamMousa (2 commits)")[![ecolinet](https://avatars.githubusercontent.com/u/65506?v=4)](https://github.com/ecolinet "ecolinet (2 commits)")[![lafriks](https://avatars.githubusercontent.com/u/165205?v=4)](https://github.com/lafriks "lafriks (2 commits)")[![yuav](https://avatars.githubusercontent.com/u/126129127?v=4)](https://github.com/yuav "yuav (1 commits)")[![devlead](https://avatars.githubusercontent.com/u/1647294?v=4)](https://github.com/devlead "devlead (1 commits)")[![fduch](https://avatars.githubusercontent.com/u/1204137?v=4)](https://github.com/fduch "fduch (1 commits)")[![jongotlin](https://avatars.githubusercontent.com/u/165154?v=4)](https://github.com/jongotlin "jongotlin (1 commits)")[![joshk](https://avatars.githubusercontent.com/u/8701?v=4)](https://github.com/joshk "joshk (1 commits)")

---

Tags

soapwsdl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/j3rrey-wsdl2phpgenerator/health.svg)

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

###  Alternatives

[sylius/sylius

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

8.4k5.6M650](/packages/sylius-sylius)[camcima/camcima-soap-client

Wrapper around PHP SoapClient class

2672.0k2](/packages/camcima-camcima-soap-client)[conquer/services

Yii2 soap wsdl web services

1632.5k](/packages/conquer-services)[skautis/skautis

Library for API calls to SkautIS

1329.7k4](/packages/skautis-skautis)

PHPackages © 2026

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