Hi Guys

 

I need to update a list item using lists.asmx web service. I have no
problem getting the list items  and binding it to a dataview. All sweet.

 

I not sure why I getting a SOAP exception  when I try to update one of
the items in the list using the UpdateListItems method.

 

The exception has the InnerText value as "Attribute ID or Cmd of element
Method in parameter updates is missing or invalid".

 

Any suggestion would be appreciated.

 

My test code:

 

            string strList = "{64A9CEC3-7102-45E7-9405-9C16E2DE1964}";

 

            BlueScope.SPGroups.UI.ws_lists.Lists ws = new
BlueScope.SPGroups.UI.ws_lists.Lists();

            ws.Url = "....." + "/_vti_bin/Lists.asmx";

            ws.Credentials = GetNetworkCredential();  // Creates
Credential obj with user details.

            XmlDocument xmlDoc = new System.Xml.XmlDocument();

            XmlElement batchElement = xmlDoc.CreateElement("Batch");

 

string strBatch = "<Method id='1' Cmd='Update'><Field
Name='ID'>94</Field><Field Name='Title'>Asset Cognos Reports*** Test
Title Added***</Field></Method>";

 

            batchElement.InnerXml = strBatch;

            ws.UpdateListItems(strList, batchElement);

 

 

Regards,
Steven Bozinovski
e-Services Applications
BlueScope Steel
(02) 4275 7812 or 0418 966 927
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 

 

FYI:

 

System.Web.Services.Protocols.SoapException was unhandled by user code

  Message="Exception of type
'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown."

  Source="System.Web.Services"

  Actor=""

  Lang=""

  Node=""

  Role=""

  StackTrace:

       at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapCl
ientMessage message, WebResponse response, Stream responseStream,
Boolean asyncCall)

       at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)

       at BlueScope.SPGroups.UI.ws_lists.Lists.UpdateListItems(String
listName, XmlNode updates) in C:\Projects\eServices\SPGroups\UI\Web
References\ws_lists\Reference.cs:line 554

       at BlueScope.SPGroups.UI.SpTest.Button2_Click(Object sender,
EventArgs e) in C:\Projects\eServices\SPGroups\UI\SpTest.aspx.cs:line 74

       at System.Web.UI.WebControls.Button.OnClick(EventArgs e)

       at System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument)

       at
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.Rai
sePostBackEvent(String eventArgument)

       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)

       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData)

       at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

  InnerException:





NOTICE - This message and any attached files may contain information that is 
confidential and intended only for use by the intended recipient. If you are 
not the intended recipient or the person responsible for delivering the message 
to the intended recipient, be advised that you have received this message in 
error and that any dissemination, copying or use of this message or attachment 
is strictly forbidden, as is the disclosure of the information therein. If you 
have received this message in error please notify the sender immediately and 
delete the message.



------------------------------------------------------------------- OzMOSS.com 
- to unsubscribe from this list, send a message back to the list with 
'unsubscribe' as the subject.

Powered by mailenable.com

Reply via email to