Created
August 5, 2013 13:59
-
-
Save francisbesset/6156111 to your computer and use it in GitHub Desktop.
BeSimpleSoap #5 issue: https://github.com/BeSimple/BeSimpleSoap/issues/5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\DemoBundle\Entity; | |
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; | |
class Address | |
{ | |
/** | |
* @Soap\ComplexType("int", nillable=true) | |
*/ | |
protected $id; | |
/** | |
* @Soap\ComplexType("string", nillable=true) | |
*/ | |
protected $label; | |
public function __construct($id) | |
{ | |
$this->id = $id; | |
} | |
public function getId() | |
{ | |
return $this->id; | |
} | |
public function getLabel() | |
{ | |
return $this->label; | |
} | |
public function setLabel($label) | |
{ | |
$this->label = $label; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
be_simple_soap: | |
services: | |
DemoApi: | |
namespace: http://mysymfonyapp.com/ws/DemoApi/1.0/ | |
binding: rpc-literal | |
resource: "@AppDemoBundle/Controller/DemoController.php" | |
resource_type: annotation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\DemoBundle\Controller; | |
use App\DemoBundle\Entity\Address; | |
use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; | |
use Symfony\Component\DependencyInjection\ContainerAware; | |
class DemoController extends ContainerAware | |
{ | |
/** | |
* @Soap\Method("getAddress") | |
* @Soap\Param("id", phpType = "int") | |
* @Soap\Result(phpType = "App\DemoBundle\Entity\Address") | |
*/ | |
public function getAction($id) | |
{ | |
$address = new Address($id); | |
$address->setLabel("Test Label"); | |
return $address; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_besimple_soap: | |
resource: "@BeSimpleSoapBundle/Resources/config/routing/webservicecontroller.xml" | |
prefix: /ws |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://mysymfonyapp.com/ws/DemoApi/1.0/"> | |
<soapenv:Header/> | |
<soapenv:Body> | |
<ns:getAddress> | |
<id>42</id> | |
</ns:getAddress> | |
</soapenv:Body> | |
</soapenv:Envelope> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://mysymfonyapp.com/ws/DemoApi/1.0/"> | |
<SOAP-ENV:Body> | |
<ns1:getAddressResponse> | |
<return> | |
<id>42</id> | |
<label>Test Label</label> | |
</return> | |
</ns1:getAddressResponse> | |
</SOAP-ENV:Body> | |
</SOAP-ENV:Envelope> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment