我制作了一个肥皂客户端和服务器,并添加了一个示例类,该类返回通过方法找到的教义的结果。但是,当我将其更改为持久化或刷新对象时,错误:
我的肥皂服务器:(肥皂控制器)
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();
}
当我打电话时,我得到:
消息:未知错误
堆栈跟踪:
#0 /library/Zend/Soap/Client.php(1121): SoapClient->__soapCall('updateUser', Array, NULL, NULL, Array)
在我的 updateDoc 课程中,我有一个标准的学说更新:
public function updateUser(){ $userEntity =
$this->em->getRepository("Application\Entities\Members")->findOneById(23); $userEntity->first_name = "更新的名字";
$this->em->persist($userEntity); $this->em->flush(); }
但是,如果我打电话给我的getUser()
:
public function getUser()
{
$userEntity = $this->em->getRepository("Application\Entities\Members")->findOneById(23);
return $userEntity;
}
它没有肥皂未知错误。
随着更新,如果删除 $userEntity->first_name = "updated firstname";
它可以正常工作,没有任何错误,但显然,它不会更新实体……该实体也具有私有属性。不确定它是否有所作为
更新:另外,我刚刚注意到,如果我使用与其当前值相同的值更新实体,它会起作用...例如 lastname = 'alison' ,我更新 $entity->lastname = 'alison'...它可以工作,但是如果我将其更改为不同的姓氏,则不会..没有教义错误....另外,我可以在应用程序的任何控制器或模型中使用相同的功能更改此实体