我正在Symfony中编写一个SOAP应用程序,对于我的所有请求,我收到了一个错误Procedure 'getClusterName' not present.
奇怪的是,当我在纯PHP中创建测试SOAP应用程序时,它工作正常,但Symfony中的相同代码返回错误.
另一个奇怪的事情是,当我在SOAP服务器代码中列出可用的服务函数时$server->getFunctions(),它返回服务函数的getClusterName数组并且在该数组中.所以该功能对于服务器是已知的,但它无法调用它.
在Symfony中编写服务时,我遵循了本文,这是我的代码:
客户:
namespace Prj\SoapBundle\Controller;
class SoapController extends Controller
{
public function indexAction()
{
$client = new \SoapClient('http://localhost/test.wsdl');
$client->getClusterName();
Run Code Online (Sandbox Code Playgroud)
服务器:
namespace Prj\SoapBundle\Controller;
class SoapController extends Controller
{
public function indexAction()
{
ini_set("soap.wsdl_cache_enabled", "0");
$server = new \SoapServer($this->container->getParameter('wsdl'));
$server->setClass('SoapBundle\HelloService');
$server->handle();
Run Code Online (Sandbox Code Playgroud)
服务:
namespace Prj\SoapBundle;
class HelloService
{
public function getClusterName()
{
return '<?xml version="1.0" encoding="utf-8"?><root>Hello!</root>';
}
}
Run Code Online (Sandbox Code Playgroud)
*.wsdl文件似乎是正确的,因为它将调用与控制器绑定,并与vanilla PHP服务一起正常工作.
在Internet上,此错误通常由缓存的wsdl解释,但这是通过将soap.wsdl_cache_enabled参数设置为零来在服务器代码中处理的.
我只是希望我的apache注册我的一些预定义环境,以便我可以使用php中的getenv函数检索它.我怎样才能做到这一点?我尝试使用root并重新启动apache,使用export FOO =/bar/baz添加/etc/profile.d/foo.sh.
我在Windows 7上安装了Phing 2.4.7.1并使用了cygwin bash shell
我创建了一个Phing任务来将文件复制到本地目录并压缩文件,但我尝试排除某些目录但没有成功.复制整个目录
任务如下:
<copy todir="${builddir}" includeemptydirs="true" >
<fileset dir="." defaultexcludes="true">
<exclude name="cache/*" />
<exclude name="build.*" />
<exclude name="log/*" />
<exclude name=".git" />
<exclude name="/data/*" />
<exclude name="/nbproject" />
<exclude name="*~" />
</fileset>
</copy>
Run Code Online (Sandbox Code Playgroud) 我需要使用引用rence表的Zend_Db_Table删除记录.在SQL中,查询看起来像这样:
DELETE t1 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL;
Run Code Online (Sandbox Code Playgroud)
有没有办法比下面的代码更优雅?
$table = new Application_Model_DbTable_T1();
$sql = 'DELETE t1 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL;';
$table->getAdapter()->query($sql);
Run Code Online (Sandbox Code Playgroud)
我发现了一个类似的主题,看起来我应该使用,$table->getAdapter()->query($sql);但我希望更好.