tags:

views:

73

answers:

4

a. What are the things I must consider? b. I have several Stored Procedures being execute by the current application. If I create equivalent methods to execute these procedures, what would be the risk or the challenge.

+2  A: 

Architecturally, one thing you must consider in transforming a web app to a web service is that local access to methods and data is not the same as remote access. Remote access should be designed so that invocations are more course-grained and exchange more information at once.

Another thing you would need to think about is what your serialization protocol you will use. For example, SOAP vs a REST-based protocol.

Also, think about security - the security considerations are different between a web application and a web service.

Finally, think about how others will know about your web service (or if they will at all).

James Kingsbery
A: 

One risk is ensuring that your code remain the same.

What I mean by this is that there is a distinct possibility of code duplication in this situation, and as such means that you may inadvertently forget to modify one of the places where the Stored Procedure is used (say if you add a new variable to the stored proc call).

Then you also must consider security. For example, exposing a web service call that provides a list of users to the wild is probably not that good of an idea. you need to plan for how you're going to pass/receive authentication & authorization information.

Stephen Wrighton
A: 

Managing your code base as Stephen said is going to be a big challenge if you create equivlant methods. Your much better off extrapolating the methods into a new library, that both the web application and web service will use. Your web apps shouldn't have any data access code in them.

With a web service you need to consider your clients. Who is going to access your data and from where. If for example its from a .net windows client on the same network or machine a TCP binding might be best. Or if you need to support older .net framework clients or even java clients you need to be careful about what technology you use.

You will also want to choose between WCF or ASMX. Which the previous paragraph shouuld help answer.

JoshBerke
A: 

It seems to me that the greatest challenge will be that you are obviously tempted to do this. I think you're making a mistake.

Your web application, and the web service you propose, have different requirements. By "transforming" the application into the service, you will burden the service with the requirements of the application.

Here's a "thought experiment": what if you were to write the service from scratch, ignoring the application. How similar would the service and application be? If they would wind up alike, then transformation would make sense. Otherwise, not so much.

John Saunders