andy18
06-05-2003, 05:04 PM
Hi,
When we try to get data from outside server using POST METHOD WITH THE XML Parser, it is not working.
However, it is working if we try to get the data by GET Method.
Below is the code :
msxml4.dll error '80070005'
Access is denied.
/testhttp.asp, line 5
Andy
Rich2k
06-05-2003, 05:48 PM
Normally with XML parsers you can only query local data.
What I mean by that is you either cache it by downloading it locally first and reading it from their or you read the XML data into a string first and parse it that way. (SOAP is a bit different as web services are meant to be remote)
This is certainly true for Sablotron when using XSLT in PHP... I don't know about ms xml as I've only ever used it locally.
WineIsGood
06-05-2003, 07:20 PM
It works the same way, except that you load the XML by using the load() method and pass the entire Request object:
objXML.load(Request)
Of course, make sure the IUSR_{webserver} account has the appropriate rights to the directory you're using.
HTH,
-Dave
andy18
06-05-2003, 08:03 PM
Hi,
Below is the coding :
<%
dim TestRequest
Set TestRequest = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
TestRequest.open "POST","http://www.yahoo.com",false
TestRequest.send "HI"
Response.Write "RECEIVED FROM XMLHTTP:<HR>" & TestRequest.responseText
%>
Any error on the above codes?
Andy
Rich2k
06-06-2003, 04:40 AM
It looks like you are trying to use some form of Webservices (as this is usually the reason of sending an XML request to a server), now if Yahoo isn't looking for a web service request, it will just ignore it.
WineIsGood
06-06-2003, 08:09 AM
I think you might be a bit confused here... you can only post to a page that's expecting it. First, what is the page in yahoo.com which accepts your commands? Is it yahoo.com/getxml.asp or something like that? Second, what is the xml you're trying to send? Just sending HI isn't a well formatted command. Last, is the page which accepts your commands responding to them? As the other poster wrote, you might be getting confused between sending and receiving xml commands, and using a web service, both of which are very different.
I suggest you create two pages yourself on your server, call them: sendxml.asp and receivexml.asp. In sendxml.asp, do what you're doing in this example, however name the receivexml.asp page in your Open method call. Next, make sure to send a well-formed xml command such as: <command>hi</command> and make sure it has the appropriate xml header. Then, create the receivexml.asp page with the code I suggested above: objXml.load(Request), then respond to the page by echo-ing back the request string with response.write(Request) or something similar. Then, make sure to response.write the response in your calling page, sendxml.asp. You should be able to see the whole process flow this way: send, receive, response.
HTH,
-Dave