|
|
|
|||||
|
much like a Bug !
much like a Bug !
Slice: module jf { module nation { struct UserMessage { string User; string Pwd; string Group; string Session; }; struct UserConn { long Id; }; class Ftr { UserConn Good( int encoding, string usr, string pwd, string grp, string sn ); UserConn Bad( int encoding, UserMessage user ); }; }; }; Server side implement: ::jf::nation::UserConn FtrI::Good( ::Ice::Int encoding, const ::std::string &usr, const ::std::string &pwd, const ::std::string &grp, const ::std::string &sn, const ::Ice::Current&) { ::jf::nation::UserConn cn; cn.Id = 0; return cn; } ::jf::nation::UserConn FtrI::Bad( ::Ice::Int encoding, const ::jf::nation::UserMessage& usr const ::Ice::Current&) { ::jf::nation::UserConn cn; cn.Id = 0; return cn; } Php test code: <?php Ice_loadProfile(); try { $ftr = $ICE->stringToProxy( "FTR:tcp -p 50000" ); $ftr = $ftr->ice_checkedCast( "::jf::nation::FTR" ); } catch( Ice_LocalException $ex ) { print_r( $ex ); return; } try { echo "this test will be passed...<br/>"; $cn = $ftr->Good( jf_gEncodingPhp, "", "", "", "" ); echo "this test will be failed...<br/>"; $um = new jf_nation_UserMessage; $cn = $ftr->Bad( jf_gEncodingPhp, $um ); echo "test ok<br/>"; } catch( Ice_LocalException $ex ) { print_r( $ex ); return; } catch( jf_GenericError $ex ) { print_r( $ex->reason ); return; } ?> run the test, then server side throw a exception: FTR: warning: dispatch exception: ../../include\Ice/BasicStream.h:112: Ice::Unma rshalOutOfBoundsException: protocol error: out of bounds during unmarshaling identity: FTR facet: operation: Bad and php client side throw a exception: Ice_UnknownLocalException Object ( [unknown] => ../../include\Ice/BasicStream.h:112: Ice::UnmarshalOutOfBoundsException: protocol error: out of bounds during unmarshaling [message:protected] => [string:private] => [code:protected] => 0 [file:protected] => D:\temp\jetrocket\webroot\ftr_test.php [line:protected] => 29 [trace:private] => Array ( ) ) |
|
|||||
|
please try this
slice:
struct Connection { // user Id long Id; }; struct DbIdentity { long id; }; struct RcIdentity { // Real Record ID long realId; }; string GetSearchRecordContent( int encoding, Connection cn, DbIdentity dbNum, string exp, // expression RcIdentity rc, string LocalDirectory ); exception... |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|