QDoc Specifications and Standards > QDoc Examples > QAD Enterprise Applications Inbound QDoc Request (1.0)
  
QAD Enterprise Applications Inbound QDoc Request (1.0)
This is a sample partial QDoc request to maintain a purchase order in QAD Enterprise Applications, based on the API method maintainPurchaseOrder. The QDoc message envelope is omitted, as it is described elsewhere. See QDoc Message Envelope.The examples assume that the earliest supported QAD Enterprise Applications release is eB.
<?xml version="1.0" encoding="UTF-8"?>
<maintainPurchaseOrder version="eB_1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:enc="http://www.w3.org/2002/12/soap-encoding"
xmlns="http://www.qad.com/qdoc/eb"
xmlns:qcom="http://www.qad.com/qdoc/common"
schemaLocation="http://www.qad.com/qdoc/eb/schemas"
scopeTransaction="true"
logTransaction="true"
transactionId="abc123"
suppressResponseDetail="false"
xml:lang="EN"
>
<purchaseOrder>
<operation>A</operation>
<nbr>PO1234</nbr>
<vend>00000001</vend>
<ordDate>2002-04-01</ordDate>
<rmks>This is a test PO</rmks>
<purchaseOrderCmt>
<operation>A</operation>
<seq>01</seq>
<cmmt>Line 1 of comment!</cmmt>
</purchaseOrderCmt>
<purchaseOrderDet>
<operation>A</operation>
<line>01</line>
<dueDate>2002-05-01</dueDate>
<part>10-10000</part>
<qtyOrd>50</qtyOrd>
</purchaseOrderDet>
<purchaseOrderDet>
<operation>A</operation>
<line>02</line>
<dueDate>2002-06-01</dueDate>
<part>10-15000</part>
<qtyOrd>20</qtyOrd>
</purchaseOrderDet>
</purchaseOrder>
</maintainPurchaseOrder>
The following XML schema describes the syntax of the preceding sample. The PurchaseOrderType definition is used in the QDoc request and is stored in a separate file and included in the top-level schema.
<?xml version="1.0" encoding="UTF-8"?>
<!-- This schema would be stored in file
maintainPurchaseOrder-1_0.xsd -->
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:enc="http://www.w3.org/2002/12/soap-encoding"
xmlns:qdoc="http://www.qad.com/qdoc/eb"
xmlns:qcom="http://www.qad.com/qdoc/common"
targetNamespace="http://www.qad.com/qdoc/eb"
xml:lang="EN"
>
<!-- Include SOAP Encoding definitions,
common QAD Enterprise Applications QDoc fields,
purchase order definitions. -->
<import namespace="http://www.w3.org/2002/12/soap-encoding"
schemaLocation="soap-encoding.xsd"/>
<include schemaLocation="qdocCommon-eB_99.xsd"/>
<include schemaLocation="PurchaseOrderType-eB_1.xsd"/>
<element name="maintainPurchaseOrder">
<complexType>
<attributeGroup ref="qcom:commonAttributes"/>
<sequence>
<element name="purchaseOrder"
type="qdoc:PurchaseOrderType"
minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
</schema>
The following XML schema fragment defines PurchaseOrderType and PurchaseOrderDetType.
<!-- This schema would be stored in file
PurchaseOrderType.xsd -->
<!-- Include SOAP Encoding definitions,
common QAD Enterprise Applications QDoc fields,
transaction comment types. -->
<import namespace="http://www.w3.org/2002/12/soap-encoding"
schemaLocation="soap-encoding.xsd"/>
<import namespace="http://www.qad.com/qdoc/common"
schemaLocation="qdocCommon-qad_1.xsd"/>
<include schemaLocation="qdocCommon-eB_99.xsd"/>
<include schemaLocation="TransCommentType-eB_1.xsd"/>
<!-- PurchaseOrderType extends the common ApiTempTableType
in order to pick up the common temp-table fields -->
<!-- Primary key(s) of PurchaseOrderType are listed in
qdoc:primaryKeys for use when normalizing the data -->
<complexType name="PurchaseOrderType" qdoc:primaryKeys="nbr">
<complexContent>
<extension base="qdoc:ApiTempTableType">
<sequence>
<!-- Note: OperationType is defined in the common
QDoc XML Schema file to allow the
enumerated Values "A" (add), "M" (modify),
"R" (remove), ā€œUā€ (unmodified), and "S" (sync). -->
<element name="operation"
type="qdoc:OperationType"
minOccurs="0"/>
<element name="nbr" type="string" minOccurs="0"/>
<element name="vend" type="string" minOccurs="0"/>
...
<!-- Reuse common TransCommentType here -->
<element name="purchaseOrderCmt"
type="qdoc:TransCommentType"
minOccurs="0" maxOccurs="unbounded"/>
<element name="purchaseOrderDet"
type="qdoc:PurchaseOrderDetType"
minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</extension>
</complexContent>
</complexType>
...
<!-- PurchaseOrderDetType extends the common
ApiTempTableType in order to pick up the common
temp-table fields -->
<!-- Primary key(s) of PurchaseOrderDetType are listed in
qdoc:primaryKeys for use when normalizing the data -->
<complexType name="PurchaseOrderDetType"
qdoc:primaryKeys="line">
<complexContent>
<extension base="qdoc:ApiTempTableType">
<sequence>
<element name="operation" type="qdoc:OperationType"
minOccurs="0"/>
<element name="line" type="int" minOccurs="0"/>
...
</sequence>
</extension>
</complexContent>
</complexType>
...