You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Vivek Nagulapati <vi...@ksu.edu> on 2004/02/10 06:27:08 UTC

Stateless Session Bean as a webservice client

Hello Guys,

I deployed a SLSB - Stateless session bean as a webservice client which 
accesses a webservice implemented in .NET technologies. Well, I was successful 
in deploying the bean in the application server which is JBoss 3.2.1 but 
somehow I could not make it to work.

I configured Axis 1.1 with JBoss and generated the necessary stubs to access 
the webservice using the WSDL2Java tool

Here is the code snippet from my SLSB which accesses the webservice

--------------------------

//Make a service using ServiceLocator
    AdminWebService admin = new AdminWebServiceLocator();
   
//Get the stub using the Service
AdminWebServiceSoap adminStub = admin.getAdminWebServiceSoap();

//Call a test method on Webservice

   try
      {
        System.out.println("Result is: " + adminStub.checkLogin("xyz"));
      }
   catch(Exception e)
     ..........
     ..........
--------------------------

In the above code,

i) AdminWebService
ii) AdminWebServiceLocator
iii)AdminWebServiceSoap

are the classes which were automatically generated by the WSDL2Java tool.

When running the SLSB client, I am getting the following error,

------------------------------------
java.rmi.ServerException: RemoteException occurred in server thread; nested 
exception is: java.rmi.ServerError: Unexpected Error; nested exception is:

java.lang.NoClassDefFoundError: AdminClient/AdminWebServiceLocator
-------------------------------------

Somehow the application server is not recognizing the AdminWebServiceLocator 
class even though I have it packaged in the SLSB jar file.

The interesting part is, if I code a stand-alone webservice client in the same 
manner using the stub classes generated by the WSDL2Java instead of SLSB as a 
webservice client I was able to get it to work.

Any pointers? Could someone please point me to any tutorials which show how an 
EJB can access a webservice using WSDL2Java tool generated stub classes.....

Thanks a lot in advance,
Vivek