views:

3924

answers:

3

I'm creating some big files (DB exports) with Java and I need to put them somewhere on our SharePoint server. Right now, I'm doing this with IE but I'd like to automate this step, too.

I searched the web and I found some hints to use SOAP but I don't really see to the ground of all this, yet. Can someone provide me with some sample code or a recipe what I need to do?

Please note: the SharePoint server asks for NT domain authentication. I can't even login with Firefox :(

EDIT

  • How do I convert the scary URL in IE into a WebDAV path?
  • Is there a WebDAV "explorer" which I can use before I ruin the production system with my code? I tried "DAV Explorer 0.91" from http://www.davexplorer.org/ but that can't connect (probably because of NT domain auth).
A: 

I can think of different options:

  • Mapping the Document library to a file drive and just save the file like any other file in the file system.
  • Using HTTP WebDAV protocol.

...and for the NTLM authentication part:

http://www.luigidragone.com/networking/ntlm.html

Sacha
+1  A: 

In addition to Sacha's suggestions, you can use the SharePoint SOAP web services. Each SharePoint site exposes a bunch of web services via the path http://<Site>/_vti_bin/.

In your case, you probably want the Lists web service (http://<Site>/_vti_bin/Lists.asmx). You can grab the WSDL from http://<Site>/_vti_bin/Lists.asmx?WSDL. The WSS 3.0 SDK has details on how to use the web service (you'll probably want to use the UpdateListItems and AddAttachment methods).

All that said, Sacha's first option (mapping a document library to a drive) is probably the easiest way assuming you can get around the NTLM issues.

If you're using Windows you can simply navigate to a UNC path for a document library. For example, if the browser URL for your document library is:

http://<Site>/Foo/BarDocs/Forms/AllItems.aspx

you can simply type the corresponding UNC path in the Windows Explorer address bar:

\\<Site>\Foo\BarDocs

and then drag and drop files to this location. If you'd like you can map this location to a drive letter using Windows Explorer or the SUBST.EXE command-line utility.

dariom
UNC doesn't work; since when is that available? I'm on XP and but I have no idea which version of SP is in use.
Aaron Digulla
The WSDL download works but there is no version info either :/
Aaron Digulla
A: 

Okay ... after several hours of work and biting myself through the "documentation" MicroSoft provides and all the hints randomly spread over the 'net, I've managed to write some sample code to browse the content of a SharePoint server: Navigating SharePoint Folders With Axis2.

Next stop: Uploading something.

Aaron Digulla