on 07-09-2008 5:31 AM
We have a scenario as described below:
We have to make a web service from the session bean.The session bean contains methods which add,delete , update and display the records from the dict table on the UI of webdynpro.
We r pasting the code of session bean below
Cud someone help us out with coding of methods in session bean
******SESSION BEAN CODE****************
public class MM03_SessionBean implements SessionBean {
MM03_EntityLocal local = null;
MM03_EntityLocalHome lchome = null;
public void ejbRemove() {
}
public void ejbActivate() {
}
public void ejbPassivate() {
}
public void setSessionContext(SessionContext context) {
myContext = context;
}
private SessionContext myContext;
/**
Business Method.
*/
public void addrecords(
String matnr,
String maktx,
String mtart,
String matkl) {
// TODO : Implement
try {
MM03_EntityLocalHome h1 = null;
MM03_EntityLocal local = h1.create(matnr,maktx,mtart,matkl);
} catch (CreateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
Business Method.
*/
public void updateRecords(
String matnr,
String maktx,
String mtart,
String matkl) {
// TODO : Implement
try {
local = lchome.findByPrimaryKey(matnr);
local.remove();
MM03_EntityLocal local = lchome.create(matnr,maktx,mtart,matkl);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
Business Method.
*/
public void deleteRecords(String matnr) {
// TODO : Implement
try {
local = lchome.findByPrimaryKey(matnr);
local.remove();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
Business Method.
*/
public void showRecords() {
// TODO : Implement
}
/**
Create Method.
*/
public void ejbCreate() throws CreateException {
try {
InitialContext ctx = new InitialContext();
MM03_EntityLocalHome home = (MM03_EntityLocalHome)ctx.lookup("java:comp/env/ejb/MM03_EntityBean");
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// TODO : Implement
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.