Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm developing a MS Office 2010 Excel AddIn from a client machine which doesn't have SharePoint installed in it. I imported a Lists web service reference from a remote SharePoint server. I developed a wpf user control which can load data from the list and show it in the excel worksheet. It works perfectly. Then I extend my client application to update list items in the server. So I tried to update list items in the server with UpdateListItems method using the web service reference.

But it failed with an exception "Soap Server Exception.". I can't figure out what's wrong here as I can import data without any problem. Following is my code block.

SPListsWS.Lists myListUpdateProxy = new SPListsWS.Lists();
            myListUpdateProxy.Credentials = CredentialCache.DefaultCredentials;
            myListUpdateProxy.Url = "http://uvo1y1focm66gonf7gw.env.cloudshare.com/_vti_bin/Lists.asmx";

            XmlNode listView = myListUpdateProxy.GetListAndView("Products", "");

            string listID = listView.ChildNodes[0].Attributes["Name"].Value;
            string viewID = listView.ChildNodes[1].Attributes["Name"].Value;

            XmlDocument Xdoc = new XmlDocument();
            XmlElement updateElement = Xdoc.CreateElement("updateElement");
            updateElement.SetAttribute("OnError", "Continue");
            updateElement.SetAttribute("ListVersion", "1");
            updateElement.SetAttribute("ViewName", viewID);

            updateElement.InnerXml = "<Method ID='1' Cmd='Update'>"
                                      + "<Field Name = 'ID'>" + index + "</Field>"
                                      + "<Field Name = 'Title'>" + prodTitle + "</Field>"
                                      + "<Field Name = 'Product_SKU'>" + prodSKU + "</Field>"
                                      + "<Field Name = 'Product_Price'>" + prodPrice + "</Field>"
                                      + "</Method>";

            XmlNode responseXml = myListUpdateProxy.UpdateListItems("Products", updateElement);
            MessageBox.Show(responseXml.OuterXml);
share|improve this question
    
Don't you get any error codes? If not, can you inspect the traffic sent and received by the server? –  golimar Oct 3 '13 at 16:18
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.