简体   繁体   English

SOAP,PHP和WSDL请求

[英]SOAP and PHP and WSDL Request

I'm trying to get some info out of WSDL using SOAP and PHP 我正在尝试使用SOAP和PHP从WSDL中获取一些信息

I have these elements: 我有这些要素:

     <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>

I understand how to retrieve the data if the element sequence has a complex type, but this one doesn't seem to have one. 我知道如果元素序列具有复杂类型,那么如何检索数据,但是这一序列似乎没有。

I ran the WSDL through SOAP UI and when you run the request for "GetVersion" you get a response and it returns the app version, the cgi version and the sitename. 我通过SOAP UI运行了WSDL,当您运行对“ GetVersion”的请求时,您会收到响应,并返回应用程序版本,cgi版本和站点名称。

How do i construct my request to return the same data in PHP? 我该如何构造我的请求以在PHP中返回相同的数据?

As far as i know: 我所知道的:

Complex Types are Array's / Objects in php 复杂类型是php中的数组/对象

So define an array or object having the properties you describe and return it within your PHP Soap Server implentation 因此,定义一个具有您描述的属性的数组或对象,并在您的PHP Soap Server配置中将其返回

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM