Serializing Object Graph - Assigning Object to Jag
Hi,
I am working on Serializing XML. In this regard, I have purchased the book "Professional ASP.NET 2.0 XML" of Wrox Publication.
I need to work on Object Graphs. Here, I am finding it difficult like, How do I Assign the Values to the Jagged Arrays which are created in the Class which are created by XSD.EXE Tool.
PartnerRequestUserSvcRqSignonRq[][] UserSvcRqs = { {} ,PartnerRequestUserSvcRqSignonRqObj };
The XSD.EXE Tool has created Jagged Array by skipping one of the intermediate child node element. To serialize Object Graph, I am writing the code like below.
I am attaching the zipped version of the class also for your perusal.
PartnerRequest PartnerRequestObj = new PartnerRequest(); //1st Class
PartnerRequestObj.partnerID = "0";
PartnerRequestObj.version = "1.4.0";
PartnerRequestObj.RqUID = "1";
//please note here from the root, it is straight away jumping into this element<SignonRq> skipping one element <UserSvcRq> with [][] Jagged Arrary
PartnerRequestUserSvcRqSignonRq PartnerRequestUserSvcRqSignonRqObj = new PartnerRequestUserSvcRqSignonRq();
PartnerRequestUserSvcRqSignonRqObj.RqUID = "1.1";
PartnerRequestUserSvcRqSignonRqSignonPassword PartnerRequestUserSvcRqSignonRqSignonPasswordObj = new PartnerRequestUserSvcRqSignonRqSignonPassword();
PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfo PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoObj = new PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfo();
PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoObj.HomeID = "0";
PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoObj.UserID = "venkat";
PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoUserPassword PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoUserPasswordObj = new PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoUserPassword();
PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoUserPasswordObj.CryptType = "None";
PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoUserPasswordObj.CryptVal = "venkat123";
PartnerRequestUserSvcRqSignonRqSignonPasswordObj.G enSessInfo = "true";
PartnerRequestUserSvcRqSignonRq[][] UserSvcRqs = { {} ,PartnerRequestUserSvcRqSignonRqObj };
PartnerRequestObj.UserSvcRq = UserSvcRqs; // correct it afterwards
PartnerRequestUserSvcRqSignonRqSignonPassword[] SignonPasswords ={ PartnerRequestUserSvcRqSignonRqSignonPasswordObj };
PartnerRequestUserSvcRqSignonRqObj.SignonPassword = SignonPasswords;
PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfo[] UserInfos ={ PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoObj };
PartnerRequestUserSvcRqSignonRqSignonPasswordObj.U serInfo = UserInfos;
PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoUserPassword[] UserPasswords ={ PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoUserPasswordObj };
PartnerRequestUserSvcRqSignonRqSignonPasswordUserI nfoObj.UserPassword = UserPasswords;
Thanks & Regards,
Venkat.KL
|