Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XML file not saving

From: "Han" <hp4444@------.---.----->
To: NULL
Date: 11/1/2004 10:49:00 AM
I added some comments for each of problematic line,

> Set oXmlHttp = server.CreateObject("Microsoft.XMLHTTP")

-- antique progID, at least msxml2.xmlhttp

> oXmlHttp.open "GET", strurl, False

-- I suspect you want /post/ instead of /get/.

> '//open https connection to the server //
> oXmlHttp.setRequestHeader "Content-type", "text/xml"
> oXmlHttp.send oXMLDocument
>
> '// process the server response//
> iResponseStatus = oXMLHttp.status
> sResponseMsg = oXMLHttp.responseText

-- The last line should be placed on the exception block.

> If iResponseStatus = 200 Then '// success //
>      sResponseXML = oXMLHttp.responseXML.xml
>      'Below uses parser for XML 3.0
>      Set oXMLDoc = Server.CreateObject("MSxml2.domdocument.3.0")
>      oXMLDoc.loadXML(sResponseXML)

-- oxmldoc.load(oxmlhttp.responsebody) is better.

>      If oXMLDoc.hasChildNodes Then

-- if oxmldoc.load(oxmlhttp.responsebody) then

>           'Return drive/path from virtual directory
>           'e.g. /imaging/imghold/ path may be D:\imghold>           strSaveFile = Server.MapPath("/imaging/imghold/")
>           '    Make file name prefix be the userid
>           strSaveFile = strSaveFile & struserid & ".xml"
>           oXMLDoc.Save(strSaveFile)

-- The last line should come after you check the folder to be written. i.e. 
oxmldoc.loadxml("<a/>"): oxmldoc.save strSaveFile

>      End If


> Else
>    ...
> End If
>
>  Set xmlDoc = Server.CreateObject("Microsoft.xmldom")

-- antique progID. At least, msxml2.domdocument may get you msxml3.0.

>
>  xmlDoc.async = False
>  xmlDoc.load(strSaveFile)
> ...
>
> 



transparent
Print
Mail
Like It
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