BeSimple/BeSimpleSoapBundle — Issue #19: Another entity association issue
Author: getme
Created: 2011-11-27 18:24:36+00:00
State: open

I found another issue today, not sure if I'm doing something wrong but I must have it posted here anyway, thanks.
The environment doesn't matter/ The code below is exactly what I'm testing I only changed namespaces

1 method in Webservice controller

```php
/**
* @Soap\Param("id", phpType = "int")
* @Soap\Method("getEnquiry")
* @Soap\Result(phpType = "MyNamespace\Entity\Category")
*/
public function getEnquiryAction($id)
{
$em = $this->container->get('doctrine')->getEntityManager();

$quote = $em->find('MyNamespace\Entity\Enquiry', 20);
$result = $em->find('MyNamespace\Entity\Category', 4);

$this->container->get('besimple.soap.response')->setReturnValue($result);

return $this->container->get('besimple.soap.response');
}
```

The Enquiry entity has many to one association with Category

The enquiries table

```
---------
id|category_id
19|4
20|3
```

The above all work but if I change some values in the method

```php
/**
* @Soap\Param("id", phpType = "int")
* @Soap\Method("getEnquiry")
* @Soap\Result(phpType = "MyNamespace\Entity\Category")
*/
public function getEnquiryAction($id)
{
$em = $this->container->get('doctrine')->getEntityManager();

$quote = $em->find('MyNamespace\Entity\Enquiry', 19);
$result = $em->find('MyNamespace\Entity\Category', 4);

$this->container->get('besimple.soap.response')->setReturnValue($result);

return $this->container->get('besimple.soap.response');
}
```

and exception is thrown

```

at n/a
in /var/www/www2/mini/vendor/bundles/BeSimple/SoapBundle/ServiceBinding/RpcLiteralResponseMessageBinder.php line 76

at ReflectionClass->getProperty('id')
in /var/www/www2/mini/vendor/bundles/BeSimple/SoapBundle/ServiceBinding/RpcLiteralResponseMessageBinder.php line 76

at BeSimple\SoapBundle\ServiceBinding\RpcLiteralResponseMessageBinder->checkComplexType('MyNamespace\Category', object(Proxies\MyNamespaceEntityCategoryProxy))
in /var/www/www2/mini/vendor/bundles/BeSimple/SoapBundle/ServiceBinding/RpcLiteralResponseMessageBinder.php line 54

```
what can be a problem?