openepcis / openepcis-document-converter

Convert GS1 EPCIS events from JSON-LD to XML format and vice versa.
https://openepcis.io
Apache License 2.0
3 stars 1 forks source link

EPCIS file with EPCISHeader #19

Open jegathmca opened 1 year ago

jegathmca commented 1 year ago

Json result is not proper when converting xml file ( with EPCISHeader )

Aravinda93 commented 1 year ago

@jegathmca Thanks for reporting. Can you please provide the request and response for reproducing the issue?

jegathmca commented 1 year ago

HI @Aravinda93 Thanks for the quick reply. my input xml with epcisheader is uploaded here https://drive.google.com/file/d/1BYKcAKPAefoLsgb33F0nH_Ro8L27nMSa/view?usp=drive_link

And my output json is

Click to expand Output JSON ```json { "@context": [ "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld", { "gs1ushc": "http://epcis.gs1us.org/hc/ns" } ], "type": "EPCISDocument", "schemaVersion": "2.0", "creationDate": "2023-09-05T19:52:38Z", "epcisBody": { "eventList": [{ "type": "ObjectEvent", "@context": [{ "cbvmda": "urn:epcglobal:cbv:mda" }, { "sbdh": "http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" } ], "eventTime": "2023-04-21T02:11:27Z", "eventTimeZoneOffset": "+00:00", "epcList": [ "urn:epc:id:sgtin:012345.012345.ABC123ABC123" ], "action": "ADD", "bizStep": "commissioning", "disposition": "active", "readPoint": { "id": "urn:epc:id:sgln:9876543.01234.0" }, "bizLocation": { "id": "urn:epc:id:sgln:9876543.01234.0" }, "ilmd": { "cbvmda:itemExpirationDate": "2024-05-28", "cbvmda:lotNumber": "ABC0001" }, "EPCISHeader": { "EPCISMasterData": "8374726732XYZ_ABCXYZ_ABCCOMPANY NAMEInjection5001COMPANYNAME (US)ADDRESS LINE1CITYST12345US", "sbdh:StandardBusinessDocumentHeader": { "sbdh:Sender": "0123450000000", "sbdh:DocumentIdentification": { "sbdh:Type": "Events", "sbdh:Standard": "EPCglobal", "sbdh:CreationDateAndTime": "2023-09-05T19:52:38Z", "sbdh:TypeVersion": "1.0", "sbdh:InstanceIdentifier": "39188HBe6" }, "sbdh:Receiver": "1234567890123", "sbdh:HeaderVersion": "1.0" } } }, { "type": "ObjectEvent", "@context": [], "eventTime": "2023-09-02T08:55:01.999Z", "eventTimeZoneOffset": "+00:00", "epcList": [ "urn:epc:id:sscc:012837363.1234.0" ], "action": "ADD", "bizStep": "commissioning", "disposition": "active", "readPoint": { "id": "urn:epc:id:sgln:012837363.1234.0" }, "bizLocation": { "id": "urn:epc:id:sgln:012837363.1234.0" } }, { "type": "AggregationEvent", "@context": [], "eventTime": "2023-09-02T08:55:02Z", "eventTimeZoneOffset": "+00:00", "parentID": "urn:epc:id:sscc:0987654.0001112233", "childEPCs": [ "urn:epc:id:sgtin:0192373.012345.ABC123ABC123" ], "action": "ADD", "bizStep": "packing", "disposition": "in_progress", "readPoint": { "id": "urn:epc:id:sgln:012837363.1234.0" }, "bizLocation": { "id": "urn:epc:id:sgln:01234385.12340.0" } }, { "type": "ObjectEvent", "@context": [], "eventTime": "2023-09-02T08:55:06Z", "eventTimeZoneOffset": "+00:00", "epcList": [ "urn:epc:id:sscc:1293838.00123456" ], "action": "OBSERVE", "bizStep": "shipping", "disposition": "in_transit", "readPoint": { "id": "urn:epc:id:sgln:12345466.1234.0" }, "bizTransactionList": [{ "type": "desadv", "bizTransaction": "urn:epcglobal:cbv:bt:083737373000000:SIDEIWU38383" }, { "type": "po", "bizTransaction": "urn:epcglobal:cbv:bt:1938348703084:PO73bsdf9e" } ], "sourceList": [{ "type": "owning_party", "source": "urn:epc:id:sgln:04636474.00000.0" }, { "type": "location", "source": "urn:epc:id:sgln:0938382.3334.0" } ], "destinationList": [{ "type": "owning_party", "destination": "urn:epc:id:sgln:1230004048585..0" }] } ] } } ```
Aravinda93 commented 1 year ago

@jegathmca Thanks for the output, if possible can you please post the XML input as well here in the comment instead of the external link? It will also be easy and useful for others who are following the issues here.