php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65494 Return multiple SoapVar in SoapServer
Submitted: 2013-08-21 13:08 UTC Modified: 2018-05-29 14:18 UTC
From: guillaume dot lintot at laposte dot net Assigned:
Status: Closed Package: SOAP related
PHP Version: 5.5.2 OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: guillaume dot lintot at laposte dot net
New email:
PHP Version: OS:

 

 [2013-08-21 13:08 UTC] guillaume dot lintot at laposte dot net
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>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [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
out of date
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 19:01:30 2024 UTC