Beispiel #1
0
        private static void ParseHeaderIntoRequest(XElement epcisHeader, EpcisRequest request)
        {
            if (epcisHeader == null || epcisHeader.IsEmpty)
            {
                return;
            }

            var headerMasterdata = epcisHeader.Element("extension")?.Element("EPCISMasterData")?.Element("VocabularyList");

            if (headerMasterdata != null)
            {
                request.MasterdataList.AddRange(XmlMasterdataParser.ParseMasterdata(headerMasterdata));
            }
        }
Beispiel #2
0
        private static void ParseBodyIntoRequest(XElement epcisBody, EpcisRequest request)
        {
            var element = epcisBody.Elements().First();

            switch (element.Name.LocalName)
            {
            case "QueryResults":
                ParseCallbackResult(element, request); break;

            case "QueryTooLargeException":
                ParseCallbackError(element, QueryCallbackType.QueryTooLargeException, request); break;

            case "ImplementationException":
                ParseCallbackError(element, QueryCallbackType.ImplementationException, request); break;

            case "EventList":
                request.EventList.AddRange(XmlEventParser.ParseEvents(element)); break;

            case "VocabularyList":
                request.MasterdataList.AddRange(XmlMasterdataParser.ParseMasterdata(element)); break;
            }
        }