Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Http Post to AddList() in Sharepoint
    primarykey
    data
    text
    <p>On a remote client, I'm trying to create a new list in a sharepoint site. Right now, I'm building a CAML string and sending it via http post to my sharepoint site. I've used this method to update list items and create dws folders, but I can't seem to get AddList to work. I get an error "Remove server returned error:NotFound."</p> <p>here is my CAML:</p> <pre><code> string soapEnv = "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;" + "&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;AddList xmlns=\"http://schemas.microsoft.com/sharepoint/soap\"&gt;" + "&lt;listName&gt;" + listName + "&lt;/listName&gt;" + "&lt;description&gt;" + "A Test list" + "&lt;/description&gt;" + "&lt;templateID&gt;100&lt;/templateID&gt;" + "&lt;/AddList&gt;" + "&lt;/soap:Body&gt;" + "&lt;/soap:Envelope&gt;"; return soapEnv; </code></pre> <p>I send this in an http Post with these settings:</p> <pre><code> uri = "[my sharepoint site]/_vti_bin/lists.asmx"; WebClient client = new WebClient(); client.Headers["SOAPAction"] = "http://schemas.microsoft.com/sharepoint/soap/"; client.Headers["content-type"] = "text/xml; charset=utf-8"; client.Encoding = Encoding.UTF8; client.UploadStringCompleted += UploadStringCompleted; try { client.UploadStringAsync(new Uri(uri, UriKind.Absolute), "POST", CAML); } catch (Exception ex) { MessageBox.Show("Error in upload string async: " + ex.Message); } </code></pre> <p>Any ideas? I'm pretty certain it's not an authentication issue since I've used the exact same method in this same program to do the previously mentioned functions. The sharepoint site I'm adding the list to is a test site in which I have full read/write capabilities.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload