I created an empty list and wish to use the UpdateList webservice to add an item (row) to a list. I have one column in the list "Title" and wish to grab data from a textbox and update the list.
Here is the code I am using:
Expand|Select|Wrap|Line Numbers
- Dim doc As New XmlDocument
- Dim updates As XmlElement = doc.CreateElement("Batch")
- updates.InnerXml = "<Method ID='1' Cmd='New'><Field
- Name='Title'>" + TextBox1.Text + "</Field></Method>"
- Dim returnNode As XmlNode =
- VideoLists.UpdateListItems("{B3D403D3-73BB-49C7-AD83-9008E085C74C}",
- updates)
The error message
Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerExcepti on'
was thrown.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapException:
Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerExcepti on'
was thrown.
Source Error:
Line 665:
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://schem
as.microsoft.com/sharepoint/soap/UpdateListItems",
RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/",
ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)
]
Line 666: public System.Xml.XmlNode UpdateListItems(string
listName, System.Xml.XmlNode updates) {
Line 667: object[] results = this.Invoke("UpdateListItems",
new object[] {
Line 668: listName,
Line 669: updates});
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary
ASP.NET
Files\vchannvideo\1d71390d\8e1d0fde\App_WebReferen ces.fp3a0m8w.0.cs
Line: 667
Stack Trace:
[SoapException: Exception of type
'Microsoft.SharePoint.SoapServer.SoapServerExcepti on' was thrown.]
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapCl
ientMessage message, WebResponse response, Stream responseStream,
Boolean asyncCall) +1547
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters) +205
collwss.Lists.UpdateListItems(String listName, XmlNode updates) in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\vchannvideo\1d71390d\8e1d0fde\App_WebReferen ces.fp3a0m8w.0.cs:667
ad.Button1_Click(Object sender, EventArgs e) in C:\Documents and
Settings\JG7523\My Documents\Visual Studio
2005\WebSites\VCHANNVideo\ad.aspx.vb:54
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +75
System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument) +97
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.Rai
sePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
+33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+4919