Re: How to convert a .NET application to webservice?
- From: "John Saunders [MVP]" <john.saunders at trizetto.com>
- Date: Wed, 26 Sep 2007 14:52:05 -0400
<ybi10@xxxxxxxxx> wrote in message news:1190829035.939182.217920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
We have a product implmented with .NET (C#) as an application, it is
released as .exe file plus .dll files. Now we want to make it as
webservices, i.e. to make some of it's methods as webservices.
The questions are, do we have to modify the source code? Or can we
work with the existing .exe and dll files to make them webservices? We
are new to webservices, what will be the best way to complete the task
(making the application to webservices)?
The first thing to do is to design the web service. That is, to decide what part of the existing functionality should be exposed. The obvious answer to this question may not be the best answer.
Using your favorite analysis technique, try to find a set of operations that web service clients would want to use, are course-grained, stateless, and which do not expose details of your implementation.
Then, start by creating the "facade" of the web service. That would be the part that directly interacts with clients over the web.
When you get around to actually implementing the WebMethods of the service, you will find that you want to call some of the existing methods of your ..exe and .dll. If they're in the .dll, you may have nothing else to do other than reference the .dll in the web service project. If there are parts of the .exe that you need to access, then you'll want to refactor those and move them into the .dll (or into another, common .dll).
This way, you'll be creating a web service that your clients want to use, implemented to reuse existing code where possible, while not breaking the existing code.
I strongly recommend against using a rote, mechanical process to design the service. I've seen services which simply exposed all of the methods and properties of the public classes. These services were a mess to use and maintain, as they exposed the details of the original implementation.
Even when a web service is meant to expose all of the functionality of an existing application, it should be designed differently from the existing application. Web services have different needs than a Windows Forms application, for instance. Attempting to force a "round" web service into a "square" windows forms hole will create nothing but pain.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
.
- References:
- How to convert a .NET application to webservice?
- From: ybi10
- How to convert a .NET application to webservice?
- Prev by Date: How to convert a .NET application to webservice?
- Next by Date: add schemaLocation
- Previous by thread: How to convert a .NET application to webservice?
- Next by thread: add schemaLocation
- Index(es):
Relevant Pages
|