posting XML data to a webserver from VB 
Author Message
 posting XML data to a webserver from VB

I need to post an XML file to a webserver.  The xml file will be in the same
folder as my VB application.  How do I do this???  I am trying to use the
InternetExplorer control Navigate2 function but it is only doing a GET even
if I include some PostData.

Help PLEASE !!!!!

Thanks.

Emad



Sun, 25 Jul 2004 01:52:19 GMT  
 posting XML data to a webserver from VB
MSKB article:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q174923

Max Bolingbroke

Quote:
> I need to post an XML file to a webserver.  The xml file will be in the
same
> folder as my VB application.  How do I do this???  I am trying to use the
> InternetExplorer control Navigate2 function but it is only doing a GET
even
> if I include some PostData.

> Help PLEASE !!!!!

> Thanks.

> Emad



Sun, 25 Jul 2004 02:29:05 GMT  
 posting XML data to a webserver from VB
Hi Emad,

Do the following

from VB app, reference Microsoft XML Parser (msxml.dll) or later.

then from code (assume xml file is c:\temp\data.xml)

Dim HTTP_Request As New MSXML.XMLHTTPRequest 'remember to set to nothing
when finished
Dim xmlData as New MSXML.DOMDocument   'remember to set to nothing when
finished
Dim sMessage as String
...
'Load your XML file into an xml dom
xmlData.Load "c:\temp\data.xml"   'might be xmlData.LoadXML ...
If xmlData.parseError.reason = 0 Then
    sMessage = xmlData.xml
Else
    Msgbox "Error"
    Exit sub
End If

...
HTTP_Request.open "POST", http://yourservername/youraspfile.asp, False
HTTP_Request.send sMessage
DoEvents
lCounter = 0
Do While HTTP_Request.readyState <> 4
    lCounter = lCounter + 1
    DoEvents
    If  lCounter > 100000 Then
        MsgBox "Could not contact the server!", vbExclamation, App.Title
        Exit Do
    End If
Loop
msgbox  HTTP_Request.responseText  'response from ASP file maybe with
response.write



Mon, 26 Jul 2004 16:42:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. posting XML data to a webserver from VB

2. posting XML data to a webserver from VB

3. Is Possible?: VB.EXE get it's data Database on Webserver

4. how to url encode a binary file for posting to webserver

5. How can I post messages at webserver?

6. Problem posting xml from vb.net client to asp classic page

7. Post XML from within VB...

8. VB POST XML

9. checking for xml tag/xml data???

10. newcomer: accessing data file on the webserver

11. How to access the XML data in VB

12. Accessing XML data via ADO in VB.Net

 

 
Powered by phpBB® Forum Software