Hprose 1.0 Internal Data standards
Description of the method {
Request Call Format
' C '. WriteString (' method1 '). ' A '. Count ($params). ' {‘.‘ M '. Count ($params) ' {'. xxx. '} '. '. ' Z
Request return format
' R '. Serialize ($result). ' Z
}
Description of the data type
Serialize = = {
Null = = {
Writenull ()---> ' n '
}
Is_scalar = = {
Writenan ()---> ' N '
Writeinteger---> ' i10; '
Writelong---> ' l2000; '
Writeboolean (TRUE)---> ' t ' or ' F '
Writedouble (3.6)---> ' d000; '
Writedouble (positive infinity, negative infinity)---> ' i+ ' or ' I '
Writeempty ()---> ' e '
Writeutf8char ($val)---> ' u '.
Writestringwithref ($val)---> writestring ($val)
Writebytes ($bytes)---> ' b '. strlen ($bytes). $bytes. ' "'
Writebyteswithref ($val)---> writebytes ($bytes);
WriteString ($STR)---> ' s '. (Strlen (Iconv (' UTF-8 ', ' Utf-16le ', $str)) >> 1). $str. ' "'
}
Is_array = = {
Writearray ($array)---> ' a '. Count ($array) ' {'. xxx. '} '
Writeassocarray ($MAP)---> ' m '. Count ($map) ' {'. xxx. '} '
}
Is_object = = {
Writedatetime ($datetime)---> $datetime->format (' \dymd\this.u\z ')
Writemapwithref ($val)---> Writemap ($val)---> ' m '. Count ($val) ' {'. xxx. '} '
Writelistwithref ($val)---> writelist ($val)---> ' a '. Count ($val) ' {'. xxx. '} '
Writestdclasswithref ($val)---> Writestdclass ($obj)---> ' m '. Count ($val) ' {'. xxx. '} '
Writeobjectwithref ($val)---> writeobject ($obj)---> {
$class = Get_class ($obj); ' Dir1\dir2\clazz1 ';
$alias = ' Dir1_dir2_clazz1 '
---> ' c '. (Strlen (Iconv (' UTF-8 ', ' Utf-16le ', $alias)) >> 1). $alias. ' ". Count ($props). ' {'. WriteString (Strtolower ($prop [0]). substr ($prop, 1)). '} '. ' O '. ' 0 '. ' {'. $prop->getvalue ($obj). '} '
}
}
}
Hprose 1.0 (RPC framework)-Internal data standards