Zend SOAP with Doctrine 2.1问题FLush,Soap__未知错误

时间:2012-10-03 16:02:03

标签: zend-framework soap doctrine zend-soap

我创建了一个soap客户端和服务器并添加了一个示例类,它返回通过方法查找的doctrines的结果。 但是,当我将其更改为持久或刷新对象时,错误:

我的肥皂服务器:(肥皂控制器)

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 =

$这 - > EM-> getRepository( “应用程序\实体\成员”) - > findOneById(23);   $ userEntity-> first_name =“updated firstname”;
  $这 - > EM->坚持($ userEntity); $这 - > EM->冲洗(); }

但是如果我打电话给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'......它可以工作,但是如果我将它更改为不同的姓氏它不会..没有教条错误....还,我可以在应用程序的任何控制器或模型中使用相同的功能更改此实体

1 个答案:

答案 0 :(得分:0)

已修复...如果使用soap,则没有会话,我的用户实体需要一个有效的会话,因为它会记录所有更新..