SOAPException error

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);
 
N

Nach

I cleared the error by doing this

I had put the Xml in the wrong format....this is the right way to do it in
my case



nNewFields.InnerXml = "<Method ID='1'>" + "<Field Type='Currency'
Name='Cost10' DisplayName = 'Cost' FromBaseType = 'True' StaticName = 'Cost'
ColName = 'float3'><Default>0</Default></Field>" + "</Method>";



I was giving a default value and trying to close the field parameter before
providing the default value for that particular field. So it threw an error.


Nach said:
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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top