Error when calling web service - UpdateListItems


  • Hi,

    I try to use web service http://shkvm19e/_vti_bin/Lists.asmx from InfoPath
    as follow:

    Lists.Lists listService = new Lists.Lists();
    listService.Credentials =
    new NetworkCredential(
    listService.PreAuthenticate = true;
    string strBatch =
    + "<Field Name='ID'>2</Field>"
    + "<Field Name='Title'>New Title</Field></Method>";
    XmlDocument xmlDoc = new System.Xml.XmlDocument();
    System.Xml.XmlElement elBatch = xmlDoc.CreateElement("Batch");
    elBatch.SetAttribute("OnError", "Continue");
    elBatch.SetAttribute("ViewName", "{621AD0C9-57A2-40B9-9620-098AD800FD3A}");
    elBatch.InnerXml = strBatch;
    XmlNode ndReturn =

    Unfortunately, the result is

    <Results xmlns="">
     <Result ID="1,Update"><ErrorCode>0x81020026</ErrorCode><ErrorText>The list that is
    referenced here no longer exists.</ErrorText>........</Results>

    But, I'm able to get the XML result by calling "GetList" function:

    XmlNode ndReturn =

    Can anybody know why I got "The list that is referenced here no longer
    exists." from "UpdateListLists" functions?


    It's the same problem reported here without any answer.

    Wednesday, March 23, 2011 7:35 PM

All replies

  • Hi,

    It seems like you are not specifying a command i.e. update command in the caml query.

    Try using below code.

    string strBatch = "<Method ID='1' Cmd='Update'><Field Name='ID'>2</Field><Field Name='Title'>New Title</Field></Method>";

     Hope this helps.
    My Blogs: Follow Me :
    Thursday, March 24, 2011 6:43 AM
  • Actually i have a slight diferent code than that above, and in mine it generates the XML as this:

    <Batch OnError="Continue" ListVersion="1">
      <Method ID="1" Cmd="New">
       <Field Name='ID'>New</Field>
       <Field Name="Title">Value</Field>

    And it results in the same error. What I concluded is that there is a bug. Because if i use the same code on a different list it works perfecly. It only returns this error on a BDC populated list. I took care to ensure that every operation was implemented on that data source.

    It works on the front end to insert/delete data on that list. But only in the webservice it keeps getting this errors.

    Thursday, March 24, 2011 11:51 AM