From b5fbb9192c8bbd45e41d6215b9f1c7dd05fcd587 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Wed, 20 Feb 2013 15:58:12 +0100 Subject: [PATCH] Updated doc --- Resources/doc/cache.rst | 4 +- Resources/doc/index.rst | 8 +- Resources/doc/installation_composer.rst | 54 ++++++++++++ ...installation.rst => installation_deps.rst} | 82 ++----------------- Resources/doc/requirements.rst | 4 + Resources/doc/soapserver/tutorial/array.rst | 6 +- .../doc/soapserver/tutorial/complex_type.rst | 10 +-- Resources/doc/soapserver/tutorial/header.rst | 12 +-- 8 files changed, 84 insertions(+), 96 deletions(-) create mode 100644 Resources/doc/installation_composer.rst rename Resources/doc/{installation.rst => installation_deps.rst} (50%) create mode 100644 Resources/doc/requirements.rst diff --git a/Resources/doc/cache.rst b/Resources/doc/cache.rst index 1c12010..aeea03b 100644 --- a/Resources/doc/cache.rst +++ b/Resources/doc/cache.rst @@ -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. -If you want more information you can visit the following page `PHP Soap runtime configuration`_. - -.. _`PHP Soap runtime configuration`: http://www.php.net/manual/en/soap.configuration.php \ No newline at end of file +If you want more information you can visit the following page `PHP Soap runtime configuration `_. diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst index 9182aa0..39200c6 100644 --- a/Resources/doc/index.rst +++ b/Resources/doc/index.rst @@ -3,7 +3,7 @@ BeSimpleSoapBundle ================== 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 `_ for symfony. --------------- Reference Guide @@ -13,7 +13,9 @@ Reference Guide :maxdepth: 1 :numbered: - installation + requirements + installation_composer + installation_deps cache ---------- @@ -33,5 +35,3 @@ SoapClient ---------- Coming soon. - -.. _`ckWebServicePlugin`: http://www.symfony-project.org/plugins/ckWebServicePlugin \ No newline at end of file diff --git a/Resources/doc/installation_composer.rst b/Resources/doc/installation_composer.rst new file mode 100644 index 0000000..b99e0e7 --- /dev/null +++ b/Resources/doc/installation_composer.rst @@ -0,0 +1,54 @@ +Installation 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" + } + } + +Run this command to download the new vendors: + +.. 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(), + // ... + ); + } diff --git a/Resources/doc/installation.rst b/Resources/doc/installation_deps.rst similarity index 50% rename from Resources/doc/installation.rst rename to Resources/doc/installation_deps.rst index 2b8f81a..529d837 100644 --- a/Resources/doc/installation.rst +++ b/Resources/doc/installation_deps.rst @@ -1,68 +1,10 @@ -Installation -============ +Installation with deps file (deprecated) +======================================== -Requirements ------------- +**The installation with deps file is deprecated. +Please prefer install the** `BeSimpleSoapBundle `_ **with** `Composer `_. -Install and enable PHP's SOAP extension. - -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). +Download `BeSimple\\SoapCommon `_ and `BeSimple\\SoapServer `_ (only for the server part) and/or `BeSimple\\SoapClient `_ (only for ther client part). .. code-block:: ini @@ -92,7 +34,7 @@ Add `BeSimple` libraries in autoload.php // 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 `_ and `Zend\\Mime `_ or add in `deps` file. `Zend` library is required only for the server part. .. code-block:: ini @@ -115,10 +57,7 @@ Add `Zend` library in autoload.php // your other namespaces )); -Installation -```````````` - -`Download`_ the bundle or add in `deps` file +`Download `_ the bundle or add in `deps` file .. 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 diff --git a/Resources/doc/requirements.rst b/Resources/doc/requirements.rst new file mode 100644 index 0000000..d7a5525 --- /dev/null +++ b/Resources/doc/requirements.rst @@ -0,0 +1,4 @@ +Requirements +============ + +Install and enable PHP's `SOAP extension `. diff --git a/Resources/doc/soapserver/tutorial/array.rst b/Resources/doc/soapserver/tutorial/array.rst index aa12f33..7561d37 100644 --- a/Resources/doc/soapserver/tutorial/array.rst +++ b/Resources/doc/soapserver/tutorial/array.rst @@ -6,7 +6,7 @@ Controller .. code-block:: php - namespace My\App\Controller; + namespace Acme\DemoBundle\Controller; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; use Symfony\Component\DependencyInjection\ContainerAware; @@ -20,6 +20,6 @@ Controller */ public function helloAction(array $names) { - return $this->container->get('besimple.soap.response')->setReturnValue("Hello ".implode(', ', $names)); + return "Hello ".implode(', ', $names); } - } \ No newline at end of file + } diff --git a/Resources/doc/soapserver/tutorial/complex_type.rst b/Resources/doc/soapserver/tutorial/complex_type.rst index 24514ea..f6ac0e3 100644 --- a/Resources/doc/soapserver/tutorial/complex_type.rst +++ b/Resources/doc/soapserver/tutorial/complex_type.rst @@ -12,7 +12,7 @@ Controller .. code-block:: php - namespace My\App\Controller; + namespace Acme\DemoBundle\Controller; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; use Symfony\Component\DependencyInjection\ContainerAware; @@ -22,7 +22,7 @@ Controller /** * @Soap\Method("getUser") * @Soap\Param("name", phpType = "string") - * @Soap\Result(phpType = "My\App\Entity\User") + * @Soap\Result(phpType = "Acme\DemoBundle\Entity\User") */ 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)); } - 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 - namespace My\App\Entity; + namespace Acme\DemoBundle\Entity; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; @@ -82,4 +82,4 @@ ComplexType `ComplexType` accepts the following options: - * nillable: To specify that the value can be null \ No newline at end of file + * nillable: To specify that the value can be null diff --git a/Resources/doc/soapserver/tutorial/header.rst b/Resources/doc/soapserver/tutorial/header.rst index efd042f..6b731d7 100644 --- a/Resources/doc/soapserver/tutorial/header.rst +++ b/Resources/doc/soapserver/tutorial/header.rst @@ -6,7 +6,7 @@ Controller .. code-block:: php - namespace My\App\Controller; + namespace Acme\DemoBundle\Controller; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; use Symfony\Component\DependencyInjection\ContainerAware; @@ -28,7 +28,7 @@ Controller 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 - namespace My\App\Controller; + namespace Acme\DemoBundle\Controller; use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; 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) { - 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) { - return $this->container->get('besimple.soap.response')->setReturnValue("Welcome ".implode(', ', $names)); + return "Welcome ".implode(', ', $names); } public function setContainer(ContainerInterface $container = null) @@ -86,4 +86,4 @@ If you want use a header for all actions of your controller you can declare the throw new \SoapFault("INVALID_API_KEY", "The api_key is invalid."); } } - } \ No newline at end of file + }