SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In 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."

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.

here is my CAML:

    string soapEnv =
    "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
    "<soap:Envelope " + "xmlns:xsi=\""+
    "xmlns:xsd=\"\"" +
    " xmlns:soap=\"\">"+
    "<soap:Body>" +
    "<AddList xmlns=\"\">"+
        "<listName>" + listName + "</listName>" +
        "<description>" + "A Test list" + "</description>" +
        "<templateID>100</templateID>" +
    "</AddList>" +
    "</soap:Body>" +
    return soapEnv;

I send this in an http Post with these settings:

    uri = "[my sharepoint site]/_vti_bin/lists.asmx";
    WebClient client = new WebClient();
    client.Headers["SOAPAction"] = "";
    client.Headers["content-type"] = "text/xml; charset=utf-8";
    client.Encoding = Encoding.UTF8;
    client.UploadStringCompleted += UploadStringCompleted;
        client.UploadStringAsync(new Uri(uri, UriKind.Absolute), "POST", CAML);
    catch (Exception ex)
        MessageBox.Show("Error in upload string async: " + ex.Message);
share|improve this question
Forgot to add this is a Silverlight app!! – Anonymous Mar 4 '10 at 18:48
@pclem: Feel free to edit your question with any extra info you'd like to provide. Welcome to SharePoint Overflow! :-) – Alex Angas Mar 4 '10 at 22:41
Are you using Visual Studio? – Charles Lee Mar 9 '10 at 13:32
up vote 0 down vote accepted

I was missing a quotation mark in the soap header...go figure. The end of the first line is missing \" before the quotation mark to close the open quote on xmlns:xsi

<soap:Envelope " + "xmlns:xsi=\""+
"xmlns:xsd=\"\"" +
" xmlns:soap=\"\">"+
share|improve this answer
That's why I never use strings to build Xml documents. I prefer using XDocument/XElement/XAttribute – Wictor Wilen MCA MCM MVP Mar 11 '10 at 15:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.