function soapclient::_getProxyClassCode in Salesforce Suite 5
Same name and namespace in other branches
- 5.2 includes/nusoap.orig.php \soapclient::_getProxyClassCode()
* dynamically creates proxy class code * *
Return value
string PHP/NuSOAP code for the proxy class * @access private
2 calls to soapclient::_getProxyClassCode()
- soapclient::getProxy in includes/
nusoap.orig.php - * dynamically creates an instance of a proxy class, * allowing user to directly call methods from wsdl * *
- soapclient::getProxyClassCode in includes/
nusoap.orig.php - * dynamically creates proxy class code * *
File
- includes/
nusoap.orig.php, line 7007
Class
- soapclient
- soapclient higher level class for easy usage.
Code
function _getProxyClassCode($r) {
if ($this->endpointType != 'wsdl') {
$evalStr = 'A proxy can only be created for a WSDL client';
$this
->setError($evalStr);
return $evalStr;
}
$evalStr = '';
foreach ($this->operations as $operation => $opData) {
if ($operation != '') {
// create param string and param comment string
if (sizeof($opData['input']['parts']) > 0) {
$paramStr = '';
$paramArrayStr = '';
$paramCommentStr = '';
foreach ($opData['input']['parts'] as $name => $type) {
$paramStr .= "\${$name}, ";
$paramArrayStr .= "'{$name}' => \${$name}, ";
$paramCommentStr .= "{$type} \${$name}, ";
}
$paramStr = substr($paramStr, 0, strlen($paramStr) - 2);
$paramArrayStr = substr($paramArrayStr, 0, strlen($paramArrayStr) - 2);
$paramCommentStr = substr($paramCommentStr, 0, strlen($paramCommentStr) - 2);
}
else {
$paramStr = '';
$paramCommentStr = 'void';
}
$opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace'];
$evalStr .= "// {$paramCommentStr}\n\tfunction " . str_replace('.', '__', $operation) . "({$paramStr}) {\n\t\t\$params = array({$paramArrayStr});\n\t\treturn \$this->call('{$operation}', \$params, '" . $opData['namespace'] . "', '" . (isset($opData['soapAction']) ? $opData['soapAction'] : '') . "');\n\t}\n\t";
unset($paramStr);
unset($paramCommentStr);
}
}
$evalStr = 'class soap_proxy_' . $r . ' extends soapclient {
' . $evalStr . '
}';
return $evalStr;
}