BizTalk 2009 COnsuming sharepoint lists webservice – UpdateListItems

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › BizTalk 2009 COnsuming sharepoint lists webservice – UpdateListItems

Viewing 0 reply threads
  • Author
    Posts
    • #24978

      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/”>&nbsp;
      <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/”&gt;
      <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&gt;
      </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 

       

       

       

       

Viewing 0 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.