PHPackages                             jelix/webservice-helper - 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. jelix/webservice-helper

ActiveLibrary[API Development](/categories/api)

jelix/webservice-helper
=======================

To generate a WSDL content from classes

1.5.4(4y ago)14.5k21LGPL-2.1PHPPHP &gt;=5.6

Since Nov 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jelix/webservice-helper)[ Packagist](https://packagist.org/packages/jelix/webservice-helper)[ Docs](http://www.jool.nl/jool-tech-zone/webservice-helper/)[ RSS](/packages/jelix-webservice-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (1)

Webservice helper
=================

[](#webservice-helper)

This is a fork of Webservice helper from David Kingma. Original sources come from [www.jool.nl/webservicehelper/](http://www.jool.nl/webservicehelper/). Original author : David Kingma davidjoolnl

Maintainer of this fork: Laurent Jouanneau web site:

What does the webservice helper?
--------------------------------

[](#what-does-the-webservice-helper)

The webservice helper does what the name says: helping you making a php class available as webservice. It generates the documentation, the webservice description file (WSDL) and handles errorhandling. It consists of three parts:

- extension of the PHP reflection classes to also parse the comments for information on parameter info and return values. The documentation and WSDL are generated from these classes.(see also documentation.php as an example)
- extension to the PHP SOAP implementation. It catches all normal exceptions and allows typehints in the webservice methods. (ie. `saveContact(contact $contact)`)

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

[](#installation)

Use Composer to install the library. Package name: `jelix/webservice-helper`.

If you don't want to use Composer, you can copy the content of the source code (all needed classes are into `lib/`), and you must create an autoloader (like in `example/common.php` or you must include all classes.

Manual
------

[](#manual)

So how do you create your own webservice. As an example we create a webservice to add and show contacts. First you create a class called contactManager in the `/example/data_objects` with the public functions `getContacts()`, `saveContact(contact $contact)` and `newContact()`. To let the Webservice helper know what the parameters and return values of each method are we put a comment in front of each method specifying the parameters and return types. For example:

```
/**
 * This method saves the given contact
 * @return contact[] Array with all the contacts
 */
 public function getContacts(){}

/**
 * This method saves the given contact
 * @param contact The contact to save
 * @return void
 */
 public function saveContact(contact $contact){}

/**
 * This method saves the given contact
 * @return contact A new contact template
 */
 public function newContact(){}

/**
 * Gets the current contact list as associative array
 * @return contact[=>]  keys are contact name
 */
public function	getContactsAsAssoc() {}
```

We used the contact type as a return value for `newContact()` and `getContacts()` so we need to define what a contact looks like. For that we create a class called contact:

```
class contact{
	/** @var string */
	public $name;
	/** @var string */
	public $address;
}
```

Since string is (just as boolean and int) a known datatype we don't need to specify it any further.

The last thing we need to do to finish our webservice is to tell the webservice that de `contactManager` class is an allowed webservice and that `contact` is an allowed data- structure (for documentation purpose and classmap). In the `config.php` you add `"contactmanager"` to the `WSClasses` array and add `"contact"` to the `WSStructures` array.

You can now view the service documentation at `/doc/documentation.php` and the wsdl at `/example/service.php?class=contactManager&wsdl`

Note about associative array containing objects: if the soap server defines a classmap (`'classmap'` option to `SoapServer` in PHP), objects are wrapped into `SoapVal` objects, else they are simple `stdClass` objects.

FAQ
---

[](#faq)

- My function doesn't showup in the documentation nor the WSDL file? Please check if it's a public function and it doesn't start with `__`
- It doesn't work!

    - Do you see any warnings in the generated documentation? Fix them
    - Check case sensitivity of class names
    - Did you check the javascript console to see if anything goes wrong?
    - Tried cleaning the wsdl cache in the WSDL cache directory?
    - Did you check the WSDL url in the client?
- Can I use the webservice helper in my own project? Yes you can use it under the terms of LGPL 2.1
- Can I contribute?

Yes, open an issue and/or a PR on

Example and unit tests
----------------------

[](#example-and-unit-tests)

See tests/README.md

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

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 ~911 days

Total

4

Last Release

1475d ago

PHP version history (2 changes)1.5.1PHP &gt;=5.2

1.5.4PHP &gt;=5.6

### Community

Maintainers

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

---

Top Contributors

[![laurentj](https://avatars.githubusercontent.com/u/336034?v=4)](https://github.com/laurentj "laurentj (42 commits)")

---

Tags

generatorsoapwsdl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jelix-webservice-helper/health.svg)

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

###  Alternatives

[wsdltophp/packagegenerator

Generate hierarchical PHP classes based on a WSDL

4351.9M19](/packages/wsdltophp-packagegenerator)[piotrooo/wsdl-creator

PHP WSDL creator using PHPdoc (annotations, reflections).

84158.3k2](/packages/piotrooo-wsdl-creator)[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)
