title: SAS PROC SOAP to update Sharepoint List
body: <p>I am trying to update a Sharepoint (2007) list using SAS (9.3) via PROC SOAP (SAS is living on a Unix GRID). The sharepoint site has basic authentication enabled (since PROC SOAP cannot authenticate through NTLM). </p>
  
  <p>I can successfully pull data down from the Sharepoint list using the XML Libname engine, but  I cannot issue via PROC SOAP XML data back to the Sharepoint lists web service. Specifically, I am trying to add and update items within the sharepoint list through <code>http://[intranet_site]/sites/IT/_vti_bin/Lists.asmx</code></p>
  
  <p><br>
  SAS LOG Output : </p>
  
  <pre><code>18399  %let RESPONSE=RESPONSE;
  18400  proc soap in=REQUEST
  18401            out=&amp;RESPONSE
  18402            url="http://[intranet_site]/sites/IT/_vti_bin/Lists.asmx"
  18403      webusername="[username]"
  18404      webpassword="[password]"
  18405      webdomain="[domain]"
  18406      SOAPACTION="http://schemas.microsoft.com/sharepoint/soap/UpdateListItems"
  18407            ;
  18408  run;
  
  ERROR: org.springframework.ws.client.WebServiceTransportException: Unauthorized [401]
  </code></pre>
  
  <p>I have confirmed, through SOAPUI, that the XML passing into the Lists.asmx web service is valid (I can actually create and update list items as expected in Sharepoint when manually executing through SOAPUI. </p>
  
  <p>As the error explicitly states, for some reason, the user authentication being fed into the PROC SOAP is not making it into Sharepoint (I have administrative rights in Sharepoint so I should have the correct rights). What is super confusing about this is that I can feed in the same credentials through XML Libname and pull back data just fine...</p>
  
  <p><br>
  <strong>** <em>Questions</em> **</strong></p>
  
  <ol>
  <li>If I am passing in my credentials through PROC SOAP, why am I not able to authenticate to Sharepoint?</li>
  <li>Are there any other work around for passing this XML into Sharepoint (IE: is XML LIBNAME or PROC HTTP able to support this by passing in the XML)?</li>
  <li>Where does the issue lie : in SAS with PROC SOAP (in the way I am invoking the procedure) or with Sharepoint? </li>
  </ol>
  
  <p><br></p>
  
  <p>...just for completeness, example XML being passed into PROC SOAP can be seen posted below (SOAP 1.1 - which should be supported by PROC SOAP): </p>
  
  <pre><code>&lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;soap:Body&gt;
        &lt;UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"&gt;
            &lt;listName&gt;{851DDBB5-1765-444D-9012-0210F006A4AF}&lt;/listName&gt;
            &lt;updates&gt;
            &lt;Batch OnError="Continue" ListVersion="1"&gt;
                &lt;Method ID="1" Cmd="New"&gt;
                    &lt;Field Name='ID'&gt;NEW&lt;/Field&gt;
                    &lt;Field Name='Title'&gt;DUMMY&lt;/Field&gt;
                     [...shortened for space...]
                &lt;/Method&gt;
            &lt;/Batch&gt;
            &lt;/updates&gt;
        &lt;/UpdateListItems&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>