Solved

Applying RMS on Word document by using .net web service

Posted on 2012-03-27
3
808 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 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
In-place Upgrading Dirsync to Azure AD Connect
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

856 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