PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Web Services » SOAP » Bug #6505

Fails to eval proxy generated by SOAP_WSDL::generateProxyCode() with SOAP-0.9.2

Details

Submitted2006-01-17 09:44 UTC
Fromrsky0711 at gmail dot com
Assignedyunosh
StatusClosed
PackageSOAP
PHP Version4.4.1
OSMac OS X
Roadmaps(Not assigned)

Comments

[2006-01-17 09:44 UTC] rsky0711 at gmail dot com

Description:
------------
When use Google Web APIs, I got following error:

PHP Parse error: syntax error, unexpected '=' in /usr/local/share/pear/SOAP/WSDL.php(727) : eval()'d code on line 9

It seems to because of unescaped '$'.

Test script:
---------------
--- WSDL.php.orig 2006-01-17 17:37:47.000000000 +0900
+++ WSDL.php 2006-01-17 17:51:27.000000000 +0900
@@ -670,14 +670,14 @@
}

$class .= " function &$opname_php($args)\n {\n$comments$wrappers" .
- " $result = \$this->call('$opname',\n" .
+ " \$result = \$this->call('$opname',\n" .
" \$v = $argarray,\n" .
" array('namespace' => '$namespace',\n" .
" 'soapaction' => '$soapaction',\n" .
" 'style' => '$opstyle',\n" .
" 'use' => '$use'" .
($this->trace?",\n 'trace' => 1" : '') . "));\n" .
- " return $result;\n" .
+ " return \$result;\n" .
" }\n";
}

Expected result:
----------------
class WebService_GoogleSearchService_GoogleSearchPort extends SOAP_Client
{
function WebService_GoogleSearchService_GoogleSearchPort($path = 'http://api.google.com/search/beta2')
{
$this->SOAP_Client($path, 0);
}
function &doGetCachedPage($key, $url)
{
$result = $this->call('doGetCachedPage',
$v = array('key' => $key, 'url' => $url),
array('namespace' => 'urn:GoogleSearch',
'soapaction' => 'urn:GoogleSearchAction',
'style' => 'rpc',
'use' => 'encoded'));
return $result;
}
function &doSpellingSuggestion($key, $phrase)
{
$result = $this->call('doSpellingSuggestion',
(snip)
return $result;
}
function &doGoogleSearch($key, $q, $start, $maxResults, $filter, $restrict, $safeSearch, $lr, $ie, $oe)
{
$result = $this->call('doGoogleSearch',
(snip)
return $result;
}
}

Actual result:
--------------
class WebService_GoogleSearchService_GoogleSearchPort extends SOAP_Client
{
function WebService_GoogleSearchService_GoogleSearchPort($path = 'http://api.google.com/search/beta2')
{
$this->SOAP_Client($path, 0);
}
function &doGetCachedPage($key, $url)
{
= $this->call('doGetCachedPage',
$v = array('key' => $key, 'url' => $url),
array('namespace' => 'urn:GoogleSearch',
'soapaction' => 'urn:GoogleSearchAction',
'style' => 'rpc',
'use' => 'encoded'));
return ;
}
function &doSpellingSuggestion($key, $phrase)
{
= $this->call('doSpellingSuggestion',
(snip)
return ;
}
function &doGoogleSearch($key, $q, $start, $maxResults, $filter, $restrict, $safeSearch, $lr, $ie, $oe)
{
= $this->call('doGoogleSearch',
(snip)
return ;
}
}