0

我正在尝试将 InfoPath 表单与 PHP 一起使用。这就是为什么我在教程的帮助下使用zend 框架soap 库创建了一个Web 服务。

require("Zend/Soap/Server.php");
require("Zend/Soap/Wsdl.php");
require("Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php");
require("Zend/Soap/AutoDiscover.php");


$serviceURL = 'http://localhost/zendwebservice/';

class MyService {

    function GetCoupons($UserID) {
        // do some work here

    }
}

// Generate WSDL relevant to code
if (isset($_GET['wsdl']) || isset($_GET['WSDL'])){
    $autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
    $autodiscover->setClass('MyService');
    $autodiscover->handle();
} else {
    $server = new Zend_Soap_Server($serviceURL . "?WSDL");
    $server->setClass('MyService');
    $server->setObject(new MyService());
    $server->handle();
}

然后,我尝试使用 infopath 数据连接向导进行 Web 服务,但出现这些错误

InfoPath cannot find and cannot access the specified Web service description.

Details:
SoapMapper:The SoapMapper for element Array could not be created.
 - WSDLOperation:Initialization of a SoapMapper for operation GetCoupons failed. 
 - WSDLOperation:Initializing of the output message failed for operation GetCoupons. 
 - WSDLPort:An operation for port MyServicePort could not be initialized.
 - WSDLPort:Analyzing the binding information for port MyServicePort failed. 
 - WSDLService:Initialization of the port for service MyServiceService failed. 
 - WSDLReader:Analyzing the WSDL file failed. 

因为我是网络服务的新手,所以我无法弄清楚。感谢所有帮助。

4

0 回答 0