cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Destination in WAS sp12

Former Member
0 Kudos

Hi All,

I am using WAS 6.4 with sp12 which supports RFC destination.

I have created a EJb which is internally using JCo to connect to SAP R/3. I am using RFC Destination for passing login information to SAP R/3. I have exposed this EJb as web service.

Now in EJb i have following code

<b>InitialContext ctx = new InitialContext();

obj = ctx.lookup(DestinationService.JNDI_KEY);

<i>DestinationService dstService = (DestinationService) obj;</i>

RFCDestination dst = (RFCDestination) dstService.getDestination("RFC", "<System ID>");

Properties jcoProperties = dst.getJCoProperties();

JCO.Client client = JCO.createClient(jcoProperties);

</b>

But when i execute the code it give Exeception in EJb that in could not type cast the obj into DestinationService Object. when i check the Object return by ctx.lookup it is of type proxy

I have taken above code from the location

http://help.sap.com/saphelp_nw04/helpdata/en/17/d609b48ea5f748b47c0f32be265935/content.htm

Why am not able to type cast the object?.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member192152
Active Participant
0 Kudos

Hi Divyakumar Jain,

I am having the same problem as you!

I need to call an RFC out either through EJB hosted on a different WebAS instaces of the instance portal which will consume this webservice.

I wonder if you could kindly send me your EJB project, because I do not have that kind of know-how development.

I thank your attention.

regards,

Angelo

martijndeboer
Advisor
Advisor
0 Kudos

For an answer see: