XML Data - I/O Parameters and Code Sample

This appendix provides reference information for all HTML variables for developing a customized URI Query solution to download XML data. All variables are uploaded using SEND (Warning: This method is deprecated and its use will be discontinued in later versions) or POST method. Please contact us for more information.



Input Parameters


Name
Type
M/C/O
Description
_strAccountNumber
String
Mandatory
Customer Account Number (ex. shipperID, consigneeID, thirdpartyID, ...). Please contact your freight handler for more information.
_strAccountPassword
String
Mandatory
Customer Account Password
_strModule
String
Mandatory
Module Name String (see list below)
_strNumber
String
Conditional
Document Number (ex. Warehouse Receipt#). Mandatory if module option does not return a list
_strStartDate
Date
Optional
For lists it is the Start date interval. Allowed values as follows:
  • Default value is Today's date if not present or empty
  • MM/DD/YYYY value format if present (for January 25th, 2015 use 01/25/2015)
  • _strEndDate >= Today's date minus 15 days
  • _strStartDate <= _strEndDate
_strEndDate
Date
Optional
For lists it is the End date interval. . Allowed values as follows:
  • Default value is Today's date if not present or empty
  • MM/DD/YYYY value format if present (for January 25th, 2015 use 01/25/2015)
  • _strEndDate <= Today's date
  • _strStartDate <= _strEndDate

Output

Output will be a XML File

Note: if an error occurred then it will holds the error number and description in XML format


HTTP URI Sample Query (Deprecated)


        
    For specific documents:
    YOUR_FREIGHT_HANDLER_SERVER_NAME/XMLDataDownloadHandler.ashx?_strModule=STRING&_strNumber=STRING&_strAccountNumber=YOUR_ACCOUNT&_strAccountPassword=YOUR_PASS

    For lists:
    YOUR_FREIGHT_HANDLER_SERVER_NAME/XMLDataDownloadHandler.ashx?_strModule=STRING&_strStartDate=MM/DD/YYYY&_strEndDate=MM/DD/YYYY&_strAccountNumber=YOUR_ACCOUNT&_strAccountPassword=YOUR_PASS


Simple Javascript Code

TrackingXMLFetcher.html

    <!DOCTYPE html>

    <html>
        <head>
            <meta charset="UTF-8">
            <title>XML FETCH() EXAMPLE</title>
        
            <script>
            
                function xmlpostdatafetch() {
                
                    let formData = new FormData();
                    
                    // For specific documnts

                    formData.append('_strModule','MODULE_ID');
                    formData.append('_strNumber','DOCUMENT_NUMBER');
                    formData.append('_strAccountNumber','YOUR_ACCOUNT');
                    formData.append('_strAccountPassword','YOUR_PASS');
                
                    // For lists

                    // formData.append('_strModule','MODULE_ID');
                    // formData.append('_strStartDate', 'MM/DD/YYYY');
                    // formData.append('_strEndDate', 'MM/DD/YYYY');
                    // formData.append('_strAccountNumber','YOUR_ACCOUNT');
                    // formData.append('_strAccountPassword','YOUR_PASS');
             
                    fetch('http://YOUR_FREIGHT_HANDLER_SERVER_NAME/XMLDataDownloadHandler.ashx', {
                        method: 'POST',
                        mode: 'cors',
                    
                        referrerPolicy: 'no-referrer',
                        body: new URLSearchParams(formData)
                    })
                    .then(response => {
                        return response.text();
                    })
                    .then(data => { 
                        document.getElementById('xmlresponse').innerHTML = data.replace(/</gi,'<').replace(/>/gi,'>\n');
                    })
                    .catch((err) => {
                        document.getElementById('xmlresponse').innerHTML = 'Error fetching XML data';
                    });
                
                    document.getElementById('xmlresponse').innerHTML = 'Waiting for XML data...';
                
                }
                        
            </script>
        </head>
    
        <body>
        
            <input type="button" onclick="xmlpostdatafetch();" value="Post Data">
            <br />
            <br />
            <div id="xmlresponse">Ready to fetch data</div>
        
        </body>
    </html>

Module List



(*) Only for system users



Give us a call we are here to help. Free and Non-Compromise Quote
Disclaimer: This Website uses 'cookies' to store user preferences information. Using this site means you are 'OK with this.

 Powered by K SSS, Inc.
 Powered by K SSS, Inc.
Disclaimer: This Website uses 'cookies' to store user preferences information. Using this site means you are 'OK with this.