Solved

Applying RMS on Word document by using .net web service

Posted on 2012-03-27
3
791 Views
Last Modified: 2012-04-27
Problem Description:
==================

If I run web service directly after running it from visual studio: the calling of web service applying correctly and RMS policy can be applied on document.

                BUT, After publish web service on IIS and calling it, the RMS policy couldn’t be applied on word document and it causing crash in MS word.
                Other Word automation functions work correctly, only “ApplyPolicy” not working

                I’ve changed security in:
-       “DefaultAppPool” in IIS
-      DCOM objects
-      Create folder “Desktop” under Windows\sysWOW64\config\systemProfile”

Problem only if we applying RMS via web service, if we open normal word documents and try to protect, RMS working fine.

Additional Information:
=====================

RMS server: 2008

RMS client operation system:

-      Windows server 2008 R2
-      Office 2007
-      IIS 7.0
-      .Net framework 2.0

Web Service simple code for web method:
=====================================
 //OBJECT OF MISSING "NULL VALUE"
        Object oMissing = System.Reflection.Missing.Value;

        //OBJECTS OF FALSE AND TRUE
        Object oTrue = true;
        Object oFalse = false;

        Microsoft.Office.Interop.Word.Application oWord;
        Microsoft.Office.Interop.Word.Document oWordDoc;

       oWord = new Microsoft.Office.Interop.Word.Application();
       oWordDoc = new Microsoft.Office.Interop.Word.Document();
            
            //MAKING THE APPLICATION VISIBLE
            oWord.Visible = false;

           //ADDING A NEW DOCUMENT TO THE APPLICATION
oWordDoc = oWord.Documents.Add(ref filePath, ref oMissing, ref oMissing, ref oMissing);
oWordDoc.Permission.ApplyPolicy(“template.xml”);

oWordDoc.SaveAs(ref filePath, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing);

            //CLOSING THE FILE
oWordDoc.Close(ref oFalse, ref oMissing, ref oMissing);

           //QUITTING THE APPLICATION
oWord.Quit(ref oMissing, ref oMissing, ref oMissing);

Open in new window

0
Comment
  • 2
3 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 37775818
which error do u get?
0
 
LVL 13

Accepted Solution

by:
Abduljalil Abou Alzahab earned 0 total points
ID: 37877448
The problem solved after exclude RMS and portal site URL's from proxy settings
0
 
LVL 13

Author Closing Comment

by:Abduljalil Abou Alzahab
ID: 37901134
I solve the issue by excluding specific URL's from IE proxy settings
0

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now