473,623 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A web service inside a windows service?

Is there a way to have a windows service instantiate a class that is a web
service, which will then be accessible to clients via HTTP?

Thanks,

-Mike

Nov 16 '05 #1
12 5185
I don't think a web service is internally capable of doing all the work.
I.e., it doesn't have the socket listening/request queuing code, it just
knows how to handle a request once one is handed to it. It still needs
to be hosted by some kind of web server, normally IIS, but you may be
able to modify the Cassini server to create something that could be
fully self-contained within a windows service:

http://www.asp.net/Default.aspx?tabindex=7&tabid=41

-Jason

Michael Riggio wrote:
Is there a way to have a windows service instantiate a class that is a web
service, which will then be accessible to clients via HTTP?

Thanks,

-Mike

Nov 16 '05 #2
This is a great start, thanks for the information!! Cassini seems pretty
straight forward (I'm stepping through the debugger), though it would be
really cool if it was a bit more simpler such that anyone can roll out their
own solution with relative ease.

Thanks!
"Jason DeFontes" <ja***@defontes .com> wrote in message
news:uM******** ******@tk2msftn gp13.phx.gbl...
I don't think a web service is internally capable of doing all the work.
I.e., it doesn't have the socket listening/request queuing code, it just
knows how to handle a request once one is handed to it. It still needs
to be hosted by some kind of web server, normally IIS, but you may be
able to modify the Cassini server to create something that could be
fully self-contained within a windows service:

http://www.asp.net/Default.aspx?tabindex=7&tabid=41

-Jason

Michael Riggio wrote:
Is there a way to have a windows service instantiate a class that is a web service, which will then be accessible to clients via HTTP?

Thanks,

-Mike

Nov 16 '05 #3
Well, I'm not sure how much simpler you'd want it to be. Start IIS, drop
web service in wwwroot, go home. You're the one that wants to run it
from inside a Windows service, when it wasn't designed to work that way.
Your pain is self-inflicted.

Best of luck,

-Jason

Michael Riggio wrote:
This is a great start, thanks for the information!! Cassini seems pretty
straight forward (I'm stepping through the debugger), though it would be
really cool if it was a bit more simpler such that anyone can roll out their
own solution with relative ease.

Thanks!
"Jason DeFontes" <ja***@defontes .com> wrote in message
news:uM******** ******@tk2msftn gp13.phx.gbl...
I don't think a web service is internally capable of doing all the work.
I.e., it doesn't have the socket listening/request queuing code, it just
knows how to handle a request once one is handed to it. It still needs
to be hosted by some kind of web server, normally IIS, but you may be
able to modify the Cassini server to create something that could be
fully self-contained within a windows service:

http://www.asp.net/Default.aspx?tabindex=7&tabid=41

-Jason

Michael Riggio wrote:

Is there a way to have a windows service instantiate a class that is a
web
service, which will then be accessible to clients via HTTP?

Thanks,

-Mike


Nov 16 '05 #4
Why not just use remoting?

"Michael Riggio" <mi************ @unisys.nospam. com> wrote in message
news:O#******** *****@TK2MSFTNG P11.phx.gbl...
Is there a way to have a windows service instantiate a class that is a web
service, which will then be accessible to clients via HTTP?

Thanks,

-Mike

Nov 16 '05 #5
Isn't Remoting a different solution to that provided by Web Services? WS can
accept any SOAP client but Remoting requires (IIRC) .NET on the client.

"Ray Cassick (Home)" <rc************ @enterprocity.c om> wrote in message
news:OZ******** ******@TK2MSFTN GP11.phx.gbl...
Why not just use remoting?

"Michael Riggio" <mi************ @unisys.nospam. com> wrote in message
news:O#******** *****@TK2MSFTNG P11.phx.gbl...
Is there a way to have a windows service instantiate a class that is a web service, which will then be accessible to clients via HTTP?

Thanks,

-Mike



Nov 16 '05 #6
Web Services are implementations of remoting. They are wrappers around the
remoting classes but they use the same remoting classes you would use are
used by web services.

Which is also the answer to your question. Your Windows service can
absolutely consume web services. Just remember that Windows services often
do not have a user account and if your web service is on a different server,
and doesn't have anonymous access allowed, you will get access denied unless
you assign a domain account for your Windows service to run under.

Dale

"DM McGowan II" <no****@nospam. net> wrote in message
news:up******** ************@co mcast.com...
Isn't Remoting a different solution to that provided by Web Services? WS can accept any SOAP client but Remoting requires (IIRC) .NET on the client.

"Ray Cassick (Home)" <rc************ @enterprocity.c om> wrote in message
news:OZ******** ******@TK2MSFTN GP11.phx.gbl...
Why not just use remoting?

"Michael Riggio" <mi************ @unisys.nospam. com> wrote in message
news:O#******** *****@TK2MSFTNG P11.phx.gbl...
Is there a way to have a windows service instantiate a class that is a web service, which will then be accessible to clients via HTTP?

Thanks,

-Mike


Nov 16 '05 #7
Web services are really just a remoted service hosted within IIS. They use
IIS as a transport (HTTP CHannel) and to manage the connections. Other than
that there is really very little difference. The major difference is that
web services are only allowed to use the SOAP Format for communications
while remoting can use either SOAP or a binary formatter.

You can write a remoted service, telkl it to use the SOAP formatter and the
HTTP channel and it is baisicaly a web service.

Personally, unless you are planning to exspose the service externally
(outside the enterprise) use remoting with the binary formatter. Faster,
less connecton overhead and IMHO a bit more secure because you don;t need a
machine running IIS to host it. You can just write a windows service.

Here is *some* links that show the differecnes:

http://www.developer.com/net/net/art...1087_2201701_1

http://dotnetjunkies.com/WebLog/chri...1/31/6385.aspx
"DM McGowan II" <no****@nospam. net> wrote in message
news:up******** ************@co mcast.com...
Isn't Remoting a different solution to that provided by Web Services? WS can accept any SOAP client but Remoting requires (IIRC) .NET on the client.

"Ray Cassick (Home)" <rc************ @enterprocity.c om> wrote in message
news:OZ******** ******@TK2MSFTN GP11.phx.gbl...
Why not just use remoting?

"Michael Riggio" <mi************ @unisys.nospam. com> wrote in message
news:O#******** *****@TK2MSFTNG P11.phx.gbl...
Is there a way to have a windows service instantiate a class that is a web service, which will then be accessible to clients via HTTP?

Thanks,

-Mike


Nov 16 '05 #8

"Ray Cassick (Home)" <rc************ @enterprocity.c om> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Web services are really just a remoted service hosted within IIS. They use
IIS as a transport (HTTP CHannel) and to manage the connections. Other than that there is really very little difference. The major difference is that
web services are only allowed to use the SOAP Format for communications
while remoting can use either SOAP or a binary formatter.

You can write a remoted service, telkl it to use the SOAP formatter and the HTTP channel and it is baisicaly a web service.


There are some fundamental differences between .NET remoting and Web
services,
so I would not go as far as calling Web services just another way of doing
remoting.

One big difference is that with remoting the end points share types. Both
remoting
parties typically have a copy of an assembly that contains the shared types.
..NET remoting
infrastructure serilizes and deserializes instances of these types while
they are on the wire.

Web services and their consumers, on the other hand, exchange XML messages.
These
messages can be mapped to and from objects in the end points, but the
difference is that
the Web service and the consumer typically do not have a shared assembly
containing the
types.

This is a big difference because it has implications on e.g., how the
communication
endpoints can evolve over time. Another difference is that Web services are
more
message-oriented than based on the notion of calling methods remotely.

Web services also provide security (WS-Security) and other infrastructure
that .NET
remoting does not provide. This functionality is already available with Web
Services
Enhancements (WSE). With remoting, you'd have to implement most of that
stuff on
your own.

Regards,
Sami

Nov 16 '05 #9
I researched this recently then created a small benchmark to compare the
performance of Remoting SOAP to Remoting Binary.

Firstly, Remoting SOAP is not 100% compatible with Web Service SOAP and
there is more overhead in the case where you can coax it to work. This is
documented in numerous articles on the Web.

Next, I found Remoting SOAP to be a minimum of 5 times slower than Remoting
Binary so I agree that within the enterprise, binary is the best option
unless the design can't afford to have all clients tied to the .NET
Architecture which would put you back in Web Services. True Web Services not
Remoting pseudo web services.

Overall I'd say that Michael is right to start with the Cassini source and
design a solution from there.

"Ray Cassick (Home)" <rc************ @enterprocity.c om> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Web services are really just a remoted service hosted within IIS. They use
IIS as a transport (HTTP CHannel) and to manage the connections. Other than that there is really very little difference. The major difference is that
web services are only allowed to use the SOAP Format for communications
while remoting can use either SOAP or a binary formatter.

You can write a remoted service, telkl it to use the SOAP formatter and the HTTP channel and it is baisicaly a web service.

Personally, unless you are planning to exspose the service externally
(outside the enterprise) use remoting with the binary formatter. Faster,
less connecton overhead and IMHO a bit more secure because you don;t need a machine running IIS to host it. You can just write a windows service.

Here is *some* links that show the differecnes:

http://www.developer.com/net/net/art...1087_2201701_1

http://dotnetjunkies.com/WebLog/chri...1/31/6385.aspx
"DM McGowan II" <no****@nospam. net> wrote in message
news:up******** ************@co mcast.com...
Isn't Remoting a different solution to that provided by Web Services? WS

can
accept any SOAP client but Remoting requires (IIRC) .NET on the client.

"Ray Cassick (Home)" <rc************ @enterprocity.c om> wrote in message
news:OZ******** ******@TK2MSFTN GP11.phx.gbl...
Why not just use remoting?

"Michael Riggio" <mi************ @unisys.nospam. com> wrote in message
news:O#******** *****@TK2MSFTNG P11.phx.gbl...
> Is there a way to have a windows service instantiate a class that is
a web
> service, which will then be accessible to clients via HTTP?
>
> Thanks,
>
> -Mike
>
>
>



Nov 16 '05 #10

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

Similar topics

11
2259
by: Michael Riggio | last post by:
Is there a way to have a windows service instantiate a class that is a web service, which will then be accessible to clients via HTTP? Thanks, -Mike
6
25196
by: Dmitri Shvetsov | last post by:
Hi All, Did somebody see the situation when the VS refuses to debug the Web Service at all? I can't catch why, the initially created Web Service can be debugged very easy but after some changes in a source code, maybe the source code becomes bigger that some hidden threshold, the debugger can't enter into this code anymore. I can use this web service, all methods but can't see in debugger what's going on. I have already catched this...
2
2923
by: Neslihan ERDEM | last post by:
Every body Hi first of all I say Why do I need Windows Service / Every Day I create XML file . I writed a XML web service And .I join this servis Windows service. I create Windows Service that I call method XML Web Service . My Problem I generate Windows Service but I want this service always run . But I dont make it
0
2163
by: Jonathan G. | last post by:
I'm writing my first windows service. I have a class called 'mainprocess' whose constructor is called by the service class. Within mainprocess, I declare an instance of another class I wrote, called DBHandler, which does all of my Sql Database work. I have LogEvents everywhere and notice that the thread never gets inside the DBHandler constructor. Instead, it throws this error as a new instance of the DBHandler class is declared:...
4
4792
by: Julia | last post by:
Hi, I have two application which 'evaluate'( New FileStream(path....) relative path, when evaluating the path inside a window service it always return something like C:\\WINNT\SYSTEM32\MyPath While when evaluating it in a window application I get the correct path
8
2446
by: Julia | last post by:
Hi, My client uses a remote object when I host the remote object inside a windows application all seem to work fine but when I host the same object inside a windows service I get the following error " connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because
11
14951
by: Frank Rizzo | last post by:
Hello, My c# based windows service takes a while to dispose. I have to release bunch of resources all over the place and unfortunately it can take 20-40 seconds before I can cleanly exit. Every now and then, when I stop the service from the Services applet, it will timeout and bring up an error message saying that the service isn't responding.
2
4562
by: JD | last post by:
Hello, I'm experiencing a problem that I'm hoping someone might be able to shed some light on. I have an ASP.NET page on a Windows 2000 machine that makes web service calls to a .NET web service. Once in a while the ASP.NET process gets to a state where the web service call to the web service hangs and then does a timeout. While the ASP.NET process is in this state, looking at the TCP connections, the TCP connection never shows up for...
7
3187
by: Sunil Varma | last post by:
Hello all, I wrote a Windows Service in VC.NET 2005 I want to debug the solution. I tried as mentioned in the following link. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconintroductiontontserviceapplications.asp But, when I started the service I got a message box saying that the service is being stopped.
3
5192
by: IsRaEl | last post by:
Helly guys... Anyone know's how to call a Form from inside a Windows Service Project?? Thanks in advance...
0
8165
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8326
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8469
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6106
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2602
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1473
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.