Subject: Serializing Object Graph - Assigning Object to Jag
Posted By: venkat.kl Post Date: 8/28/2006 10:39:57 AM
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();
PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfo PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoObj = new PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfo();
PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoObj.HomeID = "0";
PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoObj.UserID = "venkat";
 
PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoUserPassword PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoUserPasswordObj = new PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoUserPassword();
PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoUserPasswordObj.CryptType = "None";
PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoUserPasswordObj.CryptVal = "venkat123";
PartnerRequestUserSvcRqSignonRqSignonPasswordObj.GenSessInfo = "true";
 

PartnerRequestUserSvcRqSignonRq[][] UserSvcRqs = { {} ,PartnerRequestUserSvcRqSignonRqObj };
 
PartnerRequestObj.UserSvcRq = UserSvcRqs; // correct it afterwards
PartnerRequestUserSvcRqSignonRqSignonPassword[] SignonPasswords ={ PartnerRequestUserSvcRqSignonRqSignonPasswordObj };
PartnerRequestUserSvcRqSignonRqObj.SignonPassword = SignonPasswords;
PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfo[] UserInfos ={ PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoObj };
PartnerRequestUserSvcRqSignonRqSignonPasswordObj.UserInfo = UserInfos;
PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoUserPassword[] UserPasswords ={ PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoUserPasswordObj };
PartnerRequestUserSvcRqSignonRqSignonPasswordUserInfoObj.UserPassword = UserPasswords;

Thanks & Regards,
Venkat.KL



Go to topic 48947

Return to index page 192
Return to index page 191
Return to index page 190
Return to index page 189
Return to index page 188
Return to index page 187
Return to index page 186
Return to index page 185
Return to index page 184
Return to index page 183