Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Transformation of stored procedures to web services?

Now: 1500 well structured stored procedures (T-SQL), each with an external interface consisting of X in parameters and Y result sets.

Tomorrow: 1500 web services based on current T-SQL code.

What is the easiest way to acomplish this transformation if you don't want to rewrite most of the code?

0
OrjanFranzen
Asked:
OrjanFranzen
1 Solution
 
pcazellaCommented:
Using ASP.net, you can define a dataset to return which, when called via SOAP, is an XML stream.
Create a .net page with a <web method> funciton and save it witha .asmx extention.  One of the nice features of using .net for the web services is you can auto-generate the WSDL just by typing "?WSD"L to the end of the url.
Example: HelloWorld.asmx?WSDL

Also note that you can group your stored procedures in "Classes" or collections all on one .asmx

http://www.asp.net/Tutorials/quickstart.aspx

<%@ WebService Language="VB" Class="spCollection" %>
Imports System
Imports System.Web.Services

Public Class HelloWorld :Inherits WebService

     <WebMethod()> Public Function sp_TSQL1(Param1) As Dataset
          'SQL Select statments to return a recordset
          return(DS)
     End Function

   <WebMethod()> Public Function Add(a As Integer, b As Integer) As Integer
       Return(a + b)
   End Function

End Class


Consuming an XML stream in an interface layer is a different topic, here I'm only talking about creating the web service.  I like to use Flash as a GUI, so web services are everything to me.
0
 
COBOLdinosaurCommented:
OrjanFranzen,

Has your question been answered.  Please either accept a comment as the answer, or post a comment to to indicate what additional information is required.

COBOLdinosaur
Page Editor, Web Development Software
0
 
raylewallenCommented:
I'm curious as to why you would take 1500 well structured sps and convert them into something less efficient?  Your not going to take the sql code and move it to something inline in VB are you?  If that is the case, your solution is to not do it all.  Perhaps I am misunderstanding your intentions though.
0
 
OrjanFranzenAuthor Commented:
Agree, that it might sound stupid.

The intention is to use an existing C/S application with sps. The application is logically structured as a 3-tier with a thin client, external sps and internal sps. The external sps that handles business logic has a "client" interface with parameters, result sets and error passing. The internal sps handles database access and are called from the external sps.

It would by nice if we could build a webb interface upon the existing external sps.

If it's possible to call these sps from webb services we could keep the code "as is" and also gain performance. Maybe the problem is how to call sps from a webb service???


0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now