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: 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...
"; $cn = $ftr->Good( jf_gEncodingPhp, "", "", "", "" ); echo "this test will be failed...
"; $um = new jf_nation_UserMessage; $cn = $ftr->Bad( jf_gEncodingPhp, $um ); echo "test ok
"; } 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 ( ) )