Records Management for Microsoft Office SharePoint Server, Page 4
In Visual Studio, create a Web Reference to "_vti_bin/officialfile.asmx" ("RegisterCenterWS" in the example). The first code lines create the WebService Object, place the ASMX file in both the server and the Web Application of the Records Center, and initiate the appropriate credentials.
The SPSite, SPWeb, and SPFile Objects contain references to the document to be saved. Often, a document is not located within SharePoint; in this case, the reference may be obtained by using a WebService. The important point is that it is necessary to have an image of the document in a byte array ("myDocByte" in the example).
The variable "RepositoryProperties" is an array that contains information about the document to be saved and, later, is found in the corresponding "Properties" folder in the Records Center List. Because many Properties as necessary can be added, they can be of any type and with any content.
Finally, the "SubmitFile" Method uses the bytes stream with the document, the variable with the Properties, the name of the Content Type, its URL, and the user data to upload the document to the Records Center. The Method returns the results of the operation: Success, MoreInformation, InvalidConfiguration, InvalidArgument, InvalidUser, NotFound, FileRejected, or UnknownError.
There is no default WebServices in MOSS to place a Hold on a document or to release the existent Holds, but by using the Object Model it is easy to create a new WebService with this functionality.
The Records Center is an important MOSS component for companies that need to save critical or legally sensitive information. Only authorized personnel have access to the information and the Records Center isolates it from the routine sites in the portal.
Programming is achieved with the Object Model of MOSS and one of its default WebServices allowing authorized personnel full access to the Records Center, from uploading the documents to applying and releasing Holds.
About the author
Gustavo Velez is a MCSD Senior Application Developer for Winvision (http://www.winvision.nl), a Microsoft Gold Partner in the Netherlands. He has many years experience developing Windows and Office applications, and more than six years of daily programming experience with SharePoint. The author's articles can be found in many of the leading trade magazines in English, Dutch, and Spanish. He is also pleased to be Webmaster of http://www.gavd.net/servers, the only Spanish-language site dedicated to SharePoint. Spanish-language readers may want to consult Velez's book, Programación con SharePoint 2007 (http://www.dotnetmania.com/Libros/index.html). Velez has been awarded MVP status (Most Valuable Professional, http://mvp.support.microsoft.com/), in the area of SharePoint MOSS.