|
|
|
|||||
|
slice2cs: struct/class unmarshalling problem
I have a struct defined in Slice that is mapped to a class in C#, but I get a null-reference exception on unmarshalling. Here is the Slice:
Code:
["clr:property"]
struct Action {
string Key;
string Description;
};
["clr:property"]
struct ActionPermission {
::IServices2ICE::Action Action;
bool IsAuthorized;
};
sequence<ActionPermission> ActionPermissionSeq;
["ami", "amd"] interface ClassifiedServices {
. . .
idempotent OpStatus GetClientPermissions(
string clientGroupKey,
string orderStatus,
out ActionPermissionSeq permissions
)
throws ServiceError;
};
Code:
public void read__(IceInternal.BasicStream is__)
{
Action_prop.read__(is__);
IsAuthorized_prop = is__.readBool();
}
Karl |
|
|||||
|
Quote:
Code:
public void write__(IceInternal.BasicStream os__)
{
Action_prop.write__(os__);
os__.writeBool(IsAuthorized_prop);
}
Karl |
|
|||||
|
Quote:
And even you are entitled to some vacation. Karl |
|
|||||
|
Quote:
Code:
public static IceInternal.DispatchStatus GetPackagePubDates___(CommonServices obj__, IceInternal.Incoming inS__, Ice.Current current__)
{
checkMode__(Ice.OperationMode.Idempotent, current__.mode);
IceInternal.BasicStream is__ = inS__.istr();
string packageKey;
packageKey = is__.readString();
IServices2ICE.Date startDate; // = new IServices2ICE.Date();
startDate.read__(is__);
string classKey;
classKey = is__.readString();
AMD_CommonServices_GetPackagePubDates cb__ = new _AMD_CommonServices_GetPackagePubDates(inS__);
try
{
obj__.GetPackagePubDates_async(cb__, packageKey, startDate, classKey, current__);
}
catch(_System.Exception ex)
{
cb__.ice_exception(ex);
}
return IceInternal.DispatchStatus.DispatchAsync;
}
Because of the compile issue I haven't tested your patch yet, although the generated code looks OK for it. Karl |
|
||||||
|
Hi Karl,
my apologies--I missed two spots in the code generator that were affected by the changes. I've updated the patch. Could you try again please? Thanks, Michi. |
|
|||||
|
Quote:
Thanks, Karl |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C#: Nested struct unmarshalling problem | kwaclaw | Bug Reports | 11 | 09-27-2007 01:01 PM |
| A problem about struct of multi-items | klsmlzm | Help Center | 4 | 10-24-2006 03:38 AM |
| Problem with classes in struct | kovacm | Help Center | 9 | 10-06-2005 02:49 AM |
| why struct inherit class | code | Help Center | 6 | 10-06-2004 02:17 PM |
| May slice struct contain class? | minifat | Help Center | 1 | 08-09-2004 10:16 PM |