MOSS 2007 API to implement check in & check out

S

Sadhna

HI ,

I am using MOSS 2007 API's to implement the version controls like check in
and check out in Visual Studio 2005.
I have a sharepoint 2007 server and i am accessing the MOSS API (on
sharepoint server) from dotnet web application on my local machine using a
custom webservice. I am able to check out the document on the sharepoint
server by calling the API "item.File.CheckOut();" method via custom
webservice. But once i check out the document i need to open the document
and check it in back to the sharepoint server from my application. When i try
to do this i can open the document using the following code

SPDocumentLibrary docLib =
(SPDocumentLibrary)web.Lists[System.Configuration.ConfigurationSettings.AppSettings["CarizmaDocumentLibraryName"].ToString()];SPListItem
item = docLib.GetItemById(int.Parse(documentID));
SPFile document = web.GetFile(item["URL Path"].ToString());
byte[] documentContent = document.OpenBinary();
Response.ClearContent();
Response.ContentType =
Carizma.Common.CarizmaConfiguration.GetAppSetting("CONTENT_TYPE_" + itemType);
Response.AddHeader("Content-Disposition", "attachment;filename=" +
documentName);
Response.BinaryWrite(documentContent );
Response.End();

But i am not able to check in the changes made on the document back to the
sharepoint server from my local application. How will i be able to do this?
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top