Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Query ASP to GET XML via HTTP Post URGENT HELP PLEASE

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 2/2/2005 11:12:00 AM

Aliandro wrote:

> Hi I am really stuck and need some expertise help please.
> I have an XML file:
> <XML>
>  <USER_INFO>
>   <USERNAME>username</USERNAME>
>   <PASSWORD>password%</PASSWORD>
>  </USER_INFO>
>  <SITE_INFO>
>   <SITE_NO>18856</SITE_NO>
>  </SITE_INFO>
> </XML>
> 
> I am trying to use HTTP Post to send the above XML to an ASP page, this is 
> the code I am using to send the XML to the ASP Page.
> <html>
> <head>
> <script type="text/javascript">
> function getPage()
> {
> var objHTTP = new ActiveXObject("Microsoft.XMLHTTP")
> objHTTP.Open('POST','http://websitetoxmlgateway/xmlgateway.asp',false,'username','password%') 
> //gateway where the ASP page is
> objHTTP.Send("http://mywebsite/note.xml") //my xml file

I think the send method wants you to pass in a document itself as an 
object or the XML as a string but what you have simply sends the string 
with the URL. So try
   var xmlDocument = new ActiveXObject('Microsoft.XMLDOM');
   xmlDocument.async = false;
   xmlDocument.load('http://mywebsite/note.xml');
   objHTTP.send(xmlDocument);
for a start but take note that all that synchronous loading might be 
easier for a quick test but in the end you should change to asynchronous 
loading to not block the browser while XML is loaded/parsed respectively 
sent.

In general script in a HTML page loaded via HTTP can only connect back 
to the server the page comes from so I wonder whether those attempts 
simply fail as you are trying to load XML from or POST XML to another 
server.
So it is crucial if you have further problems that you tell us exactly 
how you load that HTML page with the script, is that loaded from the 
local file system (e.g. file: URL)? Then at least you would have a 
chance to connect to different servers.



-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent