#31727 [NEW]: SOAPClient incorrectly encoding parameters

From: Date: Thu, 27 Jan 2005 18:55:14 +0000
Subject: #31727 [NEW]: SOAPClient incorrectly encoding parameters
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72947@lists.php.net to get a copy of this message
From:             adam at trachtenberg dot com
Operating system: n/a
PHP version:      5CVS-2005-01-27 (dev)
PHP Bug Type:     SOAP related
Bug description:  SOAPClient incorrectly encoding parameters

Description:
------------
The SOAPClient class is incorrectly encoding parameters. It is not placing
them inside their own named elements.

I believe this to be a bug, but it's quite hard to confirm because the
SOAP spec is so theoretical. I can't find any real examples. Also, even
after this bug is fixed, the "working" code won't make a successful
request, as the WSDL endpoint is wrong and there are no headers. This is
just a stripped down version to reproduce the bug.

Reproduce code:
---------------
$wsdl_url = 'http://developer.ebay.com/webservices/393/eBaySvc.wsdl';

$client = new SOAPClient($wsdl_url, array('trace' => 1, 'exceptions' => 0,
)); 

$DetailLevel = new SOAPParam(new SOAPVar('ReturnAll', XSD_STRING,  NULL,
NULL, NULL, 'urn:ebay:apis:eBLBaseCo\
mponents'), 'DetailLevel');
$Version     = new SOAPParam(new SOAPVar(393,         XSD_DOUBLE, NULL,
NULL, NULL, 'urn:ebay:apis:eBLBaseCom\
ponents'), 'Version');

$user = $client->GetUser($Version, $DetailLevel);
print "GetUser(): \n".$client->__getLastRequest() ."\n";

$user = $client->__call('GetUser', array($Version, $DetailLevel));
print "__call(GetUser): \n".$client->__getLastRequest() ."\n";

Expected result:
----------------
GetUser(): 
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:ebay:apis:eBLBaseComponents"><SOAP-ENV:Body><ns1:GetUserRequest><ns1:Version>393</ns1:Version><ns1:DetailLevel>ReturnAll</ns1:DetailLevel></ns1:GetUserRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>

__call(GetUser): 
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:ebay:apis:eBLBaseComponents"><SOAP-ENV:Body><ns1:GetUserRequest><ns1:Version>393</ns1:Version><ns1:DetailLevel>ReturnAll</ns1:DetailLevel></ns1:GetUserRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>

Actual result:
--------------
GetUser(): 
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:ebay:apis:eBLBaseComponents"><SOAP-ENV:Body><ns1:GetUserRequest>393</ns1:GetUserRequest><ns1:DetailLevel>ReturnAll</ns1:DetailLevel></SOAP-ENV:Body></SOAP-ENV:Envelope>

__call(GetUser): 
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:ebay:apis:eBLBaseComponents"><SOAP-ENV:Body><ns1:GetUserRequest>393</ns1:GetUserRequest><ns1:DetailLevel>ReturnAll</ns1:DetailLevel></SOAP-ENV:Body></SOAP-ENV:Envelope>

-- 
Edit bug report at http://bugs.php.net/?id=31727&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31727&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31727&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31727&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31727&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31727&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31727&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31727&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31727&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31727&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31727&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=31727&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=31727&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31727&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31727&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31727&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31727&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31727&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31727&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31727&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31727&r=mysqlcfg


Thread (7 messages)

« previous php.bugs (#72947) next »