Download the PHP package jelix/webservice-helper without Composer

On this page you can find all versions of the php package jelix/webservice-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package webservice-helper

Webservice helper

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

Maintainer of this fork: Laurent Jouanneau web site: https://github.com/jelix/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:

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

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:

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:

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

Yes, open an issue and/or a PR on https://github.com/jelix/webservice-helper

Example and unit tests

See tests/README.md


All versions of webservice-helper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-soap Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jelix/webservice-helper contains the following files

Loading the files please wait ....