About input XML files for APIs
APIs retrieve data using input XML files that define which records need to be selected or used. When extending the database to include additional fields, you need to also extend the input XML to populate those fields.
CAUTION:
Do
not pass a blank element (an element containing all the attributes
with blank values) to an API. Also, do not pass attributes that have
leading or trailing spaces. The result of either situation is not
predictable.
The following example shows an input XML modification.
Example of input XML modification
The following example modifies the input XML file for the YFS_createOrder() API:
<Orders AuthenticationKey="">
<Order EnterpriseCode="DEFAULT" OrderNo="DB04"
OrderName="DB04" OrderDate="20010803" OrderType="Phone" PriorityCode="1"
PriorityNumber="1" ReqDeliveryDate="20010810" ReqCancelDate=""
ReqShipDate="20010810" SCAC="FEDEX" CarrierServiceCode="Express Saver Pak"
CarrierAccountNo="112255" NotifyAfterShipmentFlag="N"
NotificationType="FAX" NotificationReference="" ShipCompleteFlag="N"
EnteredBy="Iain " ChargeActualFreightFlag="Y" AORFlag="Y"
SearchCriteria1="Search" SearchCriteria2="Search Again" >
<OrderLines>
<OrderLine PrimeLineNo="1" SubLineNo="1"
OrderedQty="1" ReqDeliveryDate="20010810" ReqCancelDate="20010810"
ReqShipDate="20010810" SCAC="FEDEX" CarrierServiceCode="Express
Saver Pak" PickableFlag="Y" HoldFlag="N" CustomerPONo="11" >
<Extn ExtnAcmeLineType="Type1"/>
<Item ItemID="ITEM1" ProductClass="A" ItemWeight="1"
ItemDesc="paintball gun" ItemShortDesc="pball gun"
UnitOfMeasure="EACH" CustomerItem="Spectra Flex" CustomerItemDesc="GEGRG"
SupplierItem="Spectra Flex @ supplier" SupplierItemDesc="Spectra
Flex Desc @ supplier" UnitCost="15.99" CountryOfOrigin="CA"/>
<PersonInfoShipTo Title="Mr" FirstName="Quigley"
MiddleName="Al" LastName="Johns" Company="Company" JobTitle="Project
Clert" AddressLine1="Address Line 1 -3 Main Street" AddressLine2="ShipTo
Address line 2" AddressLine3="ShipTo Address line 3" AddressLine4="ShipTo
Address line 4" AddressLine5="ShipTo Address line 5" AddressLine6="ShipTo
Address line 6" City="Acton" State="MA" ZipCode="01720" Country="US"
DayPhone="978-635-9242" EveningPhone="978-635-9252" MobilePhone="978-888-8888"
Beeper="" OtherPhone="other555-5555" DayFaxNo="" EveningFaxNo=""
EMailID="jquigley@maine.com" AlternateEmailID="hfournier@ontario.com"
ShipToID=""/>
</OrderLine>
<NumberOfOrderLines/>
</OrderLines>
<PersonInfoShipTo Title="MR" FirstName="s"
MiddleName="X" LastName="T" Suffix="T" Department="T" Company="SD"
JobTitle="SS" AddressLine1="SS" AddressLine2="SS" AddressLine3="SS"
AddressLine4="SS" AddressLine5="SS" AddressLine6="SS" City="REDWOOD"
State="CA" ZipCode="01852" Country="USA" DayPhone="3456789234"
EveningPhone="3456789234" MobilePhone="" EveningFaxNo="SS" />
<PersonInfoBillTo Title="mj" FirstName="m"
MiddleName="JJ" LastName="KK" Suffix="lll" Department="l" Company="kj"
JobTitle="k" AddressLine1="HJHKK" AddressLine2="HJKHK" AddressLine3="HKHJ"
AddressLine4="" AddressLine5="" AddressLine6="" City="UUU" State="IUI"
ZipCode="78787" Country="USA" />
</Order>
<NumberOfOrders/>
</Orders>
Important: In order
for the factory setup scripts to operate properly, when you add a
column to a database table, be sure that the column is not null and
that it has a default value. If you need to make the column nullable,
the default value must not be present.
Also, when you are specifying XML Name and XML Group, keep in mind that the values should be valid Document Object Model (DOM) strings. (The values must not contain spaces or special characters that are not supported by the DOM specification.)
The following example XML file adds a column to the YFS_ORDER_LINE table:
<?xml version="1.0" encoding="UTF-8" ?>
<DBSchema>
<Entities>
<Entity TableName="YFS_ORDER_LINE">
<Attributes>
<Attribute ColumnName="EXTN_ACME_LINE_TYPE" DecimalDigits=""
Default Value="' '" Size="10" Type="CHAR" XMLGroup="Extn"
XMLName="ExtnAcmeLineType"/>
</Attributes>
</Entity>
</Entities>
</DBSchema>