Hi ,
I am trying to conusme the Sharepoint lists webservice (UpdateListItems) method in order to update a record in a sharepoint list.
I have imported the shemas and ports from the web service and created an orchestration that sends the update message to Sharepoint. the message being sent to Sharepoint is
<ns0:UpdateListItems xmlns:ns0="http://schemas.microsoft.com/sharepoint/soap/" xmlns:imp="http://microsoft.com/wsdl/types/"> <ns0:listName>{5DBC7621-F371-432D-A890-C5803D1A90AA}</ns0:listName><ns0:updates><Batch OnError="Continue" ListVersion="1" ViewName=""><Method ID="1" Cmd="Update"><Field Name="ID">1</Field><Field Name="Title">I1</Field><Field Name="Item1">I2</Field><Field Name="Item2">I3</Field><Field Name="Item3">I4</Field></Method></Batch></ns0:updates></ns0:UpdateListItems>
The sharepoint list contains the fields as mentioned in the message.
In response to this message, the Sharepoint web service gives me this fault message
<soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Exception from HRESULT: 0x80131904</errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x80131904</errorcode></detail></soap:Fault>
All I can figure out from here is that there is an inner error in Sharepoint server.Also if I cosume the same web service method from a C# console application, (using UpdateListItems) then the sharepoint list gets updated. The code for which is :
namespace CallSHPWebSvcConsole{ class Program { static void Main(string[] args) { helium_shpList.Lists shpList = new helium_shpList.Lists();
shpList.Credentials = System.Net.CredentialCache.DefaultCredentials; shpList.Url = "http://helium:3535/_vti_bin/lists.asmx";
System.Xml.XmlNode ndListView = shpList.GetListAndView("Manish", ""); string strListID = ndListView.ChildNodes[0].Attributes["Name"].Value; string strViewID = ndListView.ChildNodes[1].Attributes["Name"].Value;
System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); System.Xml.XmlElement batchElement = doc.CreateElement("Batch"); batchElement.SetAttribute("OnError", "Continue"); batchElement.SetAttribute("ListVersion", "1"); batchElement.SetAttribute("ViewName", "");
batchElement.InnerXml = "<Method ID='1' Cmd='Update'>" + "<Field Name='ID'>1</Field>" + "<Field Name='Title'>MPHJ</Field>" + "<Field Name='Item1'>IUYU</Field>" + "<Field Name='Item2'>098i</Field>" + "<Field Name='Item3'>loi89</Field></Method>"; try { shpList.UpdateListItems(strListID, batchElement); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } Console.ReadLine();
} }}
Can anyone please throw some light on this
Found a solution for this? I have the same problem.
0x80131904 indicates authentication problem
The service account under which the send port runs must be at least a contributor in SharePoint. If not, then it can't write.
Brad
This is your SP List Error, mean it is coming while updating your SP List . I guess becasue this error is coming in SP.