Calling Process.Start from Webservice method hangs after first call

Discussion in 'ASP .Net' started by christian13467@googlemail.com, Mar 19, 2007.

  1. Guest

    Hi,

    I'm using ASP.Net 2.0 with IIS 6.0 on windows server 2003 sp1. Calling
    a commandline program or a cmd file using Process.Start inside a
    webservice method. The call to Process.Start returns once after
    restarting the iis. A second call to my webservice method never
    returns.

    I found some post wich where fixed checking access rights. I added
    ASPNET to administrators group with no success.

    My question is why the call hangs second time?
    Any idea,

    Christian
     
    , Mar 19, 2007
    #1
    1. Advertising

  2. Aidy Guest

    The answer depends on what this command-line app is doing. The general
    advice is to just not do what you're doing. Just cos you can spawn
    processes doesn't mean it is suitable to spawn any application you want from
    an asp.net page.

    <> wrote in message
    news:...
    > Hi,
    >
    > I'm using ASP.Net 2.0 with IIS 6.0 on windows server 2003 sp1. Calling
    > a commandline program or a cmd file using Process.Start inside a
    > webservice method. The call to Process.Start returns once after
    > restarting the iis. A second call to my webservice method never
    > returns.
    >
    > I found some post wich where fixed checking access rights. I added
    > ASPNET to administrators group with no success.
    >
    > My question is why the call hangs second time?
    > Any idea,
    >
    > Christian
    >
     
    Aidy, Mar 19, 2007
    #2
    1. Advertising

  3. Guest

    Hi Aidy,

    the command line app is generating some some data and building a pdf
    file which my webservice method has to deliver back. It runs all fine,
    if I do that with a standard c# program. But something in asp.net is
    blocking the call. Do you know who?

    Cheers,
    Christian
     
    , Mar 19, 2007
    #3
  4. bruce barker Guest

    Re: Calling Process.Start from Webservice method hangs after firstcall

    the spawned program is probably waiting for console input, and your app
    is not sending any.


    -- bruce (sqlwork.com)


    wrote:
    > Hi,
    >
    > I'm using ASP.Net 2.0 with IIS 6.0 on windows server 2003 sp1. Calling
    > a commandline program or a cmd file using Process.Start inside a
    > webservice method. The call to Process.Start returns once after
    > restarting the iis. A second call to my webservice method never
    > returns.
    >
    > I found some post wich where fixed checking access rights. I added
    > ASPNET to administrators group with no success.
    >
    > My question is why the call hangs second time?
    > Any idea,
    >
    > Christian
    >
     
    bruce barker, Mar 19, 2007
    #4
  5. Guest

    Hi bruce,

    the program itself is not asking for anything. I can run the program
    as logged on user without any error or warnings.
    It might be that someone else is poping up what I cannot see because
    its not shown. Are there some restrictions in calling processes from
    asp.net?

    Cheers,
    Christian
     
    , Mar 20, 2007
    #5
  6. Aidy Guest

    If it is generating a pdf file I'd first check that your anonymous asp.net
    user has write access on the directory it is saving the file to.

    <> wrote in message
    news:...
    > Hi Aidy,
    >
    > the command line app is generating some some data and building a pdf
    > file which my webservice method has to deliver back. It runs all fine,
    > if I do that with a standard c# program. But something in asp.net is
    > blocking the call. Do you know who?
    >
    > Cheers,
    > Christian
    >
     
    Aidy, Mar 20, 2007
    #6
  7. Guest

    I made him an administrator.

    The curios moment is, that the program starts and runs in the
    background. But simply the call Process.Start never returns. I put it
    into an exception handler, but there is no exception thrown.

    - Christian
     
    , Mar 20, 2007
    #7
  8. <> wrote in message
    news:...
    >I made him an administrator.
    >
    > The curios moment is, that the program starts and runs in the
    > background. But simply the call Process.Start never returns. I put it
    > into an exception handler, but there is no exception thrown.


    You should put some exception logging into the PDF program. Don't just make
    the user an administrator and assume that you've succeeded, so it must be
    something else.

    What would have happened if, for some other reason, the user had been able
    to write to the output directory? Would the program have written an error
    message to the system event log? If so, then look at the event log to see if
    that happened when started by ASP.NET.

    If not, then add the code to write error messages to the event log (not to a
    file!). Then try again and see what happens.

    John
     
    John Saunders, Mar 20, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chad
    Replies:
    1
    Views:
    3,690
  2. Guest
    Replies:
    0
    Views:
    3,711
    Guest
    Jan 18, 2004
  3. Alexander Widera

    process.start() program hangs

    Alexander Widera, May 22, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    6,216
    Alexander Widera
    May 31, 2006
  4. Babu
    Replies:
    3
    Views:
    902
  5. René Preußler

    Asynchronous Call of WebService method within a WebService

    René Preußler, Oct 29, 2008, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    198
    René Preußler
    Oct 29, 2008
Loading...

Share This Page