MOSS 2007 API to implement check in & check out

Discussion in 'ASP .Net' started by Sadhna, Sep 1, 2008.

  1. Sadhna

    Sadhna Guest

    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?
     
    Sadhna, Sep 1, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sulaiman
    Replies:
    0
    Views:
    334
    Sulaiman
    Dec 6, 2006
  2. AGH
    Replies:
    1
    Views:
    480
    John Timney \(MVP\)
    Feb 23, 2007
  3. Freelance MOSS Consultant

    , Aug 21, 2010, in forum: ASP .Net
    Replies:
    0
    Views:
    455
  4. freelance moss developer

    , Jan 19, 2011, in forum: ASP .Net
    Replies:
    0
    Views:
    743
  5. Sulaiman

    MOSS 2007 WebParts in ASP.Net 2.0 Application

    Sulaiman, Dec 6, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    123
    Sulaiman
    Dec 6, 2006
Loading...

Share This Page