我该如何使用该distinct条款Zend\Db\Sql\?
我正在尝试在我的实体类上使用Service Manager,但我不知道最好的方法.
在控制器上很容易,因为我们可以使用以下命令调用服务管理器:$ this-> getServiceLocator();
但是,在我的实体类中,即使我实现了ServiceLocatorAwareInterface,我也可以通过服务管理器来调用ServiceManager,因为我的实体类没有被调用:
那么最好的方法是什么:
1 - 从我的控制器2传递我的实体类中的serviceManager - 使用ServiceManager构建我的实体类3 - ...?
为了最好地理解我的问题,这是我的代码不起作用:
我的实体类:
class Demande extends ArraySerializable implements InputFilterAwareInterface {
/../
public function getUserTable() {
if (! $this->userTable) {
$sm = $this->getServiceLocator();//<== doesn't work !
$this->userTable = $sm->get ( 'Application\Model\UserTable' );
}
return $this->userTable;
}
Run Code Online (Sandbox Code Playgroud) 我不了解SoapUI和他的mockservice的行为.我正在使用SoapUI(testcase)的客户端和使用JAX-RPC的Java EE应用程序.
我的问题是:
当我试图从我的Java客户端或SoapUI的测试用例中调用任何web服务时,模拟服务在第一次调用时返回一条井消息,并在第二次调用时返回错误,同时使用相同的调用.但是如果我在等,它有效......
所以,我在SOAPui中启用了选项:" 在每个SOAP请求之后关闭HTTP连接 "并且它始终有效...
所以我的问题是:
" 这是模拟服务的正常行为,以及如何使用我的Java客户端实现它? "
谢谢你们.
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Missing operation for soapAction [] and body element [null] with SOAP Version [SOAP 1.1]</faultstring>
</soapenv:Fault>
Run Code Online (Sandbox Code Playgroud)