2013-02-07 152 views
0

我試圖得到一些信息出來使用SOAP和PHPSOAP和PHP和WSDL請求

WSDL我有以下幾個要素:

 <s:element name="GetVersion"> 
     <s:complexType> 
      <s:sequence/> 
     </s:complexType> 
    </s:element> 
    <s:element name="GetVersionResponse"> 
     <s:complexType> 
      <s:sequence> 
       <s:element name="ApplicationVersion" type="s:string"/> 
       <s:element name="CgiVersion" type="s:string"/> 
       <s:element name="SiteName" type="s:string"/> 
      </s:sequence> 
     </s:complexType> 
    </s:element> 

我明白瞭如何檢索如果元素的數據序列有一個複雜的類型,但這個似乎沒有一個。

我通過SOAP UI運行WSDL,當您運行「GetVersion」請求時,您會得到響應,並返回應用程序版本,cgi版本和sitename。

我如何構建我的請求以返回PHP中的相同數據?

+0

你能只顯示你可以在看到了SoapUI的要求? – devOp

回答

0

據我所知:

複雜類型是PHP數組的/對象

所以定義數組或對象有你所描述的性質和你的PHP Soap服務器implentation內退

function getVersion(){ 
$array['appversion'] = 1; 
$array['cgiversion'] = 2; 
$array['sitename'] = "test"; 
return $array; 
} 

http://www.php.net/manual/de/class.soapserver.php