all groups > dotnet web services > january 2008 >
You're in the

dotnet web services

group:

Can you create a VISIBLE System.Windows.Forms.Form in a webservice?


Can you create a VISIBLE System.Windows.Forms.Form in a webservice? jojoba@gmail.com
1/18/2008 11:16:00 AM
dotnet web services: Hi,

I am trying to create a .net webservice such that:
When a user calls the service, the server creates a
System.Windows.Forms.Form
and shows it on the server screen. I know this sounds bizarre, but i
do have a good reason for doing this.

I can get the following to work when i run the service in Visual
Studio (c#):

System.Windows.Forms.Form VisibleForm = new
System.Windows.Forms.Form();
VisibleForm.Show();
VisibleForm.Activate();

But when i publish it and call the service remotely, the window fails
to appear on the server screen.
Darn, so close.

Any thoughts?
Thank you to all,
Re: Can you create a VISIBLE System.Windows.Forms.Form in a webservice? jojoba@gmail.com
1/18/2008 12:33:27 PM

Thank you!


However, I was hoping to NOT have to call a separate application. That
is, I would like to create a Form, within the webservice [WebMethod]
and NOT have to have created a separate desktop application which is
then called.
Is this possible?
I know it sounds loony, but I have a decent reason for doing this.

=)

thank you for your help,
matt

Re: Can you create a VISIBLE System.Windows.Forms.Form in a webservice? jojoba@gmail.com
1/18/2008 12:37:53 PM
Ok, after rereading your comment:


Yep, I understand now what you were saying:
Write a desktop app, which has in its belly the webservice...
That's a great idea.
But is the flipside possible
Having a windows form in the belly of a webservice?

thanks,
Re: Can you create a VISIBLE System.Windows.Forms.Form in a webservice? Spam Catcher
1/18/2008 8:19:51 PM
jojoba@gmail.com wrote in news:a58f1908-e155-4818-abd2-e9957ada1893
@d21g2000prf.googlegroups.com:

[quoted text, click to view]

Yes, this is possible - in fact relatively straight forward if you have
experience with Remoting or WCF.

With ASP.NET 2.0 Web Services, you should create two applications, a
desktop application and the web service.

The web service will initiate a remoting call to the desktop application
which then pops the form.

In .NET 3.0/3.5, web services can be hosted in any application, in this
case, you can create a desktop application that hosts a web service.
Requests would connect directly to the application and pop a screen.
However, it's probably better to have two components (web service, client)
- this way if the desktop component is offline, you can return a proper
error code to the calling application.

--
Re: Can you create a VISIBLE System.Windows.Forms.Form in a webservice? Spam Catcher
1/18/2008 8:46:39 PM
jojoba@gmail.com wrote in news:ec930734-0f82-4aec-9e44-
fd42794a9faa@h11g2000prf.googlegroups.com:

[quoted text, click to view]

Use .NET 3.0/3.5 and use ServiceHost to host your web service in a Windows
Form application.


[quoted text, click to view]

Yes definately looney - you should consider creating two application, your
app will scale much better.



--
Re: Can you create a VISIBLE System.Windows.Forms.Form in a webservice? Spam Catcher
1/18/2008 8:47:55 PM
jojoba@gmail.com wrote in news:0cbb61df-4c64-4beb-bc21-2f5db908a1b8
@m34g2000hsf.googlegroups.com:

[quoted text, click to view]

I don't know - but I'm 99.999% sure it's highly NOT recommended ;-)

--
Re: Can you create a VISIBLE System.Windows.Forms.Form in a webservice? Nick Bennett
1/20/2008 4:07:21 AM
Maybe the fact that you want to create a window is a sign that Web Services
are the wrong tool for the job.

Nick



[quoted text, click to view]

AddThis Social Bookmark Button