|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-01-27 19:55 UTC] adam at trachtenberg dot com
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> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
As I understand this Web Service uses document encoding and the 'GetUser' method uses one argument of complexType. So you should call it in the following way. $params = array('Version' => 393, 'DetailLevel' => 'ReturnAll'); $user = $client->__soapCall('GetUser', array($params), NULL, $header);