cancel
Showing results for 
Search instead for 
Did you mean: 

Creating web service from session bean

Former Member
0 Kudos

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

}

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (1)

Answers (1)

Former Member
0 Kudos