CXT Software provides a unique and useful product to its customers called Web Services that allow the transfer of data back and forth to the CXT Software suite via the Internet. The Web Service allows you to use an HTTP/HTTPS POST to inject/retrieve data from the CXT Software suite database when data is properly formatted in XML.
If knowledgeable in-house or familiar local resources are not available CXT Software recommends this company for integration expertise: www.creativeimp.com, email: wendy@creativeimp.com (Wendy McDonald)
Sample HTML is provided below which when implemented creates a functional online quoting system using the X Web API Package. An "API" (Application Program Interface) is a set of routines, protocols, and tools for building software applications. Relative to the X Web API, CXT Software has created a standard interface to be used by customers to quickly and easily create their own unique work-flow applications using X Dispatch as its foundation.
Four fields must be replaced to implement the code below, these fields are:
<% Dim objXMLHTTP : set objXMLHTTP = Server.CreateObject("Msxml2.XMLHTTP.3.0") Dim strRequest, strResult, strURL strURL = "http://yourxinternetwebsite.com/xmllistener.asp" ' ---------------------------- strRequest ="<?xml version=""1.0"" encoding=""ISO-8859-1""?>" _ & "<OrderRequest xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">" _ & "<UserID>userID</UserID>" _ & "<Password>password</Password>" _ & "<EncryptedPassword>true</EncryptedPassword>" _ & "<CustID>1001</CustID>" _ & "<Origin>" _ & "<Address>" _ & "<AddressTitle>Sample Origin</AddressTitle>" _ & "<StreetAddr>3030 N Central Ave</StreetAddr>" _ & "<SuiteNumber></SuiteNumber>" _ & "<City>Phoenix</City>" _ & "<StateProvince>AZ</StateProvince>" _ & "<Country>USA</Country>" _ & "<ZipCode>85012</ZipCode>" _ & "<ZipCodeExt></ZipCodeExt>" _ & "</Address>" _ & "<ContactName>Origin Contact Person</ContactName>" _ & "<ContactPhone>650-324-2777</ContactPhone>" _ & "<ContactEmail></ContactEmail>" _ & "<Remarks></Remarks>" _ & "</Origin>" _ & "<Destination>" _ & "<Address>" _ & "<AddressTitle>Sample Destination</AddressTitle>" _ & "<StreetAddr>3350 N Central Ave</StreetAddr>" _ & "<SuiteNumber></SuiteNumber>" _ & "<City>Phoenix</City>" _ & "<StateProvince>AZ</StateProvince>" _ & "<Country>USA</Country>" _ & "<ZipCode>85012</ZipCode>" _ & "<ZipCodeExt></ZipCodeExt>" _ & "</Address>" _ & "<ContactName>Destinantion Contact</ContactName>" _ & "<ContactPhone>408-489-8688</ContactPhone>" _ & "<ContactEmail></ContactEmail>" _ & "<Remarks>CALL FOR DRIVEWAYINSTRUCTIONS</Remarks>" _ & "</Destination>" _ & "<ParcelInfo>" _ & "<Pieces>20</Pieces>" _ & "<TotalWeight>500</TotalWeight>" _ & "<Value></Value>" _ & "<PickUpTime>08:00T2009/05/14</PickUpTime>" _ & "<Reference1>5551212</Reference1>" _ & "<Reference2>1223334444</Reference2>" _ & "<BillingGroup></BillingGroup>" _ & "<RequestOrderType>0</RequestOrderType>" _ & "<RequestServiceType></RequestServiceType>" _ & "<RequestDeliverTime>17:00T2009/05/14</RequestDeliverTime>" _ & "</ParcelInfo>" _ & "</OrderRequest>" ' ----------------------------------- objXMLHTTP.open "post", "" & strURL & "", False objXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8" objXMLHTTP.setRequestHeader "Content-Length", Len(strRequest) 'send the request and capture the result Call objXMLHTTP.send(strRequest) strResult = objXMLHTTP.responseText 'display the XML 'response.write strResult %> <html> <head> </head> <body> <% set xmldoc=CreateObject("msxml2.domdocument") xmldoc.loadXML strResult set node1 = xmldoc.selectSingleNode("/OrderResponse/Option/Type") set node2 = xmldoc.selectSingleNode("/OrderResponse/Option/Rate") if node1 is nothing then response.write "No Rate" else response.write "Delivery Type: " & node1.text & "<br>" response.write "Estimated Charges: $" & node2.text & "<br><br><br>" end if %> ------------------------------------------------------------------------ <br> <% Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM") xmlDoc.setProperty "SelectionLanguage", "XPath" xmlDoc.async = true xmlDoc.loadXML(strResult) Set xmlList = xmlDoc.getElementsByTagName("Rate") For Each xmlItem In xmlList Response.Write "" Response.Write "Rates: " & xmlItem.childNodes(0).text & "<br>" Next %> ---------------------------------------------------------------------------- <br> <b>This is a nice little HTML table with all the rates from the response XML<b> <br> <% Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM") xmlDoc.setProperty "SelectionLanguage", "XPath" xmlDoc.async = true xmlDoc.loadXML(strResult) Response.Write "<table align=left border=1><tr><td>Order Type</td><td>Pickup Time</td><td>Delivery Time</td><td>Rate</td></tr>" Set xmlList = xmlDoc.getElementsByTagName("Option") For Each xmlItem In xmlList Response.Write "<tr>" Response.Write "<td>" & xmlItem.getElementsByTagName("Type")(0).text & "</td>" Response.Write "<td>" & xmlItem.getElementsByTagName("PickupTime")(0).text & "</td>" Response.Write "<td>" & xmlItem.getElementsByTagName("DeliveryTime")(0).text & "</td>" Response.Write "<td>" & xmlItem.getElementsByTagName("Rate")(0).text & "</td>" Response.Write "</tr>" Next Response.Write "</table>" %> <p> <br> <br> <br> <br> <br> <br> <br> <br> <b>This is the response XML</b> <br> <table BORDERCOLOR=RED align=left border=1 Style="border-style:dotted;"><tr><td> <textarea rows="100" cols="120"> <% response.write strResult %> </textarea> </td></tr></table> </p> <br> <br> </body> </html> |