Read/Write XML

Posts   
 
    
Skeeterbug
User
Posts: 165
Joined: 21-May-2004
# Posted on: 28-Jul-2006 02:20:14   

Hi, On an ASP.NET application I have an upload box where a client and upload an XML file. This XML file is based on a ProcessEntity collection from another client application (Created with the WriteXML() of the entitycollection).

For the client application we needed to add a field (IndentLevel). I want to avoid updating the ASP.NET application and database, as it is already compiled and in its final release. Is it possible to put the [NotSerialized] attribute over this field so the server will still load it? Or is there more to it than that? I am not sure the server will read the xml correctly with the extra field.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 28-Jul-2006 07:28:26   

I don't think the read xml will have any problems with extra fields, as I guess it will simply ignore them. Also you may try the NotSerialized attribute.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 28-Jul-2006 09:59:25   

NotSerialized is remoting related, not XML related. If you want a field to not be serialized, use XmlIgnore(true) as attribute. However as this is already xml, I have no idea what you're trying to do or better: what you're trying to avoid, as I miss the info about what happens with the xml on the server wink

Frans Bouma | Lead developer LLBLGen Pro
Skeeterbug
User
Posts: 165
Joined: 21-May-2004
# Posted on: 28-Jul-2006 18:26:59   

Heh simple_smile

Well we have two applications here. We have a client rip off of Microsoft Project, and we have a web based document/project management portal. The client application can design out the project, then go to the website and upload the project. It works great, but we are in the process of writing our 2.0 version of BOTH, but the client application will be released first, and I'm hoping the server (version 1) will still be able to read the XML (from version 2).

Thanks for the help simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 28-Jul-2006 18:59:21   

Aha. simple_smile

If an entity has a new property or field in v2, the property descriptor won't be found on the v1 entity. This then can lead to a crash as the code assumes both versions are the same. If the xml receiver was on v2 and the client on v1, it would work, but the other way around, it won't.

Frans Bouma | Lead developer LLBLGen Pro
Skeeterbug
User
Posts: 165
Joined: 21-May-2004
# Posted on: 28-Jul-2006 19:20:48   

Otis wrote:

Aha. simple_smile

If an entity has a new property or field in v2, the property descriptor won't be found on the v1 entity. This then can lead to a crash as the code assumes both versions are the same. If the xml receiver was on v2 and the client on v1, it would work, but the other way around, it won't.

Yeah it's crashing out on me now.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Jul-2006 10:43:34   

I'm out of options, the xml has to have the same xmlschema on both sides (serializing and deserializing).

Frans Bouma | Lead developer LLBLGen Pro
Skeeterbug
User
Posts: 165
Joined: 21-May-2004
# Posted on: 31-Jul-2006 18:16:03   

Otis wrote:

I'm out of options, the xml has to have the same xmlschema on both sides (serializing and deserializing).

I came up with a hack for it already simple_smile

Only one part of the web application needed to match this schema. So I generated another DAL called MissionFire.DALFIXED. Only one aspx page references this DAL, and it works out great. It's only a temp fix until 2.0 ships for the web application anyways. frowning

Thanks for the help.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 31-Jul-2006 18:38:46   

Glad you could work around it! simple_smile

Remember what the old IT saying says though: "There's nothing more permanent as a temporary solution" sunglasses

Frans Bouma | Lead developer LLBLGen Pro