X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debugger%2Faction.php;h=44d8a0011f1e230414b6b803e7e43df28879ba4d;hb=19b99735570521d8172f73124ade5997b9dca75d;hp=05cc99a5599c366b6087fdd355d805523290d007;hpb=dc81107c8486d21cc48144ae0e218afded36997b;p=plcapi.git
diff --git a/debugger/action.php b/debugger/action.php
index 05cc99a..44d8a00 100644
--- a/debugger/action.php
+++ b/debugger/action.php
@@ -350,12 +350,13 @@ if ($action) {
$desc = "-";
}
echo "
Description | $desc |
\n";
- $payload = "";
- $alt_payload = "";
+
if ($r2->kindOf() != "array") {
echo "Signature | Unknown | |
\n";
} else {
for ($i = 0; $i < $r2->arraysize(); $i++) {
+ $payload = "";
+ $alt_payload = "";
if ($i + 1 % 2) {
$class = ' class="oddrow"';
} else {
@@ -371,10 +372,21 @@ if ($action) {
$y = $x->arraymem($k);
echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding);
if ($wstype != 1) {
- $payload = $payload . '<' .
- htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
- '>' . htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
- ">\n";
+ $type = $y->scalarval();
+ $payload .= '';
+ switch($type) {
+ case 'undefined':
+ break;
+ case 'null';
+ $type = 'nil';
+ // fall thru intentionally
+ default:
+ $payload .= '<' .
+ htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
+ '>' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
+ '>';
+ }
+ $payload .= "\n";
}
$alt_payload .= $y->scalarval();
if ($k < $x->arraysize() - 1) {
@@ -469,18 +481,17 @@ if ($action) {
if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression &&
$clientcookies == ''
) {
- $opts = 0; // simple client copy in stub code
+ $opts = 1; // simple client copy in stub code
} else {
- $opts = 1; // complete client copy in stub code
+ $opts = 0; // complete client copy in stub code
}
if ($wstype == 1) {
$prefix = 'jsonrpc';
} else {
$prefix = 'xmlrpc';
}
- //$code = wrap_xmlrpc_method($client, $method, $methodsig, 0, $proto, '', $opts);
$wrapper = new PhpXmlRpc\Wrapper();
- $code = $wrapper->build_remote_method_wrapper_code($client, $method, str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc, $timeout, $proto, $opts, $prefix);
+ $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc);
//if ($code)
//{
echo "\n";
@@ -532,6 +543,7 @@ if ($action) {
Changelog
+ - 2015-05-30: fix problems with generating method payloads for NIL and Undefined parameters
- 2015-04-19: fix problems with LATIN-1 characters in payload
- 2007-02-20: add visual editor for method payload; allow strings, bools as jsonrpc msg id
- 2006-06-26: support building php code stub for calling remote methods