2 Replies Latest reply on Nov 25, 2021 6:06 AM by Jharana Patra

    How to extract elements values from an XML request and assign the value to a response.t

    Griffin Williams New Member

      We have a requirement where an API is hosted/deployed  and it accepts XML requests.

      We need to process the XML request and retrieve elements from the xml and send the values of the elements as a response.

       

      We need to extract BODID, CODE, LISTID etc from the Request which has similar structure like SAMPlE xml.

       

      Below is the Sample XML

       

       

      <?xml version="1.0"?>

      <CodeDefinition xmlns="http://schema.infor.com/InforOAGIS/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.infor.com/InforOAGIS/2 http://schema.infor.com/2.11.x/InforOAGIS/BODs/SyncCodeDefinition.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" releaseID="9.2" versionID="2.11.x">

      <AppArea>

      <Sender>

      <LogicalID>lid://abcd.ln.pqr_op_100</LogicalID>

      <ComponentID>erp</ComponentID>

      <ConfirmationCode>OnError</ConfirmationCode>

      </Sender>

      <CreationDateTime>2021-09-23T17:08:32Z</CreationDateTime>

      <BODID>infor-nid:for:::104022_2:?CodeDefinition&amp;verb=Sync</BODID>

      </AppArea>

      <DataArea>

      <Sync>

      <TenantID>infor</TenantID>

      <AccountingEntityID>

      </AccountingEntityID>

      <LocationID>

      </LocationID>

      <ActionCriteria>

      <ActionExpression actionCode="Add"/>

      </ActionCriteria>

      </Sync>

      <CodeDefinition>

      <DocumentID>

      <ID lid="lid://infor.ln.for_lo_10_4_510" variationID="81019">104022_2</ID>

      </DocumentID>

      <DisplayID>104022_2</DisplayID>

      <Status>

      <Code>Open</Code>

      <ArchiveIndicator>false</ArchiveIndicator>

      </Status>

      <ReadOnlyIndicator>true</ReadOnlyIndicator>

      <ListID>Department</ListID>

      <CodeValue>104022_2</CodeValue>

      <Name>LN-Packaging_3</Name>

      <Description>LN-Packaging_3</Description>

      <Property sequence="1">

      <NameValue name="Parent" type="StringType" listID="Department">OPS</NameValue>

      </Property>

      <Property sequence="2">

      <NameValue name="Posting Flag" type="IndicatorType">true</NameValue>

      </Property>

      <ReportingSlot>1</ReportingSlot>

      </CodeDefinition>

      </DataArea>

      </CodeDefinition>

       

      Thanks

      Griffin.