2016-06-20 103 views
0

我開發了一個帶有nusoapphp的肥皂web服務。在此Web服務,我已經定義了一個自定義類型命名負責波紋管:如何使用自定義類型作爲nusoap中另一個自定義類型的數據類型

$server->wsdl->addComplexType('charge', 
     'complexType', 
     'struct', 
     'all', 
     '', 
     array(
       'code' => array('name' => 'code', 'type' => 'xsd:string'), 
       'value' => array('name' => 'value', 'type' => 'xsd:string') 
     ) 
    ); 

我想定義在充電自定義類型被用作數據類型如下另一個自定義類型:

$server->wsdl->addComplexType('send', 
     'complexType', 
     'struct', 
     'all', 
     '', 
     array(
       'send' => array('name' => 'send', 'type' => 'xsd:charge') 
     ) 
    ); 

然後我得到這個錯誤:

Could not find type '[email protected]://www.w3.org/2001/XMLSchema' 

什麼是在其他的NuSOAP自定義類型使用自定義類型的數據類型的正確方法是什麼?

回答

0

send對象必須更改爲下面的xsd:charge必須更改爲tns:charge。

$server->wsdl->addComplexType('send', 
     'complexType', 
     'struct', 
     'all', 
     '', 
     array(
       'send' => array('name' => 'send', 'type' => 'tns:charge') 
     ) 
    ); 
相關問題