ich habe ein Problem mit der Serialisation von einer XML Datei.
XML
PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<msg:ContainerStuffing xmlns:msg="XXXX">
<msg:Shipment id="XXXX">
<msg:Shipper>
<msg:Name>GNXXXHNIK GMBH</msg:Name>
<msg:Street>MOEXXEN 42</msg:Street>
<msg:Country>DE</msg:Country>
<msg:Postcode>32549</msg:Postcode>
<msg:City>BAD OXXUSEN</msg:City>
<msg:Contact>
<msg:TelNr>+ XX307 0</msg:TelNr>
</msg:Contact>
</msg:Shipper>
<msg:Consignee>
<msg:Name>INTXXXCORP.</msg:Name>
<msg:Street>101 XXST BLVD</msg:Street>
<msg:Country>US</msg:Country>
<msg:Postcode>XX</msg:Postcode>
<msg:City>XX</msg:City>
</msg:Consignee>
<msg:BL>XX</msg:BL>
<msg:Transport>
<msg:Vessel>
<msg:Name>OXXTREAL</msg:Name>
</msg:Vessel>
<msg:VoyageNo>SAC2169</msg:VoyageNo>
<msg:DeparturePort>
<msg:Name>HAX</msg:Name>
<msg:Code>HAM</msg:Code>
</msg:DeparturePort>
<msg:DestinationPort>
<msg:Name>TORX</msg:Name>
<msg:Code>TORX</msg:Code>
</msg:DestinationPort>
</msg:Transport>
<msg:NonStackable>N</msg:NonStackable>
<msg:Package>
<msg:Quantity>2</msg:Quantity>
<msg:Type>PA</msg:Type>
<msg:GoodsDescription>TEXERIAL</msg:GoodsDescription>
<msg:GoodsDescription>RETXODS</msg:GoodsDescription>
<msg:MarksAndNumbers>EFS PLASTICS</msg:MarksAndNumbers>
<msg:MarksAndNumbers>5788 LINE 84</msg:MarksAndNumbers>
<msg:MarksAndNumbers>LISXEL</msg:MarksAndNumbers>
<msg:MarksAndNumbers>OXW 3G9</msg:MarksAndNumbers>
<msg:MarksAndNumbers>CANADA</msg:MarksAndNumbers>
<msg:Weight unit="KGM">700</msg:Weight>
<msg:Volume unit="MTQ">3.456</msg:Volume>
</msg:Package>
<msg:Remarks>HXADA</msg:Remarks>
<msg:ResponsiblePerson>
<msg:Tel>XX</msg:Tel>
<msg:Fax>XX</msg:Fax>
</msg:ResponsiblePerson>
</msg:Shipment>
</msg:ContainerStuffing>
Struct
PHP Code:
Option Strict On
Option Explicit On
Public Structure ContainerStuffing
Public Shipment() As Shipment
End Structure
Public Structure Shipment
Public id As String
Public Ident As String
Public Shipper As Shipper
Public Consignee As Consignee
Public BL As String
Public Transport As Transport
Public NonStackable As String
Public Remarks As String
Public ResponsiblePerson As ResponsiblePerson
Public Package() As Package
End Structure
Public Structure Package
Public Name As String
Public Quantity As Integer
Public Type As String
Public GoodsDescription() As String
Public MarksAndNumbers() As String
Public Weight As Single
Public Volume As Single
End Structure
'Public Structure Shipper
' Public Bestand As String
' Public Datum_AuftrEmpf As String
' Public Dateiname As String
' Public Dateiname_AuftragEmpf As String
' Public Gefahrgut As String
' Public AuftrGeber As String
' Public AuftrGeberSachbearbeiter As String
' Public AuftrGeberTelNr As String
' Public Zielhafen As String
' Public Schiff As String
' Public AuftrKopfBemerkung As String
' Public KundenRef As String
' Public LadehafenName As String
' Public Zollgut As String
' Public LoeschhafenUNLOC As String
' Public Ueberstaubar As String
' Public Sendungsdetails As List(Of Detaildaten)
' Public HafenPlatz As String
' Public NonStackable As String
' Public Remarks As String
' Public ResponsiblePerson As ResponsiblePerson
'End Structure
Public Structure Shipper
Public Name As String
Public Street As String
Public Country As String
Public Postcode As String
Public City As String
Public Contact As ContactShipper
End Structure
Public Structure ContactShipper
Public TelNr As String
Public Name As String
End Structure
Public Structure Consignee
Public Name As String
Public Street As String
Public Country As String
Public Postcode As String
Public City As String
Public Contact As ContactShipper
End Structure
Public Structure Transport
Public Vessel As Vessel
Public VoyageNo As String
Public DeparturePort As DeparturePort
Public DestinationPort As DeparturePort
End Structure
Public Structure DeparturePort
Public Name As String
Public Code As String
End Structure
Public Structure Vessel
Public Name As String
End Structure
Public Structure ResponsiblePerson
Public Name As String
Public Tel As String
Public Fax As String
End Structure
Leider findet er er nichts. das Serialisieren läuft ohne Fehlermeldung durch. Aber wenn ich mit
PHP Code:
Sendung.Shipment.Length
Ich hab schon ein paar mal das mit ner Struct gemacht und weißt jetzt nicht warum das hier nicht klappt.
MfG Ludder231