I've got a problem with the native php SoapServer in symfony2. The SoapServer uses a "UserService" Service-Class in symfony2, which should be instantiated with the symfony2 EntityManager injected so that I can get access to my "UserRepository".
To clarify:
Soap-Server:
$oSOAPServer = new \SoapServer('/path/to/wsdl');
$oSOAPServer->setClass("my\Namespace\UserService");
$oSOAPServer->handle();
Service:
use \Doctrine\ORM\EntityManager as EntityManager;
class UserService
{
protected $em;
public function __construct(EntityManager $em) {
$this->em = $em;
}
...
Problem is: the SoapServer always returns an Internal Server Error. The service itself works called in symfony2 directly. Is it even possible to inject the EntityManager when called/instantiated by the SoapServer?
Thanks in advance!
Martin