Skip to main content

Web service accessing RA (Solved)

3 replies [Last post]
robvanderwiele
Offline
Joined: 2007-08-29
Points: 0

Hello,

I'm trying to access an RA from a web service (via SOAP), I'm using the code below:

@WebService
public class SysMx
{
@WebMethod
@WebResult(name = "Status")
public int callAnswer(
@WebParam(name = "MessId") int messId,
@WebParam(name = "Id") String Id,
@WebParam(name = "DoAnalyze") boolean doAnalyze,
@WebParam(name = "Prompt") String prompt)
{
try
{
Context ctx = (Context) new InitialContext().lookup("java:comp/env");

WSResourceEntryPoint resourceEntryPoint = (WSResourceEntryPoint) ctx.lookup("slee/resources/SysmxRA/ws-resource-entry-point");
SysmxResourceAdaptor sysmxRa = resourceEntryPoint.getSysmxRA();
SleeEndpoint sleeEndpoint = sysmxRa.getSleeEndpoint();
EventLookupFacility eventLookup = sysmxRa.getEventLookup();
.....

When the function is called I got an naming exception on ctx.lookup("slee/resources/SysmxRA/ws-resource-entry-point");
The message is 'Slee not bound', in the RA I'm using SleeContainer.registerWithJndi(prefix, name, this.resourceEntryPoint);
I checked in the JNDI if the entry is created and it is.
How should I bind the web service to SLEE?

Rob

Message was edited by: robvanderwiele

Message was edited by: robvanderwiele

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
robvanderwiele
Offline
Joined: 2007-08-29
Points: 0

I already found my mistake. I changed the two lines of code:

Context ctx = (Context) new InitialContext().lookup("java:comp/env");
WSResourceEntryPoint resourceEntryPoint = (WSResourceEntryPoint) ctx.lookup("slee/resources/SysmxRA/ws-resource-entry-point");

to:

Context ctx = (Context) new InitialContext();
WSResourceEntryPoint resourceEntryPoint = (WSResourceEntryPoint) ctx.lookup("java:slee/resources/SysmxRA/ws-resource-entry-point");

and now it is working ok.

Rob

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

The http servlet RA has a Servlet that retreives an RA entrypoint from JNDI, check it out.

robvanderwiele
Offline
Joined: 2007-08-29
Points: 0

Hello Eduardo,

I looked at that example to implement this functionality, maybe I missed something there.