on 11-28-2006 12:09 PM
Hi,
I want to call ABAP function module using ejb(Since I want to expose them as web service on different server). I know how to do that using Models, but dont know how to go ahead using ejbs.
Could you please guide me on this?
Regards,
Abhijeet.
Hi,
Create an enterprise application (EA) project.
Create an EJB module project.
Add the EJB module to the EA project.
In the EJB module create a session bean.
For each (ABAP) function call create a method on the bean with a similar signature (same import/export parameters).
In the implementation of the bean method you can add coding required for doing backend call (JCO stuff; this is the only part that requires coding, all other actions described here can be done using wizards/templates).
Generate a webservice for each method. (Wizard)
Deploy the EA project (ear file) to WAS. Your webservices should be available.
Good luck!
Roelof
PS You can do it even neater by creating an andditional Java project for the implementation of the backend calls. Then create an interface for the backend calls and make the ejb beans methods implement this interface.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In another thread with a similar question I found these references:
/people/kathirvel.balakrishnan2/blog/2005/07/26/remote-enable-your-rfchosttoip-to-return-host-ip-to-jco
And this code example:
HashMap result = new HashMap();
Object ret = new Object();
JCO.Client mConnection = null;
mConnection = getConnection();
JCO.Repository mRepository;
mRepository = new JCO.Repository("R3", mConnection);
JCO.Function function =
createFunction("Z_ISA_GET_ORDER_ITEM_INFO", mRepository);
function.getImportParameterList().setValue(orderNum, "ORDER");
if (function != null) {
mConnection.execute(function);
JCO.Table codes = function.getTableParameterList().getTable("INFO");
for (int i = 0; i < codes.getNumRows(); i++) {
codes.setRow(i);
int tmp = new Integer(codes.getString("POSNN")).intValue();
String tmpStr = new String(Integer.toString(tmp));
ret = result.put(tmpStr, codes.getString("VBELN"));
}
} else {
System.out.print("Fxn call failed for Z_ISA_GET_ORDER_ITEM_INFO");
}
JCO.releaseClient(mConnection);
Good luck,
Roelof
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.