|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-05-29 14:18 UTC] guillaume dot lintot at laposte dot net
-Status: Open
+Status: Closed
[2018-05-29 14:18 UTC] guillaume dot lintot at laposte dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 17:00:02 2025 UTC |
Description: ------------ Hi, i want to return multiple value to a SOAP request. The only solution i find was to generate a random XML and send it back... Test script: --------------- <?php class Test{ public function Method(){ $var1 = new SoapVar('value1', XSD_STRING); $var2 = new SoapVar('value2', XSD_STRING); return $var1 + $var2; } } $input = '<?xml version="1.0"?>'.PHP_EOL. '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="namespace1"'. ' xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'. ' xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Header />'. '<SOAP-ENV:Body><ns1:Method /></SOAP-ENV:Body></SOAP-ENV:Envelope>'; $soap = new SoapServer(null, array('uri' => '127.0.0.1')); $soap->setClass('Test'); $soap->handle($input); Expected result: ---------------- <ns1:MethodResponse> <var1 xsi:type="xsd:string">value1</var1> <var2 xsi:type="xsd:string">value2</var2> </ns1:MethodResponse> Actual result: -------------- <ns1:MethodResponse> <return xsi:type="xsd:int">2</return> </ns1:MethodResponse>