Sign in to follow this  
Followers 0
mburr

Cannot read stream from an XML response

4 posts in this topic

I am working on a program that is collecting user information and creating an html file from these files and then launching these in an unattended IE session using the _IECreate command in AutoIT. The response from this is an automatically generated xml file which is then displayed back on the browser. I am trying to figure out a manner in which I can get the contents of that xml file from the browser so I can parse it for additional information for a secondary response, but the file is not locally cached on the machine or the server and is a generic URL that cannot be loaded by simply entering the URL.

I have tried the Run command and used the $STDIN_CHILD option, as well as the ConsoleRead and ConsoleWrite in hopes of capturing the xml creation, but that did not appear to work as I would only get back the result of 0 or 1.

I am wondering if anyone else has run into this situation and if they had any solutions? I am also working with the developer for the other program to see if they had any suggestions as well.

Share this post


Link to post
Share on other sites



Welcome to the forums mburr.

First off code is a great addition to a pretty good first post. This lets us see what you are doing. If you can't post the full code due to it being 1000 lines long (no one will look at it) or because it contains sensitive information; post a script that can replicate the problem.

If you're using IE and you can get the XML output using that then all you really have to do is get XML into your script for further parsing is use the following function:

_IEDocReadHTML ( ByRef $o_object )

If you still run into troubles post some code we can work with and we'll try give you a hand.

Also why I think of it, make sure you get the full version of SciTE4AutoIt3. This version has more features than the one included with AutoIt and makes for a much more pleasurable developing experience.

Cheers,

Brett

Share this post


Link to post
Share on other sites

Thanks for the response. I looked at the information that you sent and I tried to incorporate the files, but that did not seem to do the trick. I am getting a result, but it is a "0" only. The code is as follows:

$Request=_IECreate($request_file,0,0,0)

$oIE = ("https://resultantxml_file")

$sHTML = _IEDocReadHTML ($oIE)

FileWrite("\\server\E$\Requests\id.txt",$sHTML)

I may just be missing something here.

Thanks,

Matt

Share this post


Link to post
Share on other sites

Normally in IE does it ask you for a password? If so check the remarks for InetGet and the like.

There is no way that code will work :S

Try making something that works on your local machine then move to writing the file on the remote computer.

Cheers,

Brett

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0