Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

XMLHTTP in VBA>>>

Posted on 2004-08-30
4
Medium Priority
?
1,699 Views
Last Modified: 2006-11-17
Hi..

I want to send the XML file as object to server(ASP) from Excel VBA..when I send xml file with size of 32K its working..I got response too..
but when I send the XML file as object with size of 2-5MB..I got the Error:

error : metod 'send' of  object 'IXMLHTTPREQUEST' failed


How TO I SEND the 2-5 MB xml file as object?

My Code in vba :
*******
'oxml.Load "c:\InputFinal.xml" ' 2.5 MB File
oxml.Load "c:\new.xml"        ' 89k file

'url = "XMLFILE=" & oxml.xml

With oXMLHttp
    .Open "POST", "http://localhost/projects/ASP Page2.asp", False
    .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    .send oxml
End With

' Write the response from my server.
 MsgBox oXMLHttp.Status
 MsgBox oXMLHttp.statusText
 MsgBox oXMLHttp.responseText
 'MsgBox oXMLHttp.responseStream

IN ASP CODE :
**********
Dim objxml       
set objxml = server.createObject("MSXML2.DOMDocument")
      
strTemp = Request("XMLFILE")
objxml.load (strTemp)      
objxml.save ("c:\test.xml")      

thanks and regards
Thanigaivelan P S
0
Comment
Question by:ps_velan
1 Comment
 
LVL 4

Accepted Solution

by:
divt earned 2000 total points
ID: 11984040
I suspect the problem comes from the time it takes to transfer the large file.
Microsoft has published this good article:

Time-Outs in XMLHTTP, and Controls with a View
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/askgui05012001.asp

They suggest using ServerXMLHTTP instead of XMLHTTP.  See this FAQ for complete details:

Frequently asked questions about ServerXMLHTTP
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q290/7/61.asp&NoWebContent=1

Alternatively, you may want to look WinHTTP which accept time-out settings, and should also fit in your code:
http://msdn.microsoft.com/library/en-us/winhttp/http/about_winhttp.asp

See sample usage for WinHTTP here:
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21119195.html
Good luck.


0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

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