Link to home
Start Free TrialLog in
Avatar of culshaja
culshajaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

"Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown." when calling UpdateList

Hi,

I am trying to execute the code attached and I just get the very helpful error message "Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown." Can anyone see what I am doing wrong?

James :-)


Dim w2 As New WSS2.Lists
            w2.Credentials = System.Net.CredentialCache.DefaultCredentials
            w2.Url = "http://fcssharepoint.dg.dgcouncil.net/TS/PM/ti/_vti_bin/Lists.asmx"
 
            Dim destinationListName As String
 
            destinationListName = "{576830B0-B9EA-4B7C-AA72-96D86E6E66ED}"
 
            Dim ndList As XmlNode = w2.GetList(destinationListName)
            Dim ndVersion As XmlNode = ndList.Attributes("Version")
 
            Dim xmlDoc As New System.Xml.XmlDocument()
            Dim ndProperties As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "List", "")
            Dim ndTitleAttrib As XmlAttribute = CType(xmlDoc.CreateNode(XmlNodeType.Attribute, "Title", ""), XmlAttribute)
            Dim ndDescriptionAttrib As XmlAttribute = CType(xmlDoc.CreateNode(XmlNodeType.Attribute, "Description", ""), _
                XmlAttribute)
 
            ndTitleAttrib.Value = ndList.Attributes("Title").Value
            ndDescriptionAttrib.Value = ndList.Attributes("Description").Value
 
            ndProperties.Attributes.Append(ndTitleAttrib)
            ndProperties.Attributes.Append(ndDescriptionAttrib)
 
            Dim ndDeleteFields As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "Fields", "")
            Dim ndUpdateFields As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "Fields", "")
            Dim ndNewFields As XmlNode = xmlDoc.CreateNode(XmlNodeType.Element, "Fields", "")
 
            ndNewFields.InnerXml = "<Method ID=""1""><Field Type=""Boolean"" DisplayName= ""RFC""/></Method><Method ID=""1""><Field Type=""Boolean"" DisplayName= ""Post Project Task""/></Method>"
 
            
            Dim responseNode As XmlNode = w2.UpdateList(destinationListName, _
                                                        ndProperties, _
                                                        ndNewFields, _
                                                        ndUpdateFields, _
                                                        ndDeleteFields, _
                                                        ndVersion.Value)

Open in new window

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Do you have the exception details?  Are you getting anything like 'Method not found' in the exception?

Bob
Avatar of culshaja

ASKER

Hi,

there was no other detail. I have fixed the issue now though. Turmns out the call should have been as noted below.

james :-)
Dim responseNode As XmlNode = w2.UpdateList(destinationListName, _
                                                        ndProperties, _
                                                        ndNewFields, _
                                                        ndUpdateFields, _
                                                        ndDeleteFields, _
                                                        ndVersion.Value)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of culshaja
culshaja
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial