本文整理汇总了PHP中xmlrpcmsg::parseresponse方法的典型用法代码示例。如果您正苦于以下问题:PHP xmlrpcmsg::parseresponse方法的具体用法?PHP xmlrpcmsg::parseresponse怎么用?PHP xmlrpcmsg::parseresponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmlrpcmsg
的用法示例。
在下文中一共展示了xmlrpcmsg::parseresponse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testNilvalue
function testNilvalue()
{
// default case: we do not accept nil values received
$v = new xmlrpcval('hello', 'null');
$r = new xmlrpcresp($v);
$s = $r->serialize();
$m = new xmlrpcmsg('dummy');
$r = $m->parseresponse($s);
$this->assertequals(2, $r->faultCode());
// enable reception of nil values
$GLOBALS['xmlrpc_null_extension'] = true;
$r = $m->parseresponse($s);
$v = $r->value();
$this->assertequals('null', $v->scalartyp());
// test with the apache version: EX:NIL
$GLOBALS['xmlrpc_null_apache_encoding'] = true;
// serialization
$v = new xmlrpcval('hello', 'null');
$s = $v->serialize();
$this->assertequals(1, preg_match('#<value><ex:nil/></value>#', $s));
// deserialization
$r = new xmlrpcresp($v);
$s = $r->serialize();
$r = $m->parseresponse($s);
$v = $r->value();
$this->assertequals('null', $v->scalartyp());
$GLOBALS['xmlrpc_null_extension'] = false;
$r = $m->parseresponse($s);
$this->assertequals(2, $r->faultCode());
}
示例2: testNilvalue
function testNilvalue()
{
// default case: we do not accept nil values received
$v = new xmlrpcval('hello', 'null');
$r = new xmlrpcresp($v);
$s = $r->serialize();
$m = new xmlrpcmsg('dummy');
$r = $m->parseresponse($s);
$this->assertequals(2, $r->faultCode());
// enable reception of nil values
$GLOBALS['xmlrpc_null_extension'] = true;
$r = $m->parseresponse($s);
$v = $r->value();
$this->assertequals('null', $v->scalartyp());
}