NVMS, Inc Data Exchange Specifications
Version 1.5.1010Client: Client Here
Client ID: Client Num
This document should explain the setup of the B2B data exchange using the transfer of data using an HTTP request with XML data technology. Please follow the following examples to set up your xml file and to plan your WebService setup. I've included a vbs file that you can use to validate your test xml document by just dragging your file onto the program file. I've also included a sample DTD that you can use to test validate your XML files.
Usage: There are many different ways to send xml data using an HTTP request.
I've used classic ASP in my example, but you can use .NET or any technology that can send an XML file using an HTTP request. Following are the URL's for Production and Test modes.
Sending Order Information:
Production: URI = "http://exchange.nvms.com/Send.asp" Test: URI = "http://exchange.nvms.com/SendTest.asp"
Please see the attached file: "SendExample.asp" for an example of how you can send files using classic ASP.
Retrieving Order Information:
Production: URI = "http://exchange.nvms.com/Get.asp" Test: URI = "http://exchange.nvms.com/GetTest.asp"
By submitting your reference # (We call it "FileNumber") in an XML file you can retrieve completed order information that is URL Encoded and attached documents (images) that are encoded using Base64.
Order Status:
Production: URI = "http://exchange.nvms.com/Status.asp" Test: URI = "http://exchange.nvms.com/StatusTest.asp"
By submitting your reference # (We call it "FileNumber") in an XML file you can retrieve order status information.
If you have any questions or problems or would like to register to send us batch orders using our WebService, please contact me at: [email protected].
Sending Order Data
Field Definitions/Explanation
Field/Attribute Field Type (Size) Required Notes Format Ex: XML Tag
username int Yes Same as client ID "10" security
password varchar(50) Yes Given to you at time of setup "password" security
ClientID int Yes *See Client Section for correct ID "73" details, service
UserID int Yes *See Client Specific Users for user ID "23" details
FileNumber varchar(50) Yes Your unique file number. "any text or num" details
PropOwner varchar(50) Yes Business name or Property name. "new business" details
PropAddress varchar(50) Yes Business or property address. "123 Main St" details
PropCity varchar(50) Yes Business or property city. "FreeTown" details
PropState varchar(50) Yes Business or property state. "VA" details
PropZip varchar(50) Yes Business or property zip. "21220" details
PropDesc varchar(100) No Optional business description. "Building" details details
mobYear varchar(10) No Optional mobile home year built. "1980" details
mobModel varchar(50) No Optional mobile home model. "RED ONE" details
mobSerial varchar(50) No Optional mobile home serial number. "283983AB" details
mobLength varchar(5) No Optional mobile home length "40 ft" details
mobWidth varchar(5) No Optional mobile home width. "70 ft" details
AccContact varchar(50) No Business contact name. "Bill Coctosin" details
AccMobile varchar(50) No Business contact mobile phone number. "7035551212" details
AccFax varchar(50) No Business contact fax number. "7035551234" details
AccHome varchar(50) No Business contact home phone number. "7034582321" details
AccWork varchar(50) No Business contact work phone number. "7035551243" details
AccEmail varchar(50) No Business contact email. [email protected] details
ClientDBA varchar(50) No You can use this field as the dba name or the agent name/sales person name.
"BankCard Systems" or "John Doe"
details
Notes varchar(1000) No Optional order notes. "Notes Here" details
ServiceID int Yes *See Client Specific Services for service ID "6" service
pid int Yes Same as parent order id attribute "2" service
Client Specific Services - Client Here
ServiceID Service Description
You will receive these details once your company is signed up.
Client Specific Users - Client Here
UserID Name Email
You will receive these details once your company is signed up.
XML Example
<?xml version="1.0"?><!DOCTYPE root SYSTEM "OrderExchange.dtd"> <root>
<security username="44" password="test"></security> <order id="1">
<details ClientID="44" UserID="554" FileNumber="12138326" PropOwner="Ted Nugent" PropAddress="134 Wilcoxen St" PropCity="Manassas" PropState="VA" PropZip="20111" ClientDBA="John Doe" Notes="These are some test notes here."/>
<service pid="1" clientID="44" serviceID="6"/>
</order> <order id="2">
<details ClientID="44" UserID="554" FileNumber="8378326" PropOwner="Miles Davis" PropAddress="134 Wilcoxen St" PropCity="Fairfax" PropState="VA" PropZip="22103" ClientDBA="Phil McCrakin" Notes="These are some test notes here."/>
<service pid="2" clientID="44" serviceID="6"/> </order>
<order id="3">
<details ClientID="44" UserID="554" FileNumber="2173226" PropOwner="Bill Coctosin" PropAddress="134 Wilcoxen St" PropCity="McLean" PropState="VA" PropZip="22102" ClientDBA="dba: Bankcard Services" Notes="This is a new order with some notes here."/> <service pid="3" clientID="44" serviceID="6"/>
</order> </root>
XML Data Field Explanation:
1.) All XML files sent to NVMS, Inc. should include the DOCTYPE tag referencing the OrderExchange.dtd or you file will fail validation.
2.) The order id attribute should be a unique value for each order sent in the batch.
3.) You can attach multiple services using the <service> tag. The "pid" attribute must match the
parent order id for all services under the parent order. All attributes must be included in the service tag.
DTD Example
<!ELEMENT root (security,order+)> <!ELEMENT security (#PCDATA)><!ATTLIST security username CDATA #REQUIRED> <!ATTLIST security password CDATA #REQUIRED> <!ELEMENT order (details,service+)>
<!ATTLIST order id CDATA #REQUIRED> <!ELEMENT details (#PCDATA)>
<!ATTLIST details ClientID CDATA #REQUIRED> <!ATTLIST details UserID CDATA #REQUIRED> <!ATTLIST details FileNumber CDATA #REQUIRED> <!ATTLIST details PropOwner CDATA #REQUIRED> <!ATTLIST details PropAddress CDATA #REQUIRED> <!ATTLIST details PropCity CDATA #REQUIRED> <!ATTLIST details PropState CDATA #REQUIRED> <!ATTLIST details PropZip CDATA #REQUIRED> <!ATTLIST details PropDesc CDATA #IMPLIED> <!ATTLIST details mobYear CDATA #IMPLIED> <!ATTLIST details mobModel CDATA #IMPLIED> <!ATTLIST details mobSerial CDATA #IMPLIED> <!ATTLIST details mobLength CDATA #IMPLIED> <!ATTLIST details mobWidth CDATA #IMPLIED> <!ATTLIST details AccContact CDATA #IMPLIED> <!ATTLIST details AccMobile CDATA #IMPLIED> <!ATTLIST details AccFax CDATA #IMPLIED> <!ATTLIST details AccHome CDATA #IMPLIED> <!ATTLIST details AccWork CDATA #IMPLIED> <!ATTLIST details AccEmail CDATA #IMPLIED> <!ATTLIST details ClientDBA CDATA #IMPLIED> <!ATTLIST details Notes CDATA #IMPLIED> <!ELEMENT service (#PCDATA)>
<!ATTLIST service pid CDATA #REQUIRED> <!ATTLIST service clientID CDATA #REQUIRED> <!ATTLIST service serviceID CDATA #REQUIRED>
Client Transfer Example
'************************ HTTP Request Example for DataExchange Response **************** Dim xmlhttp, url, xmlFile
Dim xmlDoc, oXmlSend
Set oXmlSend = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0") Set oXmlGet = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0") url = "http://exchange.nvms.com/SendTest.asp" xmlFile = "http://yourserver/webfolder/testNVMS.xml" Response.ContentType = "text/html" 'Get File
oXmlGet.open "GET", xmlFile, false oXmlGet.send()
xmlDoc = oXmlGet.responseText
'Send File
oXmlSend.open "POST", url, false oXmlSend.send(xmlDoc) If err.number <> 0 Then Response.Write err.Description Else Response.Write oXmlSend.responseText End If
Retrieving Order Data
XML Example
<?xml version="1.0" encoding="utf-8"?> <root>
<security username="user" password="password"></security> <order ClientID="124" FileNumber="FILE1"></order>
<order ClientID="124" FileNumber="FILE2"></order> <order ClientID="124" FileNumber="FILE3"></order> </root>
Submit your XML file to us in this format and receive order documents that can be saved in your own document management system. You can batch as many order tags as you like in this XML request, but remember each file will be +/- 1.5 MB - This depends on the number of reports and images included in each report.
Return XML Schema: <root>
<report reportID="2" FileNumber="12345" servicename="Merchant Site Inspection" charge="45" invoicedate="4/5/2005" report="URLEncoded Report">
<attachments reportID="2" imageID="1" extension="jpg" image="Base64 Encoded Binary"/> <attachments reportID="2" imageID="2" extension="jpg" image="Base64 Encoded Binary"/> </report>
</root>
The XML schema returned is like the example above. The report data is sent to you in a URL Encoded format so you'll have to decode this to before reading it. The report is just an HTML table. The attachments are encoded using Base64 so you'll have to decode these as well using some sort of Base64 decode function. Let me know if you need help with either… Please look in the exchange.zip file for the file "testNVMSget.xml" for an example of the XML data returned.
You also need to watch for errors in the response file. If there are errors, an "<error>" tag will be returned with corresponding text. <error text="No attachments found for this report..." />
Order Status
XML Example (request)
<?xml version="1.0" encoding="utf-8"?><root>
<security username="test" password="password"/> <status ClientID="44"> <order file="2318653223"/> <order file="CURVES"/> <order file="8149468922"/> <order file="518564050123702"/> </status> </root>
Submit your XML file to us in this format and receive order status for each file number passed. You can use this info from your system to send us this request to tell which order are complete. If complete you may then run the "Retrieve" function to pull down the data of the full report.
Return XML Schema:
<?xml version="1.0" encoding="utf-8" ?> <root>
<order filenum="2318653223" status="Delivered" EntryDate="4/12/2004 12:47:00 PM" PropOwner="GINGER CREEK GIFT BASKET" InvoiceDate="4/21/2004 6:25:00 PM" StatusBool="True" userID="263" />
<order filenum="8149468922" status="Delivered" EntryDate="4/12/2004 12:48:00 PM" PropOwner="SERVELLO GALLERY OF ART" InvoiceDate="4/19/2004 5:09:00 PM" StatusBool="True" userID="263" />
<order filenum="518564050123702" status="Delivered" EntryDate="3/10/2004 5:55:00 PM" PropOwner="FIT IN THIRTY" InvoiceDate="3/16/2004 6:19:00 PM" StatusBool="True" userID="263" />