aspose file tools*
The moose likes Web Services and the fly likes invoking ejb through web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "invoking ejb through web service" Watch "invoking ejb through web service" New topic
Author

invoking ejb through web service

AjayChawla Chawla
Greenhorn

Joined: May 24, 2004
Posts: 2
Hi, I've deployed a webservice (a simple java class) on weblogic7.1.
This java class tries to invoke a session ejb(which i've deplyed as a seperate jar), but it gives a runtime error :

Failed to invoke service:
javax.xml.rpc.soap.SOAPFaultException: com.sessiontest.TestWebServiceHome

my java class is :

try
{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL,"t3://localhost:7001");
InitialContext ctx=new InitialContext(p);
System.out.println("1");
Object objhome = ctx.lookup("TestWebService");
System.out.println("2");
TestWebServiceHome testwebhome =(TestWebServiceHome)PortableRemoteObject.narrow(objhome,TestWebServiceHome.class);
System.out.println("3");
TestWebServiceRemote testweb = (TestWebServiceRemote)PortableRemoteObject.narrow(testwebhome.create(),TestWebServiceRemote.class);
System.out.println("4");
int cnt = testweb.method1("FAST");

System.out.println("return from EJB :"+cnt);
}
catch(Exception ex)
{
System.out.println("XXX"+ex.getMessage());
}

String returnValue = "This message brought to you by the "+
"letter "+s+" and the number "+num;

return returnValue;


need uor help people,
Thanks
Ajay
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by AjayChawla Chawla:
catch(Exception ex)
{
System.out.println("XXX"+ex.getMessage());
}



Ajay!. Welcome to Javaranch!.
Can you post the complete error message..
Also, are you able to call this ejb(testweb.method1()) from the normal java client ?


Spritle Software Blogs
AjayChawla Chawla
Greenhorn

Joined: May 24, 2004
Posts: 2
Hi Balaji,

the code --
catch(Exception ex)
{
System.out.println("XXX"+ex.getMessage());
}

dosn't gets printed.

The exception "javax.xml.rpc.soap.SOAPFaultException: com.sessiontest.TestWebServiceHome"

gets printed on the browser when I try to invoke the web service through a web client(the default client that is created when I use the 'servicegen' ant task).

Also, Iam able to access the ejb through a normal java client.

I've developed the web service using the 'servicegen' ant task.
 
 
subject: invoking ejb through web service
 
Similar Threads
Session facade
Exception in client program of ejb using weblogic5.1
Sybase JNDI lookup woes
error while running Client in Eclipse helios
Dependency INjection through Annotations