【发布时间】:2012-09-07 10:19:04
【问题描述】:
我在从Zend_Soap_AutoDiscover 类生成 WSDL 文件时遇到问题。
有人可以解释我做错了什么吗?
在 bootstrap.php 我有一个方法:
public function _initWsdl()
{
require_once("http://localhost:8080/zf_mta/backend.php");
$autoDiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
$autoDiscover->setClass('Backend');
$autoDiscover->setUri('http://localhost:8080/zf_mta/backend.php');
$autoDiscover->handle();
return $autoDiscover;
}
这里是 backend.php 类
class Order {
/** @var string */
public $productid;
/** @var string */
public $customerid;
/** @var int */
public $productcnt;
public function __construct($productid,$customerid,$productcnt) {
$this->productid = $productid;
$this->customerid = $customerid;
$this->productcnt = $productcnt;
}
}
class Orders {
/** @var Order[] */
public $orders;
}
class Backend {
/**
* @param Orders $orders
* @return string
*/
public function placeOrders($orders) {
return print_r($orders,1);
}
}
我遇到了错误:
内部服务器错误
服务器遇到内部错误或配置错误,无法完成您的请求...
错误日志:
[07-Sep-2012 13:39:48 UTC] PHP Warning: require_once() [<a href='function.require-once'>function.require-once</a>]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in E:\Zend Server\Apache2\htdocs\zf_mta\application\Bootstrap.php on line 18
[07-Sep-2012 13:39:48 UTC] PHP Warning: require_once(http://localhost:8080/zf_mta/backend.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: no suitable wrapper could be found in E:\Zend Server\Apache2\htdocs\zf_mta\application\Bootstrap.php on line 18
[07-Sep-2012 13:39:48 UTC] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'http://localhost:8080/zf_mta/backend.php' (include_path='E:\Zend Server\Apache2\htdocs\zf_mta\application/../library;E:\Zend Server\Apache2\htdocs\zf_mta\library;.;E:\Zend Server\ZendServer\share\ZendFramework\library') in E:\Zend Server\Apache2\htdocs\zf_mta\application\Bootstrap.php on line 18
【问题讨论】:
-
检查错误日志以获取真正的 PHP 错误并将其粘贴到此处。
-
@Florent 如果您的意思是来自 SoapFault 类的错误,那么它不会显示任何内容。
-
这就是为什么我告诉你查看 PHP 错误日志(或 apache 的错误日志)。
-
@Florent 我查看了 PHP 错误日志。我在第一篇文章中添加了错误
-
不包含远程文件。你应该指定它的路径。
标签: php zend-framework soap zend-soap