WSDL-soapphp中的数组响应

WSDL-soapphp中的数组响应,php,soap,wsdl,Php,Soap,Wsdl,在我的wsdl代码中,我得到一个整数,并希望在数组中返回结果。 为什么在我的输入中只有一个整数,我需要数组中的结果,因为在我的php函数中,我希望通过客户端从choosen integer返回数据库中的信息 例如,我的客户机发送1,在我的php中,我从数据库中的“1”获取信息,作为他的“ID(int)”,“名称(字符串)”,“Number1(int)”,“Number2(int)”,“实际客户需求的日期和时间«YYYY-MM-DD hh:MM:hh»(?) 我怎么能做到 谢谢 这是我的实际wsd

在我的wsdl代码中,我得到一个整数,并希望在数组中返回结果。 为什么在我的输入中只有一个整数,我需要数组中的结果,因为在我的php函数中,我希望通过客户端从choosen integer返回数据库中的信息

例如,我的客户机发送1,在我的php中,我从数据库中的“1”获取信息,作为他的“ID(int)”,“名称(字符串)”,“Number1(int)”,“Number2(int)”,“实际客户需求的日期和时间«YYYY-MM-DD hh:MM:hh»(?)

我怎么能做到

谢谢

这是我的实际wsdl,输入为一个整数,输出为一个整数:

<message name='getResultRequest'> 
  <part name='numeropark' type='xsd:int'/>
</message> 
<message name='getResultResponse'> 
  <part name='result' type='xsd:string'/> 
</message> 

<portType name='getResultPortType'> 
  <operation name='getResult'> 
    <input message='tns:getResultRequest'/> 
    <output message='tns:getResultResponse'/> 
  </operation> 
</portType> 

<binding name='getResultBinding' type='tns:getResultPortType'> 
  <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> 
  <operation name='getResult'> 
    <soap:operation soapAction='urn:xmethods-delayed-quotes#getResult'/> 
    <input> 
      <soap:body use='encoded' namespace='urn:xmethods-delayed-calcul' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </input> 
    <output> 
      <soap:body use='encoded' namespace='urn:xmethods-delayed-calcul' 
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> 
    </output> 
  </operation> 
</binding> 

<service name='getResultService'> 
  <port name='getResultPort' binding='getResultBinding'> 
    <soap:address location='http://XXX.XXXX.com/soap/soap-server.php'/> 
  </port> 
</service> 


要返回数组,您应该定义一个complexType。例如,如果要返回字符串数组,则WSDL应包含以下部分:

<wsdl:types>
    <xsd:schema targetNamespace="http://schema.example.com">
      <xsd:complexType name="resultArray">
        <xsd:complexContent>
          <xsd:restriction base="SOAP-ENC:Array">
            <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]" />
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
    </xsd:schema>
</wsdl:types>
<message name='getResultRequest'> 
  <part name='numeropark' type='xsd:int'/>
</message> 
<message name='getResultResponse'> 
  <part name='result' type='tns:resultArray'/> 
</message>

我建议您使用任何WSDL生成器来创建描述文件