<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Howdy All - I had to write up some info on my Sharepoint interaction
with Perl for my customer - so thought this might come in handy for
some of you as well...<br>
<br>
Please let me know if you have any questions - Thanks...<br>
<br>
<br>
Bill Hess<br>
Technology Resource Group<br>
<br>
Office:&nbsp; 248.546.6900 x12<br>
Fax:&nbsp;&nbsp;&nbsp;&nbsp; 248.546.7310<br>
Mobile: 248.703.1196<br>
<br>
<br>
<br>
<br>
Here is some info on using CURL (<a class="moz-txt-link-freetext"
 href="http://curl.haxx.se/">http://curl.haxx.se/</a>) to
upload files to a SP Document Library.&nbsp; CURL is a command line tool
that supports a bunch of file transfer protocols - namely HTTP/HTTPS in
this case.&nbsp;&nbsp; The reason this works is because SP supports WebDAV&nbsp; by
default:<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.webdav.org/">http://www.webdav.org/</a><br>
<a class="moz-txt-link-freetext"
 href="http://en.wikipedia.org/wiki/WebDAV">http://en.wikipedia.org/wiki/WebDAV</a><br>
<br>
Microsoft calls WebDAV - "Web Folders" - which you may have heard of
before...<br>
<br>
Using CURL is simple once you have a copy of it - it is included with
all Linux distros that I know of - we are using CentOS 5.3 - which is
really Redhat Enterprise Linux (RHEL) 5.3<br>
There are pre-built versions of CURL on <a
 class="moz-txt-link-freetext" href="http://curl.haxx.se/">http://curl.haxx.se/</a>
for pretty
much any OS you can think of...<br>
<br>
<br>
curl --ntlm -u DOMAIN/USERID:PASSWORD -T FILE&nbsp;
<a class="moz-txt-link-freetext"
 href="https://sharepoint_server_hostname/sites/it_sharepoint/demo/M1%20Test%20%20Crimp%20Spec/">https://sharepoint_server_hostname/sites/it_sharepoint/demo/M1%20Test%20%20Crimp%20Spec/</a><br>
<ul>
  <li>--ntlm tells CURL to use MS authentication</li>
  <li>DOMAIN/USER:PASSWORD is the MS user to use to login to SP<br>
Typically on Windows you would use a backslash \ - but on the UNIX cmd
line this is the escape char - so we use the front slash /&nbsp;&nbsp; -&nbsp;&nbsp; not
sure which to use if running on CURL on Windows - but you have a 50/50
shot to get it right...</li>
  <li>FILE is the path/name of the local file you want to upload</li>
  <li>And the URL is the SP URL - you can get this by just going to the
SP site in your web browser and copy/paste the URL - note the %20 is
used for each single spaces.</li>
  <ul>
    <li>Actually - the first test site I created I named "M1 Test -
Crimp Spec" and SP decided to not use the '-' in the URL but kept each
space on either side of the '-'.&nbsp;&nbsp; So if you have a SP site that has
wacky chars in it - pay close attention to the URL...<br>
    </li>
    <li>I also figured out if the SP site is renamed - its URL stays
the same - so if I renamed my site to "Purple Brick"&nbsp;&nbsp;&nbsp; the URL will
stay the same...</li>
    <li>IMPORTANT - also note the last front slash '/'&nbsp;&nbsp;&nbsp; - I pulled my
hair out for a few hours before I got lucky and tried it with this and
it worked.&nbsp;&nbsp; I have also seen this trailing front slash issue with
other WebDAV servers that I have worked with in the past...<br>
    </li>
  </ul>
</ul>
<br>
<br>
To see the SOAP methods available to you - you should be able to use
your web browser by entering an equivalent URL for your SP site:<br>
<br>
<a class="moz-txt-link-freetext"
 href="https://your_sharepoint_host/sites/demo/_vti_bin/Lists.asmx">https://your_sharepoint_host/sites/demo/_vti_bin/Lists.asmx</a><br>
<br>
This will show you the Methods to use working with SP Lists<br>
<br>
The attached Perl programs are:<br>
<ul>
  <li>soap21.pl - Walk thru a SP site and dump pretty much everything
we can get - I used this as a test/reverse engr/debugging early on...</li>
  <li>soap4.pl - Updates some attrs on a single item</li>
  <ul>
    <li>Need to construct some simple XML which is passed in the SOAP
call - the XML says which attrs to change and the new values to use<br>
    </li>
  </ul>
  <li>soap5.pl - Query a list for an Item</li>
  <ul>
    <li>Need to construct XML for the Query<br>
    </li>
  </ul>
  <li>soap6.pl - Query for a SP subfolder</li>
</ul>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>