By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,882 Members | 2,482 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,882 IT Pros & Developers. It's quick & easy.

MOSS 2007 API to implement check in & check out

P: n/a
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.AppSett ings["CarizmaDocumentLibraryName"].ToString()];SPListItem
item = docLib.GetItemById(int.Parse(documentID));
SPFile document = web.GetFile(item["URL Path"].ToString());
byte[] documentContent = document.OpenBinary();
Response.ContentType =
Carizma.Common.CarizmaConfiguration.GetAppSetting( "CONTENT_TYPE_" + itemType);
Response.AddHeader("Content-Disposition", "attachment;filename=" +
Response.BinaryWrite(documentContent );

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?
Sep 1 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.