views:

2396

answers:

3

I am writing both sides of an asp-webpage to asp-webpage conversation in which the originating webpage pushs information to the receiving webpage which then processes it and sends back a response. The originating webpage must use the code below to start the converstation...

url = "www.receivingwebsite.com\asp\receivingwebpage.asp"
information = "UserName=Colt&PassWord=Taylor&Data=100"
Set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "text/xml"
xmlhttp.send information

...and then somehow the asp code in the receiving page has to be able to see the information that was sent. I have tried everything I can think of. The information is not in the request object's querystring or form arrays (because the content-type is text/xml) and I've tried passing the entire request object to a domdocument via its load and/or loadxml methods. No matter what I do, I can't find the information but I know that it is being sent because when I change the content-type to "application/x-www-form-urlencoded", I can see it in request.form array.

So where is my information when the content-type is "text/xml"?

Thanks in advance for any assistance! Peace, Colt Taylor

+3  A: 

When you set the content-type to "text/xml" you really need to send the information as an XML string, not a name-value list.

url = "www.receivingwebsite.com\asp\receivingwebpage.asp"
information = "<Send><UserName>Colt</UserName><PassWord>Taylor</PassWord><Data>100</Data></Send>"
Set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "text/xml" 
xmlhttp.send information

Then, in your receiving ASP page, you would then capture the XML as follows:

Dim xmlDoc
Dim userName
set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load(Request)
userName = xmlDoc.documentElement.selectSingleNode("UserName").firstChild.nodeValue
Tim C
A: 

Thanks for the quick reply. You nailed it! In the absence of properly formatted xml, my sending routine was sending nothing but I was blaming my receiving routine. You've been a tremendous help! Thanks!!!
Colt.

A: 

I just marked your answer as "accepted". Hope that somehow helps your reputation on this site. You really have helped!
Colt

Please use "add comment" to respond to specific answers.
AnthonyWJones