Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 04-02-2004
damingyipai damingyipai is offline
Registered User
 
 
Join Date: Jan 2004
Posts: 59
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 ( ) )
Attached Files
File Type: txt 1.txt (2.5 KB, 171 views)
Reply With Quote
  #2 (permalink)  
Old 04-02-2004
mes's Avatar
mes mes is online now
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 967
Hi,

Thanks for the bug report, the sample code really helps us resolve issues more quickly!

This is indeed a bug, and it has been fixed for the next release. You can work around this bug by initializing the members of UserMessage to empty strings:
Code:
$um = new jf_nation_UserMessage;
$um->User = "";
$um->Pwd = "";
$um->Group = "";
$um->Session = "";
Take care,
- Mark
Reply With Quote
  #3 (permalink)  
Old 04-03-2004
damingyipai damingyipai is offline
Registered User
 
 
Join Date: Jan 2004
Posts: 59
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...
Reply With Quote
  #4 (permalink)  
Old 04-03-2004
mes's Avatar
mes mes is online now
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 967
Before I can help I would need to see your PHP code and the exception you're receiving.

- Mark
Reply With Quote
  #5 (permalink)  
Old 04-04-2004
damingyipai damingyipai is offline
Registered User
 
 
Join Date: Jan 2004
Posts: 59
ok

I will post the sample code later.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 12:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.