X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debugger%2Faction.php;h=44d8a0011f1e230414b6b803e7e43df28879ba4d;hb=19b99735570521d8172f73124ade5997b9dca75d;hp=18d92953e5fe08ea6cf7f2ee19d2a04751feb701;hpb=393f882cb3a8a040bd7a0eb8da3c05cfacb8af99;p=plcapi.git
diff --git a/debugger/action.php b/debugger/action.php
index 18d92953..44d8a001 100644
--- a/debugger/action.php
+++ b/debugger/action.php
@@ -373,13 +373,20 @@ if ($action) {
echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding);
if ($wstype != 1) {
$type = $y->scalarval();
- if ($type == 'null') {
- $type = 'nil';
+ $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 = $payload . '<' .
- htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
- '>' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
- ">\n";
+ $payload .= "\n";
}
$alt_payload .= $y->scalarval();
if ($k < $x->arraysize() - 1) {
@@ -474,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";
@@ -537,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