Error generating XML from an XSD (Using xsd.exe) VB.NET -
Look well what I'm trying to do is make an XML for this through an XSD I am using a class that I had created with the Xsd.exe tool (VOUCHER_BUILD_VERSION_2.vb) originally two child nodes are translated as MSGDATA and field type two properties.
There was no problem with the first node because all the children of that node have simple XML pieces made with this code:
Slowly new VOUCHER_BUILD_TypeShape () Adname .FieldTypes = Type new fieldtips with addenda.FieldTypes. VCHR_BANK_STG = VCHR_BANK_STG with new field type VCHR_BANK_STG .class = "R". VCHR_BANK_STG_TypeShape .USUSESS_UNIT = New field typefirefield type ... Finish with the dim X with the new XmlSerializer (GetType (VOUCHER_BUILD_TypeShape) filestream ("C: / FelsPS / Demo XML., Flemmod.Creative) X.Serialize (FS, Adend) FSclose () Does the following XML generate: & Lt; VOUCHER_BUILD xmlns: xsd = "http://www.w3.org/2001/XMLSchema" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"> & lt; Fiel Dtypes & gt; VCHR_VNDR_STG class = "R"> ... & LT ; / Voucher & gt; This issue is a complex type with another node (MSGDATA) which is expected to node in XML:
& lt ; Msgdata & gt; & lt; transaction & gt; & lt; VCHR_HDR_STG class = "R"> & lt; BUSINESS_UNIT & gt; MEX01 & lt; / BUSINESS_UNIT & gt; ... & lt; / VCHR_HDR_STG & gt; & Lt; PSCAMA class = "R" & gt; & Lt; LANGUAGE_CD / & gt; & Lt; AUDIT_ACTN & gt; & Lt; / AUDIT_ACTN & gt; ... & lt; / PSCAMA & gt; ... & lt; / Transactions & gt; & Lt; / MsgData & gt; As I am trying to create: I first created MSGDATA node:
dim oTransaction_TypeShape (0) TransactionTypeShape as an addendant Msgdata = oTransaction_TypeShape This works, the field type minimizes me after the node
after trying to keep the content:
Moderate OTransaction_TypeShape (0) Transaction_TypeShape as' This line is the principle that I am adding NODE VCHR_HDR_STG oTransaction_TypeShape (0) .VCHR_HDR_STG = New VCHR_HDR_STGMsgDataRecord_TypeShape Addenda.MsgData = oTransaction_TypeShape An error is not compiled, but throws this error when running: Object reference to an example of an object Not set.
Something looks very simple, but I've already failed.
Thank you very much for your help.
I finally solved, error was a feature that had no value (nothing): Smooth Transaction TypeShap (0) Transaction type package as ottanzactiontamppap (0) = new transaction type-size ottenzaction_timeship (0). VCHR_HDRHGR = New VCHR_HDRGAMMJMatatycard CardDipPip
Comments
Post a Comment