Link to home
Start Free TrialLog in
Avatar of astronm
astronmFlag for Ireland

asked on

How to work with xsd2Code generated business objects .NET ?

Hello EE!

Having a trouble to figure out how to call methods of xsd2Code generated business objects .NET application.

Say for instance I have generated with xsd2Code with a

Namespace CustomersOrders

 ...
    Partial Public Class Root 
....

Open in new window


As it stated I have to call Root.Serialize()
to generate test XML.

in VB.NET it's just not working as well I can access only  Deserialize()  and ReadFromFile
but nothing else.

Where to begin to work with generated classes and how to pass a values to those classes during serialization?

Thank you.

Alex
CustomersOrders.xml
CustomersOrders.xsd
CustomersOrders.Designer.vb
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Looking at the designer class, there is a serialize method but it appears to be dummy and is expected to be overriden by your code.
Avatar of astronm

ASKER

Hi Savant.
Oh, You right! it turns like need some constructions like
Public Overrides Function  Serialize() As String 

Open in new window


But how to build this Overrides Function for every element in generated classes ?

Can I just replace it in a classes declarations with same construction as Deserialize have :
 Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As Root, ByRef exception As System.Exception) As Boolean

Open in new window


In other words, what the use of those overridden functions if they are build in every separate Partial Public Class  like Root or CustomerType or AddressType ...

May be you have some very simple example how to use them for serialization?

Thank you.

Alex
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial