PHPackages                             wsdltophp/wsdltophp - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wsdltophp/wsdltophp

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

wsdltophp/wsdltophp
===================

Generate hierarchical PHP classes based on a WSDL

1098.0k39[8 issues](https://github.com/mikaelcom/WsdlToPhp/issues)PHP

Since Sep 6Pushed 10y ago10 watchersCompare

[ Source](https://github.com/mikaelcom/WsdlToPhp)[ Packagist](https://packagist.org/packages/wsdltophp/wsdltophp)[ RSS](/packages/wsdltophp-wsdltophp/feed)WikiDiscussions master Synced 2mo ago

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

Warning
=======

[](#warning)

This project is not intended to be improved/enhanced anymore. It is kept in his original state for those who use it as it is. From now, please look at  to get the refactored and improved version of this project which is evoluting.

WsdlToPhpGenerator
==================

[](#wsdltophpgenerator)

Generate PHP classes based on a WSDL

This package allows to programmatically send request to a SOAP service using PHP classes. In order to do that, this class generates each class for each request and each request parameters and each request response. Each class is stored in a hierarchical folder/sub-folder system. The SOAP client is then abstracted and you only deal with objects representing the WSDL types.

Generated classes are fully documented with php doc block according to phpDocumentor. It retrieves the documentation tags from the WSDL and its schemas and defines used methods, return type, parameter type, etc.

Test this library online here :

Read the PHPDoc online here :

[![Donate](https://camo.githubusercontent.com/7b6de155df30b37b25eb5fec52f9213680c3dbf067dfb7d7e2850ac4096c7d05/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e6174655f534d2e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KXBVCHP3UDQPL)

Tutorial
========

[](#tutorial)

The best way to understand how to use this code is to first look at the samples-generator.php file located in the root directory. This file shows you how to basically instanciate the WsdlToPhpGenerator class. This class has options in order to change its behaviour.

Lets have a look to see how to use it basically:

```
/* Create an instance of the generator with the WSDL from which to generate the package */
$w = new WsdlToPhpGenerator('https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl');
/* Call after the instanciation or before a new generation in order the modify the generator behaviour */
// Activate the autoload file generation
WsdlToPhpGenerator::setOptionGenerateAutoloadFile(true);
// Activate the generation and the use of the generic WsdlClass from which each generated class will inherit
WsdlToPhpGenerator::setOptionGenerateWsdlClassFile(true);
// Allows to get the SOAP response as a parameter of the generated PHP response class or not
// It depends on the SOAP Web service, some returns the Response object, others return the the data of the response object
WsdlToPhpGenerator::setOptionResponseAsWsdlObject(false);
// Very usefull if you're not familiartr with SOAP, it generates a sample file that contains all the possible
// methods provided by the SOAP Web service and first parameters level
WsdlToPhpGenerator::setOptionGenerateTutorialFile(true);
// Depending on the SOAP Web service, you may have to send an array, mySoapMethod(array('param_1'=>'value_1','param_2'=>'value_2')),
// or send parameters as the method parameters, mySoapMethod('value_1','value_2')
WsdlToPhpGenerator::setOptionSendArrayAsParameter(true);
// Used for certain SOAP Web service such as certain Microsoft Application Web service, you may have to send the parameter as
// mySoapMethod(array('parameters'=>array('param_1'=>'value_1','param_2'=>'value_2')))->parameters and get the response in the parameters response property
WsdlToPhpGenerator::setOptionSendParametersAsArray(false);
// Depending on your preferences, classes are generated under folders according to their name. The name is splitted at each upper character
// so each classes is contained by folders or not if you choose WsdlToPhpGenerator::OPT_CAT_NONE_NAME
WsdlToPhpGenerator::setOptionCategory(WsdlToPhpGenerator::OPT_CAT_START_NAME);
// Depending on your preferences, classes are generated under subfolders according to their name. The name is splitted at each upper character
// so each classes is contained by sub folders or not if you choose WsdlToPhpGenerator::OPT_SUB_CAT_NONE_NAME
WsdlToPhpGenerator::setOptionSubCategory(WsdlToPhpGenerator::OPT_SUB_CAT_END_NAME);
// Depending on your preferences, SOAP operations are gathered in mutliple classes as methods according to their name. The name is splitted at each upper character
// so each operation is contained by classes named with the start of the operation name (WsdlToPhpGenerator::OPT_GATH_METH_START_NAME) or the end (WsdlToPhpGenerator::OPT_GATH_METH_END_NAME)
WsdlToPhpGenerator::setOptionGatherMethods(WsdlToPhpGenerator::OPT_GATH_METH_START_NAME);
// Add comment to each generated file to retrieve them in the PHP Documentation
WsdlToPhpGenerator::setOptionAddComments(array(
													'date'=>date('Y-m-d'),
													'author'=>'Mikaël DELSOL',
													'version'=>1));
// Launch the generation indicating the name to use to generated the classes and the destination directory
$w->generateClasses('PayPal',dirname(__FILE__) . '/PayPal/');
// After the generation, you can analyse the audit data collected during the generation by calling the method getAudit() as below
// It returns an array with lots of informations about time spent at each generation step
print_r($w->getAudit());
```

Feel free to make request for improvements.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/f121510bbeb52d39582fbd1a2f31bc9fc4139f8ed4e89ef9c1406868c378669d?d=identicon)[wsdltophp](/maintainers/wsdltophp)

---

Top Contributors

[![mikaelcom](https://avatars.githubusercontent.com/u/584391?v=4)](https://github.com/mikaelcom "mikaelcom (159 commits)")[![Gemorroj](https://avatars.githubusercontent.com/u/885731?v=4)](https://github.com/Gemorroj "Gemorroj (7 commits)")

### Embed Badge

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

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

###  Alternatives

[shipmonk/name-collision-detector

Simple tool to find ambiguous classes or any other name duplicates within your project.

362.1M34](/packages/shipmonk-name-collision-detector)[bostondv/bootstrap-ninja-forms

Adds Bootstrap classes to Ninja Forms

222.2k](/packages/bostondv-bootstrap-ninja-forms)

PHPackages © 2026

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