Download the PHP package goetas-webservices/soap-server without Composer
On this page you can find all versions of the php package goetas-webservices/soap-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download goetas-webservices/soap-server
More information about goetas-webservices/soap-server
Files in goetas-webservices/soap-server
Package soap-server
Short Description Pure PHP implementation of SOAP 1.1 and 1.2 server
License MIT
Informations about the package soap-server
goetas-webservices / soap-server
PHP implementation of SOAP 1.1 and 1.2 server specifications.
Strengths:
- Pure PHP, no dependencies on
ext-soap
- Extensible (JMS event listeners support)
- PSR-7 HTTP messaging
- PSR-15 HTTP server handlers
- No WSDL/XSD parsing on production
- IDE type hinting support
Only document/literal style is supported and the webservice should follow the WS-I guidelines.
There are no plans to support the deprecated rpc and encoded styles. Webservices not following the WS-I specifications might work, but they are officially not supported.
Demo
goetas-webservices/soap-server-demo is a demo project that shows how to produce a SOAP server in a generic PHP web application.
Installation
The recommended way to install goetas-webservices / soap-server is using Composer:
Add this packages to your composer.json
file.
How to
To improve performance, this library is based on the concept that all the SOAP/WSDL metadata has to be compiled into PHP compatible metadata (in reality is a big plain PHP array, so is really fast).
To do this we have to define a configuration file (in this case called config.yml
) that
holds some important information.
Here is an example:
This file has some important sections:
WSDL Specific
metadata
specifies where are placed WSDL files that will be used to generate al the required PHP metadata.
XML/XSD Specific
-
namespaces
(required) defines the mapping between XML namespaces and PHP namespaces. (in the example we have thehttp://www.example.org/test/
XML namespace mapped toTestNs\MyApp
) -
destinations_php
(required) specifies the directory where to save the PHP classes that belongs toTestNs\MyApp
PHP namespace. (in this exampleTestNs\MyApp
classes will ne saved intosoap/src
directory. -
destinations_jms
(required) specifies the directory where to save JMS Serializer metadata files that belongs toTestNs\MyApp
PHP namespace. (in this exampleTestNs\MyApp
metadata will ne saved intosoap/metadata
directory. aliases
(optional) specifies some mappings that are handled by custom JMS serializer handlers. Allows to specify to do not generate metadata for some XML types, and assign them directly a PHP class. For that PHP class is necessary to create a custom JMS serialize/deserialize handler.
Metadata generation
In order to be able to use the SOAP server we have to generate some metadata and PHP classes.
To do it we can run:
bin/soap-server generate
is the command we are runningtests/config.yml
is a path to our configuration file--dest-class=GlobalWeather/Container/SoapServerContainer
allows to specify the fully qualified class name of the container class that will hold all the webservice metadata.soap/src/Container
is the path where to save the container class that holds all the webservice metadata (you will have to configure the auto loader to load it)
Using the server
Once all the metadata are generated we can use our SOAP server.
Let's see a minimal example:
Note
The code in this project is provided under the MIT license. For professional support contact [email protected] or visit https://www.goetas.com
All versions of soap-server with dependencies
rybakit/arguments-resolver Version ^0.5.0
jms/serializer Version ^1.2|^2.0|^3.0
psr/log Version ^1.0
psr/http-message Version ^1.0
psr/http-server-handler Version ^1.0
psr/http-factory Version ^1.0
psr/http-factory-implementation Version ^1.0
psr/http-message-implementation Version ^1.0
php-http/discovery Version ^1.13
goetas-webservices/soap-common Version ^0.2
symfony/dependency-injection Version ^3.3|^4.0|^5.0