I am generating an XML file that I am sending to another system. The XML file generates correctly however the secondary system requires specific headers to deserialize correctly.
I am struggling with the XML tags and how to structure my classes that insert the data.
PostShipmentNotesBD -> ShipmentNoteBD -> Shipmentheader -> ShipmentDetailsBD -> MerchandiseLineBD
[XmlType("PostShipmentNotes")] -> [XmlType("ShipmentNote")] -> [XmlType("ShipmentHeader")] -> [XmlType("ShipmentDetails")] -> [XmlType("MerchandiseLine")]
For whatever reason the PostShipmentNotes and MerchandiseLines use the XMLType as the header but the rest do not? I have played around with roots, elements and more but I am a bit out of my area of knowledge and just looking for the right direction.
<?xml version="1.0" encoding="utf-8"?>
<PostShipmentNotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ShipmentNoteBD>
<ShipmentHeader>
<CustomerName>Some Company</CustomerName>
<ShipmentStatusPrinted>Y</ShipmentStatusPrinted>
<ShipCode>1010</ShipCode>
<PlannedShipmentDate>2021-11-10</PlannedShipmentDate>
<SalesOrder>666777</SalesOrder>
<ShipAddress1>Big Long Street Name</ShipAddress1>
<ShipAddress2> </ShipAddress2>
</ShipmentHeader>
<ShipmentDetailsBD>
<MerchandiseLine>
<SalesOrderLine>1</SalesOrderLine>
<ShipmentQty>21</ShipmentQty>
<OverOrUnderShipment>N</OverOrUnderShipment>
</MerchandiseLine>
</ShipmentDetailsBD>
</ShipmentNoteBD>
</PostShipmentNotes>