Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp/xml question 1

Status
Not open for further replies.

bbolte

Programmer
Joined
Sep 30, 2002
Messages
113
Location
US
here is a little test that i rigged up. both of these files are on my machine. but i can't seem to get them to talk. i've had this stuff working before but can't seem to figure out why it won't this time.

calling page code:

sendXML = &quot;<?xml version=&quot;&quot;1.0&quot;&quot; encoding=&quot;&quot;ISO8859-1&quot;&quot; ?>&quot; & vbCrLf
sendXML = sendXML & &quot;<user>&quot; & vbCrLf
sendXML = sendXML & &quot;<name>Bill</name>&quot; & vbCrLf
sendXML = sendXML & &quot;</user>&quot;

webServiceUrl = &quot;Set httpReq = Server.CreateObject(&quot;MSXML2.ServerXMLHTTP&quot;)
Set myXmlDoc = Server.CreateObject(&quot;MSXML.DOMDocument&quot;)
httpReq.Open &quot;post&quot;, webServiceUrl, False
httpReq.setRequestHeader &quot;Content-Type&quot;, &quot;text/xml&quot;
httpReq.Send sendXML

dim didLoadXML
returnXML = httpReq.responseText
Set httpReq=Nothing
didLoadXML = myXmlDoc.loadXML(returnXML)

If didLoadXML Then
MyResponse = &quot;Good&quot;
Else
MyResponse = &quot;Bad&quot;
End If

Response.Write(&quot;<h1>&quot; & MyResponse & &quot;</h1>&quot;)


receiving page code(xmltest2.asp):

set xmldoc = Server.CreateObject(&quot;Msxml2.DOMDocument&quot;)
xmldoc.async = false
didLoadXML=xmldoc.load(Request)
Set xmlDoc = Nothing

If didLoadXML Then
Result = &quot;Yes&quot;
Else
Result = &quot;No&quot;
End If

'// write the response out for sign
strResultXML = &quot;<?xml version=&quot;&quot;1.0&quot;&quot;?>&quot;
strResultXML = strResultXML & &quot;<MyResult>&quot;
strResultXML = strResultXML & &quot;<answer>&quot; & Result & &quot;</answer>&quot;
strResultXML = strResultXML & &quot;</MyResult>&quot;

Response.Write strResultXML


can't figure out what's wrong...
 
It works fine for me, try Response.Writing returnXMl after the Response.Write(&quot;<h1>&quot; & MyResponse & &quot;</h1>&quot;) line. That will show you what error is being pased back by the remote page. It could be that it isn't finding the location and in that case you'll get back Bad in your H1 then after that you'll get the std 404 screen.
Or you might have some sort of other error. The error screen you get back should give you a hint as to where to go from here to find the error.

If your not getting a No but instead are getting some sort of err, double-check that you have MSXML2 installed on the server. I generally am lazy when I need it and use Microsoft.XMLHTTP even though it is supposedly not a good idea to use tat (can't remember if it is just older and buggy or older and a security issue).

-T


01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
hmmm. interesting. i get the &quot;You are not authorized to view this page&quot; error. why would that be?
 
Errr...dunno. Do you have user authentication turned on in IIS?

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
no, that's what i'm looking at right now. i hate dealing with permissions...
 
once the permission settings were corrected, this code worked. thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top