0

I have a test gui(winform) which I use to test my wcf service. The service call´s another project in my solution which uses some windows api methods(user32.dll) to find word dialog boxes. It works fine when I test it locally, but when I setup my wcf service in the iis and test it with soapUI, it fails to retrieve and do the desired action on the word dialog boxes.

I suspect that because I am using a winform to test the service, so when I run the test form the solution creates instances/handlers so the windows/dialogboxes are at my disposal in the solution. Testing the service alone without creating the test winform does not make the service get the dialogboxes...

Could this be a permission issue in the iss or somewhere else? I have tried to grant the worker process admin rights, but maby I am not granting the rights in the wrong place. I need find out how the service alone can get a hold of the windows/dialogboxes with user32.dll methods?

windows 7 pro, iis7, vs2010

Any help is greatly appreciated.

Kurubaran
  • 8,696
  • 5
  • 43
  • 65
IceCode
  • 1,466
  • 13
  • 22
  • To make it clear, are you trying to read Windows Forms data from your WCF service, like windows title or windows content? – Oscar Dec 19 '13 at 09:16
  • @Oscar; Yes, I am trying to read the windows titles. – IceCode Dec 19 '13 at 09:17
  • *find word dialog boxes* What documents do you expect your web server to be editing, exactly? – ta.speot.is Dec 19 '13 at 09:32
  • @ta.speot.is; I need to find the titles in the different dialog windows that appear if the document is password protected, has macroes etc... This is probably a permission issue in the iis, but I have not yet succeeded in granting the service admin rights. – IceCode Dec 19 '13 at 10:50
  • It sounds like you're performing [service-side automation of Office](http://support.microsoft.com/kb/257757). – ta.speot.is Dec 19 '13 at 11:04

1 Answers1

1

Your approach is completely wrong. It works under Visual Studio because it's runing under your user account, but once deployed in IIS, it runs in the context of the App Pool account, which has limited rights and can't interact with Desktop. Even if you run the service under an Admin account, which is a big security flaw, it will only work with local windows, never with windows on remote machines. If you explain better your requirements maybe we could suggest a better approach for this.

Oscar
  • 13,594
  • 8
  • 47
  • 75
  • This is just a render server whos only purpose is to convert office documents to pdf. Granting the service admin rights is ok. I have tried to give the apppool for the service the 4 types of identities there is under the process model and also set Anonymous Authentication option to "Application pool identity" without luck. Is there someplace else in the iss where I need to give the service/apppool admin rights? – IceCode Dec 19 '13 at 10:02
  • 2
    You are using a hammer to kill a fly... An Office Addin is more suitable for this requirements than a WCF service. You could have a button on the Ribbon that when clicked convert the document to pdf. By the way, this functionality is already a native feature of recent Office versions, so I guess you're doing it for learning purposes. http://msdn.microsoft.com/en-us/library/ms268878.aspx http://msdn.microsoft.com/en-us/library/cc442946.aspx Also, I don't get the point in reading Windows titles using Windows API.. – Oscar Dec 19 '13 at 10:50