Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 28th, 2006, 10:39 AM
Registered User
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Serializing Object Graph - Assigning Object to Jag


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,

Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning value to session object from repeater. aloktripathi.13 ASP.NET 2.0 Professional 1 November 16th, 2007 09:23 AM
Serializing object into existing XmlTextWriter planoie .NET Framework 2.0 0 October 15th, 2007 09:54 AM
Error Serializing an object in a web service gabrieldcr2 .NET Web Services 1 December 12th, 2005 04:41 PM
create a Line object ,Box object in CR at Runtime? thanhnt Pro VB 6 1 May 16th, 2005 06:51 AM
Error Occurred creating Report Object: Object does sa_moizatyahoo Classic ASP Professional 0 February 1st, 2005 10:29 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.