How to Debug Error Creating List Item in SharePoint via UpdateListItems SOAP API?

前端 未结 3 2021
闹比i
闹比i 2021-01-16 10:11

I\'m having a really tough time debugging a SharePoint SOAP call to create a list item. The SOAP body I\'m sending is:



        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-16 10:48

    I had this issue myself.

    This is the code I used and it seems to work:

    batch = Element('Batch').append(Attribute('OnError', 'Return'))
    batch.append(Attribute('ListVersion', '1'))
    
    method = Element('Method').append(Attribute('ID', '1'))
    method.append(Attribute('Cmd', 'Update'))
    
    method.append(Element('Field').append(Attribute('Name', 'ID')).setText(1))
    method.append(Element('Field').append(Attribute('Name', 'Title')).setText('Just Changed It23223'))
    
    batch.append(method)
    
    updates = Element('ns1:updates')
    updates.append(batch)
    
    client.service.UpdateListItems('Test', updates)
    

提交回复
热议问题