Updated doc

This commit is contained in:
Francis Besset 2013-02-20 15:58:12 +01:00
parent 55ae5e7e99
commit b5fbb9192c
8 changed files with 84 additions and 96 deletions

View File

@ -23,6 +23,4 @@ The limit is the maximum number of in-memory cached WSDL files (**5 is the defau
The WSDL files cached are written in cache folder of your Symfony2 application. The WSDL files cached are written in cache folder of your Symfony2 application.
If you want more information you can visit the following page `PHP Soap runtime configuration`_. If you want more information you can visit the following page `PHP Soap runtime configuration <http://www.php.net/manual/en/soap.configuration.php>`_.
.. _`PHP Soap runtime configuration`: http://www.php.net/manual/en/soap.configuration.php

View File

@ -3,7 +3,7 @@ BeSimpleSoapBundle
================== ==================
The BeSimpleSoapBundle is a Symfony2 bundle to build WSDL and SOAP based web services. The BeSimpleSoapBundle is a Symfony2 bundle to build WSDL and SOAP based web services.
It is based on the `ckWebServicePlugin`_ for symfony. It is based on the `ckWebServicePlugin <http://www.symfony-project.org/plugins/ckWebServicePlugin>`_ for symfony.
--------------- ---------------
Reference Guide Reference Guide
@ -13,7 +13,9 @@ Reference Guide
:maxdepth: 1 :maxdepth: 1
:numbered: :numbered:
installation requirements
installation_composer
installation_deps
cache cache
---------- ----------
@ -33,5 +35,3 @@ SoapClient
---------- ----------
Coming soon. Coming soon.
.. _`ckWebServicePlugin`: http://www.symfony-project.org/plugins/ckWebServicePlugin

View File

@ -0,0 +1,54 @@
Installation with Composer
==========================
Add `besimple/soap-bundle <https://packagist.org/packages/besimple/soap-bundle>`_ (with vendors) in your composer.json:
.. code-block:: json
{
"require": {
"besimple/soap-bundle": "dev-master",
"besimple/soap-common": "dev-master",
"ass/xmlsecurity": "dev-master"
}
}
To install the server please add `besimple/soap-server <https://packagist.org/packages/besimple/soap-server>`_ in your composer.json:
.. code-block:: json
{
"require": {
"besimple/soap-server": "dev-master"
}
}
To install the client please add `besimple/soap-client <https://packagist.org/packages/besimple/soap-client>`_ in your composer.json:
.. code-block:: json
{
"require": {
"besimple/soap-client": "dev-master"
}
}
Run this command to download the new vendors:
.. code-block:: bash
$ php composer.phar update
Enable the `BeSimpleSoapBundle <https://github.com/BeSimple/BeSimpleSoapBundle>`_ in your Kernel class
.. code-block:: php
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new BeSimple\SoapBundle\BeSimpleSoapBundle(),
// ...
);
}

View File

@ -1,68 +1,10 @@
Installation Installation with deps file (deprecated)
============ ========================================
Requirements **The installation with deps file is deprecated.
------------ Please prefer install the** `BeSimpleSoapBundle <https://github.com/BeSimple/BeSimpleSoapBundle>`_ **with** `Composer <http://getcomposer.org>`_.
Install and enable PHP's SOAP extension. Download `BeSimple\\SoapCommon <http://github.com/BeSimple/BeSimpleSoapCommon>`_ and `BeSimple\\SoapServer <http://github.com/BeSimple/BeSimpleSoapServer>`_ (only for the server part) and/or `BeSimple\\SoapClient <http://github.com/BeSimple/BeSimpleSoapClient>`_ (only for ther client part).
With Composer
~~~~~~~~~~~~~
Add `besimple/soap-bundle` (with vendors) in your composer.json:
.. code-block:: json
{
"require": {
"besimple/soap-bundle": "dev-master",
"besimple/soap-common": "dev-master",
"ass/xmlsecurity": "dev-master"
}
}
To install the server please add `besimple/soap-server` in your composer.json:
.. code-block:: json
{
"require": {
"besimple/soap-server": "dev-master"
}
}
To install the client please add `besimple/soap-client` in your composer.json:
.. code-block:: json
{
"require": {
"besimple/soap-client": "dev-master"
}
}
.. code-block:: bash
$ php composer.phar update
Enable the `BeSimpleSoapBundle` in your Kernel class
.. code-block:: php
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new BeSimple\SoapBundle\BeSimpleSoapBundle(),
// ...
);
}
With deps file (outdated)
~~~~~~~~~~~~~~~~~~~~~~~~~
Download `BeSimple\\SoapCommon`_ and `BeSimple\\SoapServer`_ (only for the server part) and/or `BeSimple\\SoapClient`_ (only for ther client part).
.. code-block:: ini .. code-block:: ini
@ -92,7 +34,7 @@ Add `BeSimple` libraries in autoload.php
// your other namespaces // your other namespaces
)); ));
Download `Zend\\Soap`_ and `Zend\\Mime`_ or add in `deps` file. `Zend` library is required only for the server part. Download `Zend\\Soap <http://github.com/BeSimple/zend-soap>`_ and `Zend\\Mime <http://github.com/BeSimple/zend-mime>`_ or add in `deps` file. `Zend` library is required only for the server part.
.. code-block:: ini .. code-block:: ini
@ -115,10 +57,7 @@ Add `Zend` library in autoload.php
// your other namespaces // your other namespaces
)); ));
Installation `Download <http://github.com/BeSimple/BeSimpleSoapBundle>`_ the bundle or add in `deps` file
````````````
`Download`_ the bundle or add in `deps` file
.. code-block:: ini .. code-block:: ini
@ -150,10 +89,3 @@ Add `BeSimpleSoapBundle` in your Kernel class
// ... // ...
); );
} }
.. _`Zend\\Soap`: http://github.com/BeSimple/zend-soap
.. _`Zend\\Mime`: http://github.com/BeSimple/zend-mime
.. _`BeSimple\\SoapCommon`: http://github.com/BeSimple/BeSimpleSoapCommon
.. _`BeSimple\\SoapServer`: http://github.com/BeSimple/BeSimpleSoapServer
.. _`BeSimple\\SoapClient`: http://github.com/BeSimple/BeSimpleSoapClient
.. _`Download`: http://github.com/BeSimple/BeSimpleSoapBundle

View File

@ -0,0 +1,4 @@
Requirements
============
Install and enable PHP's `SOAP extension <http://www.php.net/manual/en/soap.setup.php>`.

View File

@ -6,7 +6,7 @@ Controller
.. code-block:: php .. code-block:: php
namespace My\App\Controller; namespace Acme\DemoBundle\Controller;
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\DependencyInjection\ContainerAware;
@ -20,6 +20,6 @@ Controller
*/ */
public function helloAction(array $names) public function helloAction(array $names)
{ {
return $this->container->get('besimple.soap.response')->setReturnValue("Hello ".implode(', ', $names)); return "Hello ".implode(', ', $names);
} }
} }

View File

@ -12,7 +12,7 @@ Controller
.. code-block:: php .. code-block:: php
namespace My\App\Controller; namespace Acme\DemoBundle\Controller;
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\DependencyInjection\ContainerAware;
@ -22,7 +22,7 @@ Controller
/** /**
* @Soap\Method("getUser") * @Soap\Method("getUser")
* @Soap\Param("name", phpType = "string") * @Soap\Param("name", phpType = "string")
* @Soap\Result(phpType = "My\App\Entity\User") * @Soap\Result(phpType = "Acme\DemoBundle\Entity\User")
*/ */
public function getUserAction($name) public function getUserAction($name)
{ {
@ -34,7 +34,7 @@ Controller
throw new \SoapFault('USER_NOT_FOUND', sprintf('The user with the name "%s" can not be found', $name)); throw new \SoapFault('USER_NOT_FOUND', sprintf('The user with the name "%s" can not be found', $name));
} }
return $this->container->get('besimple.soap.response')->setReturnValue($user); return $user;
} }
} }
@ -45,7 +45,7 @@ You can expose only the properties (public, protected or private) of a complex t
.. code-block:: php .. code-block:: php
namespace My\App\Entity; namespace Acme\DemoBundle\Entity;
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;

View File

@ -6,7 +6,7 @@ Controller
.. code-block:: php .. code-block:: php
namespace My\App\Controller; namespace Acme\DemoBundle\Controller;
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\DependencyInjection\ContainerAware;
@ -28,7 +28,7 @@ Controller
throw new \SoapFault("INVALID_API_KEY", "The api_key is invalid."); throw new \SoapFault("INVALID_API_KEY", "The api_key is invalid.");
} }
return $this->container->get('besimple.soap.response')->setReturnValue("Hello ".implode(', ', $names)); return "Hello ".implode(', ', $names);
} }
} }
@ -39,7 +39,7 @@ If you want use a header for all actions of your controller you can declare the
.. code-block:: php .. code-block:: php
namespace My\App\Controller; namespace Acme\DemoBundle\Controller;
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\DependencyInjection\ContainerAware;
@ -57,7 +57,7 @@ If you want use a header for all actions of your controller you can declare the
*/ */
public function helloAction(array $names) public function helloAction(array $names)
{ {
return $this->container->get('besimple.soap.response')->setReturnValue("Hello ".implode(', ', $names)); return "Hello ".implode(', ', $names);
} }
/** /**
@ -67,7 +67,7 @@ If you want use a header for all actions of your controller you can declare the
*/ */
public function welcomeAction($names) public function welcomeAction($names)
{ {
return $this->container->get('besimple.soap.response')->setReturnValue("Welcome ".implode(', ', $names)); return "Welcome ".implode(', ', $names);
} }
public function setContainer(ContainerInterface $container = null) public function setContainer(ContainerInterface $container = null)