I am having a problem with data that is being posted to another
server. The problem is I collect the data from our database through
an .cfm file (and all data is correct), which then the data is saved
to an .xml document and posted to another server though an .asp file.
The problem is the other server is either not receiving the data (it
says it exports without an problems on our end) or it is not receiving
the data correctly. The only thing I have is our .cfm file and
our .asp file. Is there a way to see what is being sent before it is
posted to their server? Can I save the .xml document on our server?
Would I have to change or rewrite all of the code? Right now the .asp
file opens the sql, performs the select statement, saves it to xmldoc,
then post it to the other server (postURL) which is an .asp file on
their server.
example of code:
<%@ Language=VBScript Transaction=Required %>
<%Option Explicit
function GetDBConnection()
dim tmp
set tmp = server.CreateObject("ADODB.Connection")
tmp.Open OHGetConnectionString()
set GetDBConnection = tmp
end function
function OHGetConnectionString()
OHGetConnectionString = "DSN=<server>;UID=<username>;PWD=<password>"
end function
dim dbConn, objSession, xmlDoc, postObj, postURL
set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
set postObj = Server.CreateObject("Microsoft.XMLHTTP")
set dbConn = GetDBConnection()
'URL to post XML data to
postURL = "https://www2.theirserver.com/dataexchange/
xmlclientdataimport.asp?uid=<username>&pwd=<passwo rd>"
dim sql, rs, returnHTML
set rs = server.createobject("ADODB.Recordset")
'Data extraction could be from a VIEW with the name of the basetable
we look for
sql = "SELECT * FROM ourdatatable"
rs.Open sql, dbConn, 3, 3
rs.save xmlDoc, 1
rs.close
postObj.open "POST", postURL, false
postObj.send xmlDoc.xml
set rs = nothing
returnHTML = postObj.responseText
'check results to see if STATUS=OK
response.write returnHTML
set postObj = nothing
%>