Ответ массива в WSDL – SOAP PHP

В моем wsdl-коде я получаю целое число, и я хочу вернуть результат в массив. Почему в моем входе у меня есть только одно целое число, и мне нужен результат в массиве, потому что в моей php-функции я хочу вернуть информацию из базы данных из выбранного целого клиентом.

Пример: мой клиент отправляет 1, в моем php я получаю информацию от «1» в БД как его «ID (int)», «Имя (строка)», «Number1 (int)», «Number2 (int)», Дата и время фактического клиентского спроса «ГГГГ-ММ-ДД чч: мм: чч» (??) "

Как я могу это сделать?

Благодаря,

это мой фактический 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 для создания файла описания.