Solved

unable to call executable from webservice

Posted on 2007-04-03
2
719 Views
Last Modified: 2008-02-01
This has me and my team really stumped, and so we could use some help. We want to call an external program from a webservice, but it doesn't seem to find the apps, saying file not found. I've followed the examples in VSNET.2003. The program is C#.net. Here's the snippet:

                        System.Diagnostics.Process proc;
                        Process p = new Process();
                        p.StartInfo.WorkingDirectory =
                        "C:\\Program Files\\Microsoft Visual FoxPro 8";
                        p.StartInfo.FileName = "vfp8.exe";
                        p.StartInfo.Arguments = "c:\\dbflock\\rlock.prg";
                        p.StartInfo.UseShellExecute = false;
                        p.StartInfo.RedirectStandardOutput = true;
                        p.Start();
                        p.WaitForExit();


I calls a foxpro executable in the c:\dbflock subdiretory.  I've tried moving the exe to different places (haven't tried system32), added that directory to the path statement, tried this idea:
System.Diagnostics.Process proc;
                        proc = System.Diagnostics.Process.Start(@"c:\DBFLOCK\RLOCK.EXE", arg1);
                        proc.WaitForExit();


Can you think of another way to start an external executable from a web service? Thanks for any help!
0
Comment
Question by:andremara
2 Comments
 
LVL 6

Accepted Solution

by:
Niraj_Singh earned 500 total points
ID: 18848715
hi,
 the file is opened by the aspnet user. this aspnet user does not have sufficient rights to open all file. you may have to give it the required rights.
also refer to the below mentioned link
http://www.code-magazine.com/article.aspx?quickid=0703062&page=2
0
 

Author Comment

by:andremara
ID: 18848758
Hi Niraj,
I think the article is calling .net from fox, where I am starting off in a webservice and would like to call an executable - in this case - foxpro, but possibly other exe's as well. when i run this, "File Not Found" is the error.  Are you saying this could be a rights issue and not a 'file not found' issue?
Thanks
Andre
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 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

19 Experts available now in Live!

Get 1:1 Help Now