PHPackages                             georgo/wsdl-creator - 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. georgo/wsdl-creator

ActiveLibrary[API Development](/categories/api)

georgo/wsdl-creator
===================

PHP WSDL creator using PHPdoc (annotations, reflections).

1.4.1.4(9y ago)918.2k↓25%8MITPHP

Since Oct 15Pushed 7y ago3 watchersCompare

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

READMEChangelogDependencies (4)Versions (13)Used By (0)

PHP WSDL Creator
================

[](#php-wsdl-creator)

[![Build Status](https://camo.githubusercontent.com/874e7dac6168db6a8dbb51caa737167e4390dfec9d9d40aa05d1be69bf7f2647/68747470733a2f2f7472617669732d63692e6f72672f47656f72676f2f7773646c2d63726561746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Georgo/wsdl-creator)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/4a2f2e85a88c162394f344bde0b367276513245f19415073e96daaf67cb2d49f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67656f72676f2f7773646c2d63726561746f722f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/georgo/wsdl-creator/)[![Coverage Status](https://camo.githubusercontent.com/63ab62e9e0677770feff70d09cf31efa49e36c71f4bda276220277d5531fa8d4/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f47656f72676f2f7773646c2d63726561746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Georgo/wsdl-creator?branch=master)[![Dependency Status](https://camo.githubusercontent.com/4b63e76f74f973bf53b345078e82f3e67a783d8c98c5aecfb76821d441d4523d/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3536653662663435393666383063303033363263643662612f62616467652e706e67)](https://www.versioneye.com/user/projects/56e6bf4596f80c00362cd6ba)

Introduction
------------

[](#introduction)

WSDL creator allows generating WSDL documents based on PHP classes using annotations and reflection mechanism. This generator also give possibilty to generating overview methods and parameters with SOAP examples used in WSDL.

Support: &gt;= PHP5.5.

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

[](#installation)

To install wsdl-creator at your project use [composer](http://getcomposer.org).

\###Create new project:

`composer.phar create-project georgo/wsdl-creator myproject`

\###or add to the composer.json file:

```
require: {
	"georgo/wsdl-creator": "1.*"
}

```

Configuration
-------------

[](#configuration)

To start working with creator you must create new `WSDLCreator` object and define for him:

- class to generate `WSDL`
- `SOAP` server location
- documnet namespace.

```
$wsdl = new WSDL\WSDLCreator('ClassName', 'http://localhost/wsdl-creator/ClassName.php');
$wsdl->setNamespace("http://foo.bar/");
```

`SOAP` server must be created in location specified in `WSDLCreator`.

```
$server = new SoapServer(null, array(
    'uri' => 'http://localhost/wsdl-creator/ClassName.php'
));
$server->setClass('ClassName');
$server->handle();
```

To render `XML` use method `renderWSDL`. To properly load generator classes use composer loader which is in `vendor/autoload.php`.

Full configutaion listing:

```
require_once 'vendor/autoload.php';

use WSDL\WSDLCreator;

if (isset($_GET['wsdl'])) {
    $wsdl = new WSDL\WSDLCreator('ClassName', 'http://localhost/wsdl-creator/ClassName.php');
    $wsdl->setNamespace("http://foo.bar/");
    $wsdl->renderWSDL();
    exit;
}

$server = new SoapServer(null, array(
    'uri' => 'http://localhost/wsdl-creator/ClassName.php'
));
$server->setClass('ClassName');
$server->handle();
```

Now if we try call address `http://localhost/wsdl-creator/ClassName.php?wsdl` you recive `WSDL` document.

Define web service method
-------------------------

[](#define-web-service-method)

To define is a web service method you must use `@WebMethod` annotation.

Simple type
-----------

[](#simple-type)

Simple types are described [here](http://infohost.nmt.edu/tcc/help/pubs/rnc/xsd.html#xsd-types).

\###Usage

```
/**
* @param string $name
*/

```

So you type `@param` next type one of simple types (`string`) after name of variable (`$name`).

---

You can also use `arrays` of the simple types.

\###Usage

```
/**
* @param string[] $names
*/

```

In input parameter now you must define what type of array you pass (`string[]`).

---

\###Example

[SimpleTypeExample](examples/SimpleExampleSoapServer.php)

---

\###Annotations

- @desc Method description
- @param type $varialbe\_name
- @return type $return

Wrapper type
------------

[](#wrapper-type)

Wrapper types are user defined clases which you can generate `WSDL` complex types.

\###Usage

```
/**
* @param wrapper $user @className=User
*/

```

You must define class `User` with public fields and doc comments which contains field type as example:

```
class User
{
	/**
	* @type string
	*/
	public $name;
	/**
	* @type int
	*/
	public $age;
}
```

This mechanism use [reflection](http://php.net/manual/en/book.reflection.php), i.e. `User` class must be visible to the generated class - possible use [namespaces](http://php.net/manual/en/language.namespaces.php) (`\Namespace\To\User`).

---

You can define arrays of wrappers.

\###Usage

```
/**
* @return wrapper[] $users @className=User
*/

```

This annotation will generate array of users.

---

\###Example

[WrapperTypeExample](examples/WrapperExampleSoapServer.php)

---

\###Annotations

- @desc Method description
- @param wrapper\[\] @className=ClassName
- @return wrapper @className=\\Namespace\\To\\ClassName

Object type
-----------

[](#object-type)

You can dynamically create object at runtime. Use `object` parameter type.

\###Usage

```
/**
* @param object $info @string=$name @int=$age
*/

```

This annotation create complex type with `name` and `age` elements.

---

Also you can wrapp classes in object.

\###Usage

```
/**
* @return object $userNameWithId @(wrapper $user @className=User) @int=$id
*/

```

Above example will return `UserNameWithId` object which contains pointer to `User` complex type and `int` type.

---

Another option is creating array of objects.

\###Usage

```
/**
* @param object[] $payments @float=$payment @string=$user
*/

```

This annotation creata array of objects with `payment` and `user` on each element of array.

---

\###Example

[ObjectTypeExample](examples/ObjectExampleSoapServer.php)

---

\###Additional info

In `object` you can use array of wrappers and array of simple types.

---

\###Annotations

- @desc Method description
- @param object $object @type1=$name1 @type2=$name2
- @param object $object @(wrapper $nameWrapper @className=User) @type1=$name1
- @param object\[\] $object @type1\[\]=$name1
- @return

Service overview
----------------

[](#service-overview)

You can generate service overview through `renderWSDLService` method. This show all infos about method and parameters used in service with sample `SOAP` *request*.

\###Example

[![Wrapper image](examples/wrapper.png)](examples/wrapper.png)

Styles
------

[](#styles)

By default, the `WSDLCreator` will generate WSDLs using the rpc/literal binding style.

To specify rpc/encoded or a wrapped document/literal binding style, set the binding style on the `WSDLCreator` object.

```
$wsdl = new WSDL\WSDLCreator('ClassName', 'http://localhost/wsdl-creator/ClassName.php');
@wsdl->setBindingStyle(new WSDL\XML\Styles\RpcEncoded());
$wsdl->setNamespace("http://foo.bar/");
```

When specifying the wrapped document/literal binding style, you can use `WSDL\DocumentLiteralWrapper` to automatically wrap the returning value in an appropriate wrapped object.

```
require_once 'vendor/autoload.php';

use WSDL\DocumentLiteralWrapper;
use WSDL\WSDLCreator;
use WSDL\XML\Styles\DocumentLiteralWrapped;

if (isset($_GET['wsdl'])) {
    $wsdl = new WSDLCreator('ClassName', 'http://localhost/wsdl-creator/ClassName.php');
    @wsdl->setBindingStyle(new DocumentLiteralWrapped());
    $wsdl->setNamespace("http://foo.bar/");
    $wsdl->renderWSDL();
    exit;
}

ini_set('soap.wsdl_cache_enabled', '0');
$server = new SoapServer('http://localhost/wsdl-creator/ClassName.php?wsdl', array(
	'style' => SOAP_DOCUMENT,
	'use' => SOAP_LITERAL,
));
$server->setObject(new DocumentLiteralWrapped(new ClassName()));
$server->handle();
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 83.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 ~112 days

Recently: every ~150 days

Total

12

Last Release

3360d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98fce03446ed3fcf79faf4ed70bf2de08f33da749fb714e64bb05b9e7cacd218?d=identicon)[Georgo10](/maintainers/Georgo10)

---

Top Contributors

[![piotrooo](https://avatars.githubusercontent.com/u/2005054?v=4)](https://github.com/piotrooo "piotrooo (173 commits)")[![georgo](https://avatars.githubusercontent.com/u/80399?v=4)](https://github.com/georgo "georgo (21 commits)")[![rhelms](https://avatars.githubusercontent.com/u/815879?v=4)](https://github.com/rhelms "rhelms (9 commits)")[![anotherlatenightcoder](https://avatars.githubusercontent.com/u/1118581?v=4)](https://github.com/anotherlatenightcoder "anotherlatenightcoder (3 commits)")[![riso348](https://avatars.githubusercontent.com/u/12021834?v=4)](https://github.com/riso348 "riso348 (1 commits)")

---

Tags

phpgeneratorannotationssoapcreatorwsdlreflections

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/georgo-wsdl-creator/health.svg)

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

###  Alternatives

[piotrooo/wsdl-creator

PHP WSDL creator using PHPdoc (annotations, reflections).

84158.3k2](/packages/piotrooo-wsdl-creator)[wsdltophp/packagegenerator

Generate hierarchical PHP classes based on a WSDL

4351.9M19](/packages/wsdltophp-packagegenerator)[sokolnikov911/yandex-turbo-pages

PHP7 Yandex Turbo Pages RSS feed generator

4686.9k](/packages/sokolnikov911-yandex-turbo-pages)[camcima/camcima-soap-client

Wrapper around PHP SoapClient class

2672.0k2](/packages/camcima-camcima-soap-client)

PHPackages © 2026

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