What is the easiest way to port a stored procedure to a web service?

We have a Legacy system that contains several stored procedures that we would like to provide to other applications as web services. We create web services using JBoss. Stored procedures can be executed from Oracle, DB2, or MS SQL Server databases.

JDeveloper has a wizard for creating stubs and deploying to an ear file that will run on Oracle Application Server (OC4J). We are in the process of transitioning to JBoss and are using Eclipse as our development environment.

I would rather use a structure and then rebuild and maintain the infrastructure myself. Ideally, I would like to use the open source library or the JBoss / IDE tool to create a web service based on the connection pool definition and stored procedure name.

What are my options?

+3
source share
5 answers

I'm not sure that you will find exactly what you are looking for, so if you write something by itself, here are two alternatives:

  • Use a universal web service that gets the SP name, parameters, and calls the procedure. This is not very friendly to the caller, not to the type, but it will do its job.

  • . - Java- (POJO EJB). - -, Apache Axis2, , .

SP EJB, . , , . , .

+1

-, . , , .

API . , - , . , - , , .

, , - , , .

+4

EJB. J2EE 1.4 JSR 109, EJB -.

, EJB , EJB -.

OC4J 10.1.3 JBoss 4 . J2EE 1.4 . , ( ) .

+2

( Apache), Data Services WS02. - ? //?

+1

JBoss EJB3 bean. , , ( , ..).

@WebService
@SOAPBinding(style = Style.RPC)
public interface StoredProcedureWrapper extends Remote {
        String invokeStoredProc();
}

@Stateless
@WebService(endpointInterface = "path.to.StoredProcedureWrapper")
@Remote(StoredProcedureWrapper.class)
public class StoredProcedureWrapperBean {
        public String StoredProcedureWrapper() {
                // do business logic
                return "success";
        }
}
+1

Source: https://habr.com/ru/post/1706116/


All Articles