Solved

ecmascript reading xml from a remote server

Posted on 2004-08-04
10
274 Views
Last Modified: 2006-11-17
Hi,

For a voice-xml application I need to check the validity of user input. The voice system runs on a third party server and uses ECMAscript 262. I want to do a get/post to my own server (e.g. http://myserver/vxmlservice?input="1") which then checks the input and replies with true or false or a list of possible options (in xml format). How can I send the request and read the reply (in xml) with ECMAscript?

Many thanks in advance,

Adje
0
Comment
Question by:adje_
  • 5
  • 3
10 Comments
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
With a hidden IFRAME you can call that server and read the response in the iframe onLoad event.
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
But the biggest problem in that approach is that both servers, the one who provides the parent page and the other whith the iframe url, both need to be in the same internet domain.
Otherwise there is a security restriuction to acces foreign domains.
That security restriction is removed when the main page is loaded localy with a file name extensio .hta



0
 

Author Comment

by:adje_
Comment Utility
The application is not a webbrowser. Is there an iframe object or some other object to instantiate, so I can make the request in ecmascript.

For instance,

myXml = new XML();
myXml.url = "http://myServer/..";
myXml.onLoad = function;
myXml.load();
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
Do you know HTA?
It stands for HyperTextApplication.

And for XML you use:
    var zipcode = "20166";
    var theURL = "http://mycontent.aol.com/widgets/weather/weather.psp?pid=bc&key=xiebie&format=xml&zipcode=" + zipcode;
    var httpReq = new ActiveXObject("Microsoft.XMLHTTP");
    httpReq.Open('GET',theURL,false);
    httpReq.Send();
   
    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.loadXML(httpReq.responseText);
    alert(httpReq.responseText);    
     
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:adje_
Comment Utility
Unfortunately, HTA as well as those nice ActiveX objects are not supported by the voice interpreter. Is there no crude old fashioned way. Like reading Http streams and put them in an object??
0
 
LVL 63

Expert Comment

by:Zvonko
Comment Utility
If your voice interpreter can execute JavaScript, then where is the problem to create ActiveX objects?
0
 

Author Comment

by:adje_
Comment Utility
Well, they say they support ecmascript and they do not run on a windows platform
0
 
LVL 63

Accepted Solution

by:
Zvonko earned 125 total points
Comment Utility
Ahh, ok see.
Buth then you need some other script engines. First idea would be Perl. They have packages for opening html streams.
Also php, but I do not know wether Perl nor PHP is ecma conform.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now