i made a soap client and server and have added a sample class, that returns results from doctrines find by methods. however, when i change this to persist or flush objects, the error:
my soap server: (soap controller)
public function server()
{
if (is_null($this->getRequest()->getParam('wsdl'))) {
$server = new Zend_Soap_Server('http://localhost/soap?wsdl');
$server->setClass('Private\Library\Repo\Users');
$server->handle();
} else {
$wsdl = new Zend_Soap_AutoDiscover();
$wsdl->setClass('Private\Library\Repo\Users');
$wsdl->handle();
}
}
public function client()
{
$client = new Zend_Soap_Client('http://localhost/soap?wsdl');
$result = $client->updateUser();
}
When I do the call I get:
Message: Unknown error
Stack trace:
#0 /library/Zend/Soap/Client.php(1121): SoapClient->__soapCall('updateUser', Array, NULL, NULL, Array)
In my updateDoc class I have a standard doctrine update:
public function updateUser(){ $userEntity =
$this->em->getRepository("Application\Entities\Members")->findOneById(23);
$userEntity->first_name = "updated firstname";
$this->em->persist($userEntity); $this->em->flush(); }
However if I call my getUser()
:
public function getUser()
{
$userEntity = $this->em->getRepository("Application\Entities\Members")->findOneById(23);
return $userEntity;
}
it works with no soap unknown error..
with the update, if remove $userEntity->first_name = "updated firstname";
it works, without any errrors but obviously, it doesnt update the entity... that entity has private properties too. not sure if it make a difference
UPDATE: also, i have just noticed, if i update the entity with the same values as its current ones, it works... e.g. the lastname = 'alison' , i update $entity->lastname = 'alison'... it works, but if i change it to a different last name it doesnt.. there is no doctrine error.... also, i can change this entity using the same function in any controller or model in the app