?
Solved

Applying RMS on Word document by using .net web service

Posted on 2012-03-27
3
Medium Priority
?
833 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 42

Expert Comment

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

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 14

Author Closing Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

765 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