Added RST documentation
This commit is contained in:
51
Resources/doc/reference/configuration.rst
Normal file
51
Resources/doc/reference/configuration.rst
Normal file
@ -0,0 +1,51 @@
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Routing
|
||||
-------
|
||||
|
||||
Include the `BeSimpleSoapBundle`'s routing configuration in your routing file (you can choose the prefix arbitrarily):
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# app/config/routing.yml
|
||||
_besimple_soap:
|
||||
resource: "@BeSimpleSoapBundle/Resources/config/routing/webservicecontroller.xml"
|
||||
prefix: /ws
|
||||
|
||||
Config
|
||||
------
|
||||
|
||||
Configure your first web service in your config file:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# app/config/config.yml
|
||||
be_simple_soap:
|
||||
services:
|
||||
DemoApi:
|
||||
namespace: http://mysymfonyapp.com/ws/DemoApi/1.0/
|
||||
binding: rpc-literal
|
||||
resource: "@AcmeDemoBundle/Controller/DemoController.php"
|
||||
resource_type: annotation
|
||||
|
||||
Annotations for Controllers
|
||||
---------------------------
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap;
|
||||
use BeSimple\SoapBundle\Soap\SoapResponse;
|
||||
|
||||
class DemoController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Soap\Method("Hello")
|
||||
* @Soap\Param("name", phpType = "string")
|
||||
* @Soap\Result(phpType = "string")
|
||||
*/
|
||||
public function helloAction($name)
|
||||
{
|
||||
return new SoapResponse(sprintf('Hello %s!', $name));
|
||||
}
|
||||
}
|
65
Resources/doc/reference/installation.rst
Normal file
65
Resources/doc/reference/installation.rst
Normal file
@ -0,0 +1,65 @@
|
||||
Installation
|
||||
============
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Install and enable PHP's SOAP extension
|
||||
Download `Zend\Soap`_ or add in `deps` file
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
; deps file
|
||||
[Zend\Soap]
|
||||
git=http://github.com/BeSimple/zend-soap.git
|
||||
target=/zend-framework/library/Zend/Soap
|
||||
|
||||
Add Zend\Soap library in autoload.php
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// app/autoload.php
|
||||
$loader->registerNamespaces(array(
|
||||
'ZendSoap' => __DIR__.'/../vendor/zend-framework/library',
|
||||
// your other namespaces
|
||||
));
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
`Download`_ the bundle or add in `deps` file
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
; deps file
|
||||
[BeSimpleSoapBundle]
|
||||
git=http://github.com/BeSimple/BeSimpleSoapBundle.git
|
||||
target=/bundles/BeSimple/SoapBundle
|
||||
|
||||
Add `BeSimple` in autoload.php
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// app/autoload.php
|
||||
$loader->registerNamespaces(array(
|
||||
'BeSimple' => __DIR__.'/../vendor/bundles',
|
||||
// your other namespaces
|
||||
));
|
||||
|
||||
Add `BeSimpleSoapBundle` in your Kernel class
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// app/AppKernel.php
|
||||
public function registerBundles()
|
||||
{
|
||||
return array(
|
||||
// ...
|
||||
new new BeSimple\SoapBundle\BeSimpleSoapBundle(),
|
||||
// ...
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
.. _`Zend\Soap`: http://github.com/BeSimple/zend-soap
|
||||
.. _`Download`: http://github.com/BeSimple/BeSimpleSoapBundle
|
Reference in New Issue
Block a user