Requirements for a MgSerializable derived class that travels between server/web tiers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Requirements for a MgSerializable derived class that travels between server/web tiers

Jackie Ng
Hi All,

Could anyone shed some light as to what is required for a new class that derives from MgSerializable to properly travel between the server and web tiers?

I have this new MgTile class in my sandbox branch that is blowing up on deserialization from the web tier (it's throwing a stream header exception trying to deserialize the MgDateTime member here: http://trac.osgeo.org/mapguide/browser/sandbox/jng/http304/Common/MapGuideCommon/Services/Tile.cpp#L68)

I've given MgTile a new class id (http://trac.osgeo.org/mapguide/browser/sandbox/jng/http304/Common/MapGuideCommon/System/MapGuideCommonClassId.h#L138)

I've also registered this class with the MgClassFactory (http://trac.osgeo.org/mapguide/browser/sandbox/jng/http304/Common/MapGuideCommon/System/MapGuideCommonFactory.cpp#L114)

Am I missing something else?

- Jackie
Reply | Threaded
Open this post in threaded view
|

Re: Requirements for a MgSerializable derived class that travels between server/web tiers

Jackie Ng
Just to give more information:

Something is strange about Serialize/Deserialize in the MgTile class I've implemented.

Stepping through Serialize while debugging the server tier, all members are written to the MgStream without any exceptions. So it *appears* the MgTile is being returned from the server tier in one piece.

Stepping through Deserialize while debugging through the web tier (attached to httpd.exe), it deserializes the MgByteReader member, but throws MgInvalidStreamHeaderException on the MgDateTime one. Stepping through the code before the exception is thrown it appears that the argument packet for the MgDateTime member is either missing or corrupted as the argument packet does not come out as a class id argument packet, which would've instructed the MgStream to then be passed over to our empty MgDateTime member for deserialization.

Still can't figure out what could be missing.

- Jackie