Skip to Content
0
Former Member
Apr 01, 2011 at 09:22 AM

Java Connector for Netweaver 7.11

29 Views

Hi,

looking at the code of an EJB that makes calls to the SAP backend systems, I've noticed that the classes that have been used are deprecated:

String returnMsg="";                                                                                
JCO.Client clientConnection = null;                                                                           
try {                                                                                
//creating jco client                                                                                
JCO.Client jcoclient = null;                                                                                
//using existing jco from portal "WD_MODELDATA_DEST" which is connected to                                  
	//required backend SAP system                                                                                
Context ctx = new InitialContext();                                                                         
	DestinationService dstService = (DestinationService) ctx.lookup(DestinationService.JNDI_KEY);                                                                                
if (dstService == null) {                                                                                
throw new NamingException("Destination Service not available");                                           
	}                                                                                
RFCDestination dst = (RFCDestination) dstService.getDestination("RFC", JCO_MODELDATA);                    
    Properties jcoProperties = dst.getJCoProperties();                                                        
    clientConnection = JCO.createClient(jcoProperties);                                                       
    clientConnection.connect();                                                                                
JCO.Repository repository = new JCO.Repository("REP_CHECK_BPM_ACT", clientConnection);                    
	IFunctionTemplate ift = repository.getFunctionTemplate("ZMCTBPM_WS_VERIFICA_TASK");                                                                                
JCO.Function functionCheckBpmActiv = new JCO.Function(ift);                                                 
	JCO.ParameterList paramImport = functionCheckBpmActiv.getImportParameterList();                             
	JCO.ParameterList paramExport = functionCheckBpmActiv.getExportParameterList();                             
	JCO.ParameterList paramTables = functionCheckBpmActiv.getTableParameterList();

In particular the JCO class is marked as deprecated. I'm using Netweaver 7.11.

What classes should I use in order to obtain the same result (call an RFC from an EJB)?

Can someone provide me with a simple example on how to set up an RFC call?

Thank you,

Pietro