Run-EXE-Over-Web Services

I am trying to call a Windows Console application on my webservice. If I run it as a local service, then in the same solution it works fine, but if I try to call it through my web service hosted as a local IIS server it doesn't call it. I think this is a security issue. I am new to webservice and I am calling my application using

           Process.Start() function...

      

And one more thing if Windows Service works great.

Any idea ???

0


a source to share


2 answers


treat the console as a separate project. First of all, make sure it works.

I did what you described in asp.net web app. I tested it; the same code works fine in a web service. The trick here is "startInfo.UseShellExecute = False"

This example passes parameters to a console application that runs at runtime. (excuse it in VB).



Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process

startInfo = New System.Diagnostics.ProcessStartInfo("C:\Inetpub\wwwroot\KPIMi\Annotation Editor\Annotation_Console.exe")
startInfo.Arguments = strServerName & "-" & strPrimaryKey & "-" & txtStart.Text
startInfo.UseShellExecute = False

pStart.StartInfo = startInfo
pStart.Start()

      

pStart.WaitForExit () 'Your code will be stopped until the exe file is executed.

Hope it helps.

+3


a source


Does the user of the IUSR_ * account have permission to execute the console application?



0


a source







All Articles