473,467 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Sharepoint Webservice Problem

Hi,

I am trying to update a list on sharepoint server via calling its standard
built in web service. When ever i call the UpdateListitems() method, I get
the following exception:

at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at SPSWebserviceClient.preston.Lists.UpdateListItems( String listName,
XmlNode updates) in C:\Documents and Settings\Javeed\My Documents\Visual
Studio Projects\WebParts\SPSWebserviceClient\Web
References\preston\Reference.cs:line 239
at SPSWebserviceClient.clientWindow.updateList_Click( Object sender,
EventArgs e) in c:\documents and settings\javeed\my documents\visual studio
projects\webparts\spswebserviceclient\spswebservic eclient.cs:line 145

Can any one help me in this. Preston is the name of my server hosting the
sharepoint webservice. Following is my code:

//Creating an instance of a list on the server. Server is "preston" in
this case where the standard SPS web service resides.
preston.Lists routeList = new preston.Lists();

//Authenticating the user by his default credentials.
routeList.Credentials = System.Net.CredentialCache.DefaultCredentials;

//Setting the url to the subsite for which the clients is requesting the
webservice.
routeList.Url =
"http://preston/sites/drmTeamSite/fahadTest/webService/_vti_bin/Lists.asmx";

// Create an XmlDocument object and construct a Batch element and its
attributes.
//The Batch element provides batch processing of commands within HTTP
protocol.
//See
http://msdn.microsoft.com/library/de...SV01027968.asp
XmlDocument doc = new System.Xml.XmlDocument();
XmlElement batchElement = doc.CreateElement("Batch");
batchElement.SetAttribute("OnError","Continue");
batchElement.SetAttribute("ListVersion","0");
batchElement.SetAttribute("ViewName","{D607C005-0AD7-482F-8AF6-7399D252A991}");

/* Specify methods for the batch post using CAML. In each method include
the ID of the item to update and the value to place in the specified
column.*/
batchElement.InnerXml = "<Method ID='1' Cmd='Update'>"+
"<Field Name='ID'>3</Field>"+
"<Field Name='Position'>100</Field>"+
"</Method>";
// Update list items.
try
{
routeList.UpdateListItems("{B081FF04-1604-4F93-BEB2-D71F0EACAADA}",
batchElement);

}
catch(Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
Nov 23 '05 #1
0 2702

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff Connelly | last post by:
Could anyone give me any web pointers to information on connecting to SharePoint library files from C# code? I'd like to see if documents exists, and save "links" to them, whatever that might...
0
by: Ken Wigle | last post by:
All, I am trying to add some .net applications I wrote to a virtual directory underneath the sharepoint services web site. I am having some problems and wondering if a) this is possible and/or...
0
by: Joe L via .NET 247 | last post by:
I have written a web part. The webpart calls a web service toget info. I ran into problems with the webservice notresponding. We decided to have a cutoff for the time to waitfor a response from...
3
by: Robin | last post by:
I am trying to get a virtual directory ASP.Net application to work on a Windows 2003 server that has Sharepoint 2003. I have followed the Microsoft knowledgebase but the error message below still...
2
by: =?Utf-8?B?QWxhc3RhaXIgQmVsbA==?= | last post by:
I am having trouble creating a web site on a server running sharepoint services. I am creating an ASP.Net website using Visual Studio 2005. The server I am trying to create it on is a Windows 2003...
1
by: getobject | last post by:
I am building an ASP.Net site and wish to use a SharePoint to hold the information. I am trying to add an entry to a list using Sharepoint webservices and keep getting a SOAP exception. I have know...
8
by: GaryDean | last post by:
I was advised by a Microsoft speaker at a local .Net conference that "SharePoint" had a lot to offer for asp.net developers. I've spent a few hours hunting down links on Sharepoint Services in...
0
by: barmatt80 | last post by:
I am trying to write a program that the user can select an approval date and using that approval date, it would query a sharepoint list and return that list item that corresponds with that list item....
0
by: TheNeil | last post by:
Hi, I've recently been working on an C#/ASP.net (v2) web application that queries a couple of internal SQL 2005 databases, connects to Excel (2007) and then makes the resultant .XLS file available...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.