|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have a directory which contains some XML files. These XML files need to be posted to a webservice. The code I have now is a simple HTML page with a Javascript function which uploads the file. What I want to do is write an application which finds all the XML files in that directory and then post these files to the webservice. After posting successfully, it will then read the response and if successful it will move these XML files to an archive directory. Is it possible using a C# windows application to do this. The code I have is: function SendRS.onclick() { var xmlstream = new ActiveXObject("ADODB.Stream"); var mypath = filename.value; var myport = portname.value; xmlstream.Mode = 3; xmlstream.Open(); xmlstream.Type = 1; xmlstream.LoadFromFile(mypath); divOutputRequest.innerText = xmlstream.Size; var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); xmlhttp.Open("POST",myport,false); xmlhttp.setRequestHeader("Content-Length",xmlstream.Size); xmlhttp.setRequestHeader("Content-Type","text/xml"); xmlhttp.send(xmlstream.Read(xmlstream.Size)); divOutputResponse.innerText = xmlhttp.responseText; } Can anybody share his experience. Thanks, Ranjan.
__________________
Ranjan Kumar |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Xmlhttp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|