XAPI Inbound Response API Usage Code Sample

This code sample illustrates how the business function uses the XML Service APIs to read and parse the XML data:

#include <B4205030.h>

      int iCurrentRecord;
      int iHeaderCount;
      int iRecordCount;
      NID nidDSName;
      DSD4205030A dsD4205030A = {0};
      DSD4205030B dsD4205030B = {0};
#ifdef jdeXAPI_CALLS_ENABLED
      if(jdeXAPI_IsCallTypeEnabled("XAPIOPOUT") &&      jdeXAPI_IsCallTypeEnabled
("XAPIOPIN") )
      {
            iRecordCount = jdeXML_GetDSCount(lpDS->szXMLHandle);
            if (iRecordCount > 0)
            {
                  for (iCurrentRecord = 0; iCurrentRecord < iRecordCount;      iCurrentRecord++)
                  {
                        jdeXML_GetDSName(lpDS->szXMLHandle,iCurrentRecord,nidDSName);
                        if (jdestrcmp(nidDSName,(const char*)"D4205030A") == 0)//mod
                        {
                              jdeXML_ParseDS( lpDS->szXMLHandle,iCurrentRecord,&dsD4205030A,
sizeof(DSD4205030A));
                        }
                        else
                        {
                              jdeXML_ParseDS( lpDS->szXMLHandle,iCurrentRecord,&dsD4205030B,
sizeof(DSD4205030B));
                              
                        }
                  }
            }
            if (iCurrentRecord == iRecordCount)
            {
                  jdeXML_DeleteXML(lpDS->szXMLHandle);
            }
      }
#endif