N
Nach
Hi, I'm trying to add a column to "Risks" List in one site through Webservices
I get the following error..does anybody know why ? I am able to read the
list and the information in it...but cant updatelist.
----------------
Message:
Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was
thrown.
StackTrace:
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at TestingPS2007.WssListsWebSvc.Lists.UpdateList(String listName, XmlNode
listProperties, XmlNode newFields, XmlNode updateFields, XmlNode
deleteFields, String listVersion) in C:\Documents and Settings\nachnac\My
Documents\Visual Studio 2005\Projects\TestingPS2007\Web
References\WssListsWebSvc\Reference.cs:line 369
at TestingPS2007.Form1.createCol() in C:\Documents and
Settings\nachnac\My Documents\Visual Studio
2005\Projects\TestingPS2007\Form1.cs:line 126
-----------------
Code piece is:
-----------
XmlDocument xmlDoc = new XmlDocument();
XmlNode ndProperties = xmlDoc.CreateNode(XmlNodeType.Element,
"List", "");
XmlAttribute ndTitleAttrib =
(XmlAttribute)xmlDoc.CreateNode(XmlNodeType.Attribute, "Title", "");
XmlAttribute ndDescAttrib =
(XmlAttribute)xmlDoc.CreateNode(XmlNodeType.Attribute, "Description", "");
XmlNode nNewFields = xmlDoc.CreateNode(XmlNodeType.Element,
"Fields", "");
XmlNode ndDeleteFields = xmlDoc.CreateNode(XmlNodeType.Element,
"Fields", "");
ndDeleteFields.InnerXml = "<Method/>";
XmlNode ndUpdateFields = xmlDoc.CreateNode(XmlNodeType.Element,
"Fields", "");
ndUpdateFields.InnerXml = "<Method/>";
ndTitleAttrib.Value = ndList.Attributes["Title"].Value;
ndDescAttrib.Value = ndList.Attributes["Description"].Value;
ndProperties.Attributes.Append(ndTitleAttrib);
ndProperties.Attributes.Append(ndDescAttrib);
nNewFields.InnerXml = "<Method ID='1'>" + "<Field
Type='Currency' DisplayName='Cost' FromBaseType='TRUE' ColName =
'float3'/><Default>0</Default>" + "</Method>";
try
{
XmlNode ndReturn = lists.UpdateList(Name.Value,
ndProperties, nNewFields, ndUpdateFields, ndDeleteFields, ndVersion.Value);
I get the following error..does anybody know why ? I am able to read the
list and the information in it...but cant updatelist.
----------------
Message:
Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was
thrown.
StackTrace:
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at TestingPS2007.WssListsWebSvc.Lists.UpdateList(String listName, XmlNode
listProperties, XmlNode newFields, XmlNode updateFields, XmlNode
deleteFields, String listVersion) in C:\Documents and Settings\nachnac\My
Documents\Visual Studio 2005\Projects\TestingPS2007\Web
References\WssListsWebSvc\Reference.cs:line 369
at TestingPS2007.Form1.createCol() in C:\Documents and
Settings\nachnac\My Documents\Visual Studio
2005\Projects\TestingPS2007\Form1.cs:line 126
-----------------
Code piece is:
-----------
XmlDocument xmlDoc = new XmlDocument();
XmlNode ndProperties = xmlDoc.CreateNode(XmlNodeType.Element,
"List", "");
XmlAttribute ndTitleAttrib =
(XmlAttribute)xmlDoc.CreateNode(XmlNodeType.Attribute, "Title", "");
XmlAttribute ndDescAttrib =
(XmlAttribute)xmlDoc.CreateNode(XmlNodeType.Attribute, "Description", "");
XmlNode nNewFields = xmlDoc.CreateNode(XmlNodeType.Element,
"Fields", "");
XmlNode ndDeleteFields = xmlDoc.CreateNode(XmlNodeType.Element,
"Fields", "");
ndDeleteFields.InnerXml = "<Method/>";
XmlNode ndUpdateFields = xmlDoc.CreateNode(XmlNodeType.Element,
"Fields", "");
ndUpdateFields.InnerXml = "<Method/>";
ndTitleAttrib.Value = ndList.Attributes["Title"].Value;
ndDescAttrib.Value = ndList.Attributes["Description"].Value;
ndProperties.Attributes.Append(ndTitleAttrib);
ndProperties.Attributes.Append(ndDescAttrib);
nNewFields.InnerXml = "<Method ID='1'>" + "<Field
Type='Currency' DisplayName='Cost' FromBaseType='TRUE' ColName =
'float3'/><Default>0</Default>" + "</Method>";
try
{
XmlNode ndReturn = lists.UpdateList(Name.Value,
ndProperties, nNewFields, ndUpdateFields, ndDeleteFields, ndVersion.Value);