Re: Starting exe from WebService

From: Mazen (mazenmanasseh_at_yahoo.com)
Date: 07/03/03


Date: Thu, 3 Jul 2003 13:57:48 -0700


Thanks for your prompt reply.

I need to execute the program through the webservice
without necessarily opening its desktop interface. I need
to do that so that when a web client triggers an event, a
webmethod would be called on the server machine to
execute this program on the server which is in turn
expected to perform some tasks. So I just need to execute
it without any further user interaction directly with the
program itself.
    I cannot have the program statements coded within the
WebService because the program is complicated and I don't
have access to its source code. Consequently, i am
looking for a way to execute it remotely.
    I understand your explanation for a WebService
running as a service; however, I am sure there should be
a solution for this cause I was able to execute it from
the Webservice about a week ago. For some reason I had to
remove IIS and the .Net Framework from the server and
reinstall both of them. After doing that the program
stopped starting from within the WebService.

Thanks again for any further hints,

Mazen

>-----Original Message-----
>Your web service is probably running as a service on the
machine, and
>services are generally not configured to "interact with
the desktop". So a
>service can't launch an app, and have that app appear on
the desktop of the
>server.
>
>Services run on their own "winstations", in security
contexts which are
>separate from the security context of the user who is
logged in on the
>console of the machine.
>
>In your case, what is probably happening is that the
WinForm app is getting
>launched in the service's winstation, and the WinForm's
initialization is
>failing because it expects a GUI winstation, and the
initial calls to the
>GUI API are failing.
>
>In general, services should not be making API calls that
attempt to interact
>with the desktop. For example, which desktop? With
terminal services,
>there can be multiple people logged in to the machine -
one at the console,
>and several on remote desktops. In this example, if you
were going to
>launch a WinForm, which user's "desktop" would you want
the WinForm to
>appear on?
>
>
>Why do you want a WebMethod to launch a WinForm on the
server? How do you
>envision the user using your application?
>
>--
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>
>
>
>"Mazen" <mazenmanasseh@yahoo.com> wrote in message
>news:50f001c3417e$74898480$a401280a@phx.gbl...
>> Description: I am trying to run a WinForm application
>> created in C# from a WebMethod by starting a new
process
>> in the Webmethod and performing a Start command on that
>> process. I wonder if the problem described below is
>> related to WebService security priveleges.
>>
>> Problem: When I invoke the WebMethod, the name of the
>> WinForm application instantly appears in the Task
Manager
>> processes list and then very rapidly disappears as if
an
>> error occurs. I have added a Thread.Sleep(10000) in the
>> Form Load event of the application but the name still
>> diappears quickly from the Task Manager without
>> performing what i need it to do.
>>
>> Additional Information: I tried creating another
WinForm
>> application that has the same code as the Webmethod for
>> the process initiation and it worked fine (The
>> application from the process starts and remains listed
in
>> Task Manager). It seems the problem is restricted to
the
>> WebService. Note that I also have changed the
>> machine.config parameters as follows:
>>
>> <identity impersonate=true usrname=""
password=""/>
>> <processmodel ...... username="SYSTEM" ....../>
>>
>> I appreciate any insight on this problem.
>>
>> Thanks
>>
>> Mazen
>
>
>.
>



Relevant Pages

  • Re: Starting exe from WebService
    ... Ok, when you said it was WinForm app that you were trying to execute, I ... > WebService because the program is complicated and I don't ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Asynchronous Web Service Call
    ... & b) It will execute within a thread from the standard system ... Conversation: Asynchronous Web Service Call ... We want to call a webservice asynchronously by a .net soap proxy ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Weather Service Webservice Issues
    ... Patrick ... > We have been using the the National Weather Service ... and can't get the webservice to ... > execute from my asp.net application will it does execute from other ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Weather Service Webservice Issues
    ... Patrick ... > We have been using the the National Weather Service ... and can't get the webservice to ... > execute from my asp.net application will it does execute from other ...
    (microsoft.public.dotnet.framework.aspnet)
  • Weather Service Webservice Issues
    ... We have been using the the National Weather Service ... committed an HTTP protocol violation." ... and can't get the webservice to ... execute from my asp.net application will it does execute from other ...
    (microsoft.public.dotnet.framework.aspnet)

Loading