473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Web service in EXE

I've seen apps where if a windows exe form is running, it publishes a web
service. There is no IIS folders or virtual directories required. Does
anyone have information on how to do this?
Nov 21 '05 #1
17 5023
Jeremy Chapman wrote:
I've seen apps where if a windows exe form is running, it publishes a
web service. There is no IIS folders or virtual directories required.
Does anyone have information on how to do this?


Yup. First you need to get yourself WSE2.0[1]. Next, write a web service
class that derives from SoapService, like so:

<codeSnippet language="C#">
public sealed class MyService : SoapService
{
[SoapMethod("MySoapAction")]
public void MyWebMethod()
{
// TODO: do something here
}
}
</codeSnippet>

Finally, to host this service in your WinForms app all you need to do is
the following:

<codeSnippet language="C#">
protected override void OnLoad(EventArgs args)
{
SoapReceivers.Add(new EndpointReference(new Uri("http://" + Dns.GetHostName()
+ "/MyService")), typeof(MyService));

base.OnLoad(args);
}
</codeSnippet>

That's all there is to it. You could host it with the lower level soap TCP
protocol if you just change "http:" to "soap.tcp:". Read all about this process
here[2].

HTH,
Drew

[1] http://msdn.microsoft.com/webservices/building/wse/
[2] http://msdn.microsoft.com/library/de....asp?frame=tru

Nov 21 '05 #2
Brilliant! I'll try this.
"Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
news:85*********************@msnews.microsoft.com. ..
Jeremy Chapman wrote:
I've seen apps where if a windows exe form is running, it publishes a
web service. There is no IIS folders or virtual directories required.
Does anyone have information on how to do this?
Yup. First you need to get yourself WSE2.0[1]. Next, write a web service
class that derives from SoapService, like so:

<codeSnippet language="C#">
public sealed class MyService : SoapService
{
[SoapMethod("MySoapAction")]
public void MyWebMethod()
{
// TODO: do something here
}
}
</codeSnippet>

Finally, to host this service in your WinForms app all you need to do is
the following:

<codeSnippet language="C#">
protected override void OnLoad(EventArgs args)
{
SoapReceivers.Add(new EndpointReference(new Uri("http://" +

Dns.GetHostName() + "/MyService")), typeof(MyService));

base.OnLoad(args);
}
</codeSnippet>

That's all there is to it. You could host it with the lower level soap TCP
protocol if you just change "http:" to "soap.tcp:". Read all about this process here[2].

HTH,
Drew

[1] http://msdn.microsoft.com/webservices/building/wse/
[2] http://msdn.microsoft.com/library/de...asp?frame=true

Nov 21 '05 #3
I'm running into a bit of a snag,

On the SoapReceivers.Add method, An exception gets raised with the message
WSE803: A valid HttpContext is required for Active HTTP Listening.

Is this a configuration issue? Neither the help or google return anything
on WSE803
"Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
news:85*********************@msnews.microsoft.com. ..
Jeremy Chapman wrote:
I've seen apps where if a windows exe form is running, it publishes a
web service. There is no IIS folders or virtual directories required.
Does anyone have information on how to do this?
Yup. First you need to get yourself WSE2.0[1]. Next, write a web service
class that derives from SoapService, like so:

<codeSnippet language="C#">
public sealed class MyService : SoapService
{
[SoapMethod("MySoapAction")]
public void MyWebMethod()
{
// TODO: do something here
}
}
</codeSnippet>

Finally, to host this service in your WinForms app all you need to do is
the following:

<codeSnippet language="C#">
protected override void OnLoad(EventArgs args)
{
SoapReceivers.Add(new EndpointReference(new Uri("http://" +

Dns.GetHostName() + "/MyService")), typeof(MyService));

base.OnLoad(args);
}
</codeSnippet>

That's all there is to it. You could host it with the lower level soap TCP
protocol if you just change "http:" to "soap.tcp:". Read all about this process here[2].

HTH,
Drew

[1] http://msdn.microsoft.com/webservices/building/wse/
[2] http://msdn.microsoft.com/library/de...asp?frame=true

Nov 21 '05 #4
Jeremy Chapman wrote:
I'm running into a bit of a snag,

On the SoapReceivers.Add method, An exception gets raised with the
message WSE803: A valid HttpContext is required for Active HTTP
Listening.

Is this a configuration issue? Neither the help or google return
anything on WSE803


Ack! Sorry Jeremy. I actually gave some bad advice there. I was unfortunately
thinking in the mindset of Indigo where this will be very possible and very
easy to do.

Unfortunately for WSE2.0, it looks to me like you can only setup SoapReceivers
dynamically with the soap.tcp protocol in a WinForms/Console/Service application
right now[1]. Therefore, the only way to host HTTP based SoapReceivers with
WSE2.0 is to use ASP.NET itself and configure a web application according
to the instructions that I gave you the URL for before under the header "To
register a SoapReceiver class by using the HTTP protocol".

Sorry 'bout that,
Drew

[1] That is of course, unless you host the ASP.NET runtime in your Windows
application yourself with the System.Web.Hosting APIs, but I doubt that's
supported or even recommended. If you *really* want to try going this route
I suggest you search google for custom hosting ASP.NET

Nov 21 '05 #5
On 29/11/2004, around 09:32, Drew Marsh wrote:

DM> Yup. First you need to get yourself WSE2.0[1]. Next, write a web service
DM> class that derives from SoapService, like so:
[Snip]
Blimey, today's turning in to a real school day for me!

--
Stuart
See headers for PGP Key.
"Very funny, Scotty. Now beam down my clothes."

Nov 21 '05 #6
Ok thanks. I've seen this done before, maybe not in .net, bit it can be
done I'm sure so I'll have to continue hunting for a solution.
"Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
news:85*********************@msnews.microsoft.com. ..
Jeremy Chapman wrote:
I'm running into a bit of a snag,

On the SoapReceivers.Add method, An exception gets raised with the
message WSE803: A valid HttpContext is required for Active HTTP
Listening.

Is this a configuration issue? Neither the help or google return
anything on WSE803
Ack! Sorry Jeremy. I actually gave some bad advice there. I was

unfortunately thinking in the mindset of Indigo where this will be very possible and very easy to do.

Unfortunately for WSE2.0, it looks to me like you can only setup SoapReceivers dynamically with the soap.tcp protocol in a WinForms/Console/Service application right now[1]. Therefore, the only way to host HTTP based SoapReceivers with WSE2.0 is to use ASP.NET itself and configure a web application according
to the instructions that I gave you the URL for before under the header "To register a SoapReceiver class by using the HTTP protocol".

Sorry 'bout that,
Drew

[1] That is of course, unless you host the ASP.NET runtime in your Windows
application yourself with the System.Web.Hosting APIs, but I doubt that's
supported or even recommended. If you *really* want to try going this route I suggest you search google for custom hosting ASP.NET.

Nov 21 '05 #7
Jeremy Chapman wrote:
Ok thanks. I've seen this done before, maybe not in .net, bit it can
be done I'm sure so I'll have to continue hunting for a solution.


Yeah absolutely, it's not like it's impossible or anything. Even with WSE
you could do it if you wanted to get your hands dirty. However there is no
"out of the box" support for this hosting scenario.

The question I have though is: do you really need it to use the HTTP protocol
if it's a Windows client application? Are you really acting for a host to
random HTTP clients via the internet at that point? Or are you just looking
to use the services for some kind of inter-process communication? If the
latter is the case, then the soap.tcp protocol is probably the better choice
for this problem anyway.

Good luck,
Dre

Nov 21 '05 #8
We have an application that sits on a server doing various tasks (this app
must run in a logged in user session). I wanted to build in functionality
so that various users could view the status of the application and well as
control the app in various ways, without needing to log on to the server.
Doing it through a web interface seemed like a very intuitive way to do it.

"Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
news:87*********************@msnews.microsoft.com. ..
Jeremy Chapman wrote:
Ok thanks. I've seen this done before, maybe not in .net, bit it can
be done I'm sure so I'll have to continue hunting for a solution.
Yeah absolutely, it's not like it's impossible or anything. Even with WSE
you could do it if you wanted to get your hands dirty. However there is no
"out of the box" support for this hosting scenario.

The question I have though is: do you really need it to use the HTTP

protocol if it's a Windows client application? Are you really acting for a host to
random HTTP clients via the internet at that point? Or are you just looking to use the services for some kind of inter-process communication? If the
latter is the case, then the soap.tcp protocol is probably the better choice for this problem anyway.

Good luck,
Drew

Nov 21 '05 #9
> [1] That is of course, unless you host the ASP.NET runtime in your Windows
application yourself with the System.Web.Hosting APIs, but I doubt that's
supported or even recommended. If you *really* want to try going this route I suggest you search google for custom hosting ASP.NET.
What Jeremy is after is a fairly common scenario for client-side apps.

Hosting ASP.NET is supported. Microsoft publishes a sample app that does
this - it is called Cassini. It is a WinForms app that serves ASPX and ASMX
content over HTTP. Check for it on www.asp.net . It does not use WSE, but
I believe you can extend it to use WSE if you need the security features of
WSE.

We have an application that sits on a server doing various tasks (this app must run in a logged in user session). I wanted to build in functionality
so that various users could view the status of the application and well as
control the app in various ways, without needing to log on to the server.
Doing it through a web interface seemed like a very intuitive way to do it.
Oooh, now wait a minute. The original request was for a winforms app that
exposes an HTTP endpoint. Now you've reversed it - you want a server app
that shows a GUI. I cannot recommend the "Cassini" approach to do this.

Why not build the server app as a hosted service (or whatever model you
choose - maybe it is an ASMX running in IIS), and then build a winForms GUI
that pings the service periodically and updates its screen? Why bundle the
server and GUI functions?

--D
"Jeremy Chapman" <No****@Please.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... We have an application that sits on a server doing various tasks (this app
must run in a logged in user session). I wanted to build in functionality
so that various users could view the status of the application and well as
control the app in various ways, without needing to log on to the server.
Doing it through a web interface seemed like a very intuitive way to do
it.

"Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
news:87*********************@msnews.microsoft.com. ..
Jeremy Chapman wrote:
> Ok thanks. I've seen this done before, maybe not in .net, bit it can
> be done I'm sure so I'll have to continue hunting for a solution.


Yeah absolutely, it's not like it's impossible or anything. Even with WSE
you could do it if you wanted to get your hands dirty. However there is
no
"out of the box" support for this hosting scenario.

The question I have though is: do you really need it to use the HTTP

protocol
if it's a Windows client application? Are you really acting for a host to
random HTTP clients via the internet at that point? Or are you just

looking
to use the services for some kind of inter-process communication? If the
latter is the case, then the soap.tcp protocol is probably the better

choice
for this problem anyway.

Good luck,
Drew


Nov 21 '05 #10
Dino Chiesa [Microsoft] wrote:
What Jeremy is after is a fairly common scenario for client-side apps.

Hosting ASP.NET is supported. Microsoft publishes a sample app that
does this - it is called Cassini. It is a WinForms app that serves
ASPX and ASMX content over HTTP. Check for it on www.asp.net . It
does not use WSE, but I believe you can extend it to use WSE if you
need the security features of WSE.
Yeah, that's what I recommended originally after realizing I made the mistake:

<snip>
That is of course, unless you host the ASP.NET runtime in your Windows application
yourself with the System.Web.Hosting APIs, but I doubt that's supported or
even recommended. If you *really* want to try going this route I suggest
you search google for custom hosting ASP.NET.
</snip>
Oooh, now wait a minute. The original request was for a winforms app
that exposes an HTTP endpoint. Now you've reversed it - you want a
server app that shows a GUI. I cannot recommend the "Cassini"
approach to do this.

Why not build the server app as a hosted service (or whatever model
you choose - maybe it is an ASMX running in IIS), and then build a
winForms GUI that pings the service periodically and updates its
screen? Why bundle the server and GUI functions?


I don't think he really needs to be showing UI on the server for any particular
reason. His whole problem actually seems to be that he needs to run the host
application in user mode for some reason, as he stated here:

<snip>
We have an application that sits on a server doing various tasks (this app
must run in a logged in user session).
</snip>

Perhaps I'm wrong, but my guess after reading that was that he's probably
using some legacy components that can't be used in a service for whatever
reasons. Jeremy can you give us any more detail so that we might be able
to recommend better solutions?

Side note: I was personally hoping WSE 2.0 SP2 would contain an SoapHttpSysTransport
that hooked up to the HTTP.SYS APIs (as Indigo will) to provide the exact
same support as WSE does for soap.tcp.

Later,
Dre

Nov 21 '05 #11
For all intents and purpose, the 'server' app is no different that any other
client app such as word pad, with the exception that it runs on a server.
In our environment we have a server that always has a user logged on. The
app runs in this session. It must be constantly running, and it must be
running in a user session.

I have successfully referenced the casini dll in my app and it is able to
serve web pages. Although I don't want it to server web pages generically
this is a good start. I have also built test web services and of course it
will serve them up as well by putting the web service dll in my applications
bin directory.

I have two questions:

1) is there any way to eliminate the need for the bin directory? ie, can I
put the casini.dll and my web service dll in the same directory as my
winform application?

2) The web service is a dll that has a public class that inherits from
System.Web.Services.WebService. Is it possible to put this class in my
winforms exe so that I do not require the dll for my web service. I want
all my web service code to be in my winform app. I have tried to do this,
and modified the asmx page so the class tag points to the class in my
winform, but when I try to browse to the asmx page I get a .net error saying
asp.net can't find the class. Can this be done? Essentially I want to
encapsulate all the functionality i need in webservices in my winforms exe
"Dino Chiesa [Microsoft]" <di****@online.microsoft.com> wrote in message
news:el*************@TK2MSFTNGP14.phx.gbl...
[1] That is of course, unless you host the ASP.NET runtime in your Windows application yourself with the System.Web.Hosting APIs, but I doubt that's supported or even recommended. If you *really* want to try going this route
I suggest you search google for custom hosting ASP.NET.


What Jeremy is after is a fairly common scenario for client-side apps.

Hosting ASP.NET is supported. Microsoft publishes a sample app that does
this - it is called Cassini. It is a WinForms app that serves ASPX and

ASMX content over HTTP. Check for it on www.asp.net . It does not use WSE, but I believe you can extend it to use WSE if you need the security features of WSE.

We have an application that sits on a server doing various tasks (this app
must run in a logged in user session). I wanted to build in functionality
so that various users could view the status of the application and well as
control the app in various ways, without needing to log on to the server.
Doing it through a web interface seemed like a very intuitive way to do it.

Oooh, now wait a minute. The original request was for a winforms app that
exposes an HTTP endpoint. Now you've reversed it - you want a server app
that shows a GUI. I cannot recommend the "Cassini" approach to do this.

Why not build the server app as a hosted service (or whatever model you
choose - maybe it is an ASMX running in IIS), and then build a winForms GUI that pings the service periodically and updates its screen? Why bundle the server and GUI functions?

--D
"Jeremy Chapman" <No****@Please.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
We have an application that sits on a server doing various tasks (this

app must run in a logged in user session). I wanted to build in functionality so that various users could view the status of the application and well as control the app in various ways, without needing to log on to the server. Doing it through a web interface seemed like a very intuitive way to do
it.

"Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
news:87*********************@msnews.microsoft.com. ..
Jeremy Chapman wrote:

> Ok thanks. I've seen this done before, maybe not in .net, bit it can
> be done I'm sure so I'll have to continue hunting for a solution.

Yeah absolutely, it's not like it's impossible or anything. Even with WSE you could do it if you wanted to get your hands dirty. However there is
no
"out of the box" support for this hosting scenario.

The question I have though is: do you really need it to use the HTTP

protocol
if it's a Windows client application? Are you really acting for a host to random HTTP clients via the internet at that point? Or are you just

looking
to use the services for some kind of inter-process communication? If the latter is the case, then the soap.tcp protocol is probably the better

choice
for this problem anyway.

Good luck,
Drew



Nov 21 '05 #12
Absolutely Drew, we've written this app around some legacy component which
will not function as a service. We have an account that we use to log on a
user session.
The app we've written is a gui because it allows, through menu items, a user
to stop, start and restart and it shows what it is currently processing.
The idea of it hosting a web service was because I was hoping to be able to
stop, start and restart it through a web app as well as query the app to see
what it is currently processing. A web app would mean zero deployment to
users.
"Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
news:89*********************@msnews.microsoft.com. ..
Dino Chiesa [Microsoft] wrote:
What Jeremy is after is a fairly common scenario for client-side apps.

Hosting ASP.NET is supported. Microsoft publishes a sample app that
does this - it is called Cassini. It is a WinForms app that serves
ASPX and ASMX content over HTTP. Check for it on www.asp.net . It
does not use WSE, but I believe you can extend it to use WSE if you
need the security features of WSE.
Yeah, that's what I recommended originally after realizing I made the

mistake:
<snip>
That is of course, unless you host the ASP.NET runtime in your Windows application yourself with the System.Web.Hosting APIs, but I doubt that's supported or
even recommended. If you *really* want to try going this route I suggest
you search google for custom hosting ASP.NET.
</snip>
Oooh, now wait a minute. The original request was for a winforms app
that exposes an HTTP endpoint. Now you've reversed it - you want a
server app that shows a GUI. I cannot recommend the "Cassini"
approach to do this.

Why not build the server app as a hosted service (or whatever model
you choose - maybe it is an ASMX running in IIS), and then build a
winForms GUI that pings the service periodically and updates its
screen? Why bundle the server and GUI functions?
I don't think he really needs to be showing UI on the server for any

particular reason. His whole problem actually seems to be that he needs to run the host application in user mode for some reason, as he stated here:

<snip>
We have an application that sits on a server doing various tasks (this app
must run in a logged in user session).
</snip>

Perhaps I'm wrong, but my guess after reading that was that he's probably
using some legacy components that can't be used in a service for whatever
reasons. Jeremy can you give us any more detail so that we might be able
to recommend better solutions?

Side note: I was personally hoping WSE 2.0 SP2 would contain an SoapHttpSysTransport that hooked up to the HTTP.SYS APIs (as Indigo will) to provide the exact
same support as WSE does for soap.tcp.

Later,
Drew

Nov 21 '05 #13
Have you considered writing a windows service? You could then run it under any user context that you want and it could be brought
up on the server without having to login a user. Then you can use remoting to connect to some methods on the server and raise
events to control it.

And then, you can also use the Services control panel to remotely connect to the machine and stop, start and restart the service.
"Jeremy Chapman" <No****@Please.com> wrote in message news:uq**************@TK2MSFTNGP12.phx.gbl...
Absolutely Drew, we've written this app around some legacy component which
will not function as a service. We have an account that we use to log on a
user session.
The app we've written is a gui because it allows, through menu items, a user
to stop, start and restart and it shows what it is currently processing.
The idea of it hosting a web service was because I was hoping to be able to
stop, start and restart it through a web app as well as query the app to see
what it is currently processing. A web app would mean zero deployment to
users.
"Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
news:89*********************@msnews.microsoft.com. ..
Dino Chiesa [Microsoft] wrote:
> What Jeremy is after is a fairly common scenario for client-side apps.
>
> Hosting ASP.NET is supported. Microsoft publishes a sample app that
> does this - it is called Cassini. It is a WinForms app that serves
> ASPX and ASMX content over HTTP. Check for it on www.asp.net . It
> does not use WSE, but I believe you can extend it to use WSE if you
> need the security features of WSE.


Yeah, that's what I recommended originally after realizing I made the

mistake:

<snip>
That is of course, unless you host the ASP.NET runtime in your Windows

application
yourself with the System.Web.Hosting APIs, but I doubt that's supported or
even recommended. If you *really* want to try going this route I suggest
you search google for custom hosting ASP.NET.
</snip>
> Oooh, now wait a minute. The original request was for a winforms app
> that exposes an HTTP endpoint. Now you've reversed it - you want a
> server app that shows a GUI. I cannot recommend the "Cassini"
> approach to do this.
>
> Why not build the server app as a hosted service (or whatever model
> you choose - maybe it is an ASMX running in IIS), and then build a
> winForms GUI that pings the service periodically and updates its
> screen? Why bundle the server and GUI functions?


I don't think he really needs to be showing UI on the server for any

particular
reason. His whole problem actually seems to be that he needs to run the

host
application in user mode for some reason, as he stated here:

<snip>
We have an application that sits on a server doing various tasks (this app
must run in a logged in user session).
</snip>

Perhaps I'm wrong, but my guess after reading that was that he's probably
using some legacy components that can't be used in a service for whatever
reasons. Jeremy can you give us any more detail so that we might be able
to recommend better solutions?

Side note: I was personally hoping WSE 2.0 SP2 would contain an

SoapHttpSysTransport
that hooked up to the HTTP.SYS APIs (as Indigo will) to provide the exact
same support as WSE does for soap.tcp.

Later,
Drew


Nov 21 '05 #14
Scott Meddows wrote:
Have you considered writing a windows service? You could then run it
under any user context that you want and it could be brought up on the
server without having to login a user. Then you can use remoting to
connect to some methods on the server and raise events to control it.

And then, you can also use the Services control panel to remotely
connect to the machine and stop, start and restart the service.


Running as a service, even though it would solve the identity issue, will
not give you 100% the same environment as being logged into an interactive
window station. If he could run as a service he'd just be better off hosting
the service in ASP.NET anyway since it's going to provide all the HTTP plumbing
for him. All he'd need to do is set the <identity> up in the web.config of
the service application.

His whole problem is that he's using some legacy components that require
him to be logged into an interactive window station. I've encountered one
of these recently and it's absolutely annoying as hell that they are written
so poorly that they require this, but unfortunately they are out there. :(

-Dre

Nov 21 '05 #15
The app needs more than just a user's context. it has to be visualy present
on the screen.
We have a legacy text based enterprise wide application, what our app does
is script and screen scrape data in/out of this text based app, so it needs
a visual window.

"Scott Meddows" <sc******************@tsged-removeme.com> wrote in message
news:#d**************@tk2msftngp13.phx.gbl...
Have you considered writing a windows service? You could then run it under any user context that you want and it could be brought up on the server without having to login a user. Then you can use remoting to connect to some methods on the server and raise events to control it.

And then, you can also use the Services control panel to remotely connect to the machine and stop, start and restart the service.

"Jeremy Chapman" <No****@Please.com> wrote in message

news:uq**************@TK2MSFTNGP12.phx.gbl...
Absolutely Drew, we've written this app around some legacy component which will not function as a service. We have an account that we use to log on a user session.
The app we've written is a gui because it allows, through menu items, a user to stop, start and restart and it shows what it is currently processing.
The idea of it hosting a web service was because I was hoping to be able to stop, start and restart it through a web app as well as query the app to see what it is currently processing. A web app would mean zero deployment to users.
"Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
news:89*********************@msnews.microsoft.com. ..
Dino Chiesa [Microsoft] wrote:

> What Jeremy is after is a fairly common scenario for client-side apps. >
> Hosting ASP.NET is supported. Microsoft publishes a sample app that
> does this - it is called Cassini. It is a WinForms app that serves
> ASPX and ASMX content over HTTP. Check for it on www.asp.net . It
> does not use WSE, but I believe you can extend it to use WSE if you
> need the security features of WSE.

Yeah, that's what I recommended originally after realizing I made the

mistake:

<snip>
That is of course, unless you host the ASP.NET runtime in your Windows

application
yourself with the System.Web.Hosting APIs, but I doubt that's supported or even recommended. If you *really* want to try going this route I suggest you search google for custom hosting ASP.NET.
</snip>

> Oooh, now wait a minute. The original request was for a winforms app
> that exposes an HTTP endpoint. Now you've reversed it - you want a
> server app that shows a GUI. I cannot recommend the "Cassini"
> approach to do this.
>
> Why not build the server app as a hosted service (or whatever model
> you choose - maybe it is an ASMX running in IIS), and then build a
> winForms GUI that pings the service periodically and updates its
> screen? Why bundle the server and GUI functions?

I don't think he really needs to be showing UI on the server for any

particular
reason. His whole problem actually seems to be that he needs to run the

host
application in user mode for some reason, as he stated here:

<snip>
We have an application that sits on a server doing various tasks (this app must run in a logged in user session).
</snip>

Perhaps I'm wrong, but my guess after reading that was that he's probably using some legacy components that can't be used in a service for whatever reasons. Jeremy can you give us any more detail so that we might be able to recommend better solutions?

Side note: I was personally hoping WSE 2.0 SP2 would contain an

SoapHttpSysTransport
that hooked up to the HTTP.SYS APIs (as Indigo will) to provide the exact same support as WSE does for soap.tcp.

Later,
Drew



Nov 21 '05 #16
Jeremy Chapman wrote:
We have a legacy text based enterprise wide application, what our app
does
is script and screen scrape data in/out of this text based app, so it
needs
a visual window.


Wow that's awesome. I'd definitely love to hear about your progress as you
go on this one, do you have a weblog? :)

Later,
Drew

Nov 21 '05 #17
You could put it in the system tray. I've seen examples of how to interact with services and give them a UI (Although it isn't
recommended)

And if you just need to run the program you could execute it in another process and capture stdout and do your screen scraping
there. You could also execute that program in any user context you need...

Would that work?

"Jeremy Chapman" <No****@Please.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
The app needs more than just a user's context. it has to be visualy present
on the screen.
We have a legacy text based enterprise wide application, what our app does
is script and screen scrape data in/out of this text based app, so it needs
a visual window.

"Scott Meddows" <sc******************@tsged-removeme.com> wrote in message
news:#d**************@tk2msftngp13.phx.gbl...
Have you considered writing a windows service? You could then run it

under any user context that you want and it could be brought
up on the server without having to login a user. Then you can use

remoting to connect to some methods on the server and raise
events to control it.

And then, you can also use the Services control panel to remotely connect

to the machine and stop, start and restart the service.


"Jeremy Chapman" <No****@Please.com> wrote in message

news:uq**************@TK2MSFTNGP12.phx.gbl...
> Absolutely Drew, we've written this app around some legacy component which > will not function as a service. We have an account that we use to log on a > user session.
> The app we've written is a gui because it allows, through menu items, a user > to stop, start and restart and it shows what it is currently processing.
> The idea of it hosting a web service was because I was hoping to be able to > stop, start and restart it through a web app as well as query the app to see > what it is currently processing. A web app would mean zero deployment to > users.
>
>
> "Drew Marsh" <dr****@hotmail.no.spamming.com> wrote in message
> news:89*********************@msnews.microsoft.com. ..
>> Dino Chiesa [Microsoft] wrote:
>>
>> > What Jeremy is after is a fairly common scenario for client-side apps. >> >
>> > Hosting ASP.NET is supported. Microsoft publishes a sample app that
>> > does this - it is called Cassini. It is a WinForms app that serves
>> > ASPX and ASMX content over HTTP. Check for it on www.asp.net . It
>> > does not use WSE, but I believe you can extend it to use WSE if you
>> > need the security features of WSE.
>>
>> Yeah, that's what I recommended originally after realizing I made the
> mistake:
>>
>> <snip>
>> That is of course, unless you host the ASP.NET runtime in your Windows
> application
>> yourself with the System.Web.Hosting APIs, but I doubt that's supported or >> even recommended. If you *really* want to try going this route I suggest >> you search google for custom hosting ASP.NET.
>> </snip>
>>
>> > Oooh, now wait a minute. The original request was for a winforms app
>> > that exposes an HTTP endpoint. Now you've reversed it - you want a
>> > server app that shows a GUI. I cannot recommend the "Cassini"
>> > approach to do this.
>> >
>> > Why not build the server app as a hosted service (or whatever model
>> > you choose - maybe it is an ASMX running in IIS), and then build a
>> > winForms GUI that pings the service periodically and updates its
>> > screen? Why bundle the server and GUI functions?
>>
>> I don't think he really needs to be showing UI on the server for any
> particular
>> reason. His whole problem actually seems to be that he needs to run the
> host
>> application in user mode for some reason, as he stated here:
>>
>> <snip>
>> We have an application that sits on a server doing various tasks (this app >> must run in a logged in user session).
>> </snip>
>>
>> Perhaps I'm wrong, but my guess after reading that was that he's probably >> using some legacy components that can't be used in a service for whatever >> reasons. Jeremy can you give us any more detail so that we might be able >> to recommend better solutions?
>>
>> Side note: I was personally hoping WSE 2.0 SP2 would contain an
> SoapHttpSysTransport
>> that hooked up to the HTTP.SYS APIs (as Indigo will) to provide the exact >> same support as WSE does for soap.tcp.
>>
>> Later,
>> Drew
>>
>
>



Nov 21 '05 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hardy Wang | last post by:
Hi all: I read an article from http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp about how to install a windows service programmatically. Based ont the code...
7
by: Mike | last post by:
I want to create a windows service that will monitor another window service. what i need for the service to do is, if a service is stopped I need it to start the service back up example: ...
9
by: SP | last post by:
Hi All, I wrote a windows service which is supposed to stop after specified amount of time. I am calling OnStop() after specified time. OnStop() methods executed but I dont see the service...
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
2
by: letibal | last post by:
Hello, I have written a windows service and created an installer for it. The service runs under the system accounts. When started, it launches a GUI. By default, the InteractiveProcess property...
4
by: kkt49 | last post by:
# vim: et sw=4 ts=8 sts from wxPython.wx import * import sys, os, time import pywintypes import win32serviceutil import win32service import win32event import win32process
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
3
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
20
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for testing a sample web service application. However, the following line gives a compilation error: localhost.Service1...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.