Discussion:
XMLHttpRequest help needed
(too old to reply)
Lee Newson
2005-04-28 13:58:34 UTC
Permalink
Hi,

I am writing an application where i get an xml file from a sharepoint
document library. to do this i am using the following code -

Dim HttpReq As New MSXML2.XMLHTTP50

HttpReq.open("GET",
"http://server/sites/sitename/shared%20documents/Visio%20Timeline/timeline%20profiles.xml",
False)

HttpReq.send()

this works great, however the application then makes changes to this xml
that needs to be saved back. i have looked at a number of documents on the
web to work out how to do this but i am still unsure... can anyone help with
this?

I have tried using the DOMDocument.Save() method but i keep getting an error
saying that the network location cannot be found even though i have just
opened it from the same location... in the save method i have tried using
the same as above and also "\\server\sites\sitename\shared documents\Visio
Timeline\timeline profiles.xml"... neither work.


thanks for any help in advance it is greatly appreciated.

regards

Lee
Joe Fawcett
2005-04-29 08:54:11 UTC
Permalink
Post by Lee Newson
Hi,
I am writing an application where i get an xml file from a sharepoint
document library. to do this i am using the following code -
Dim HttpReq As New MSXML2.XMLHTTP50
HttpReq.open("GET",
"http://server/sites/sitename/shared%20documents/Visio%20Timeline/timeline%20profiles.xml",
False)
HttpReq.send()
this works great, however the application then makes changes to this xml
that needs to be saved back. i have looked at a number of documents on the
web to work out how to do this but i am still unsure... can anyone help with
this?
I have tried using the DOMDocument.Save() method but i keep getting an error
saying that the network location cannot be found even though i have just
opened it from the same location... in the save method i have tried using the
same as above and also "\\server\sites\sitename\shared documents\Visio
Timeline\timeline profiles.xml"... neither work.
thanks for any help in advance it is greatly appreciated.
regards
Lee
I have limited experience of SharePoint but normally in this situation I would
use one of three options:

* If the server has a share then use UNC, as you have tried something similar
either it's not a share or the user does not have write access

* Use WebDAV. If the server supports it and I'm sure SharePoint servers do.
Search MSDN for examples on how to save to a WebDAV server using xmlhttp.

* Use a web service or even a simple asp/asp.net page that accepts the xml file
and saves to a specified folder. Needs IIS running on the server but so does
SharePoint I believe.
--
Joe (MVP - XML)

https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5
Loading...