Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Lists WebService

  Asked By: Scot    Date: Oct 07    Category: Sharepoint    Views: 990

I am trying to insert content into a document library using the
lists webservice. The following is my code. The problem appears to
be in the XML that I am passing. It errors out as a bad parameter
passed, the column is setup as single line of text and there is only
one column. The class level variable is returning a string, so what
would be the problem?

Error

<Result ID="1,New"
xmlns="http://schemas.microsoft.com/sharepoint/soap/"><ErrorCode>0x80
070057</ErrorCode><ErrorText>Bad parameter passed to Web Server
Extensions. Check the information you entered and try
again.</ErrorText></Result>

Code

Dim listService As New SPS_DocSite.Lists

listService.Credentials = Me.m_Cred

Dim strBatch As String

strBatch = String.Format("<Method ID='1' Cmd='New'>" + _

"<Field Name='ID'>{0}</Field>" + _

"<Field Name='Title'>{1}</Field>" + _

"</Method>", "New", Me.m_strDocumentCategory)

Dim xDoc As System.Xml.XmlDocument = New System.Xml.XmlDocument

Dim elBatch As Xml.XmlElement = xDoc.CreateElement("Batch")

elBatch.InnerXml = strBatch

Try

Dim ndReturn As Xml.XmlNode = listService.UpdateListItems
(Me.m_strGUID, elBatch)

System.Diagnostics.Debug.WriteLine(ndReturn.OuterXml)

System.Diagnostics.Debug.WriteLine(ndReturn.InnerXml)

Catch ex As Exception

System.Diagnostics.Debug.WriteLine(ex.Message)

System.Diagnostics.Debug.WriteLine("Stack Trace:")

System.Diagnostics.Debug.WriteLine(ex.StackTrace)

End Try

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Lists WebService Or get search suggestion and latest updates.




Tagged: