The ID attribute is listed as "id" in your example.  Since XML
Attributes are case sensitive, it won't match the expected "ID"
attribute within the SharePoint Lists service.  Check the MSDN doco -
all examples are in uppercase.
 
Hope this helps,
David.

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Bozinovski, Steven
Sent: Tuesday, 25 March 2008 2:01 PM
To: [email protected]
Subject: [OzMOSS] using UpdateListItems with Lists Web Service



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 


This is an email from Fujitsu Australia Limited, ABN 19 001 011 427. It is 
confidential to the ordinary user of the email address to which it was 
addressed and may contain copyright and/or legally privileged information. No 
one else may read, print, store, copy or forward all or any of it or its 
attachments. If you receive this email in error, please return to sender. Thank 
you.
 
If you do not wish to receive commercial email messages from Fujitsu Australia 
Limited, please email [EMAIL PROTECTED]



------------------------------------------------------------------- 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