aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Calling a web service from an session bean. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Calling a web service from an session bean." Watch "Calling a web service from an session bean." New topic
Author

Calling a web service from an session bean.

H Krzeszowski
Greenhorn

Joined: Apr 16, 2009
Posts: 3
I have a question about web services and EJB 3.0. I am very new to web services and hence appreciate all help possible. Here is my problem:

I would like to call a web service from a stateless session bean (ejb 3.0) the bean will be running on JBoss. I have the wsdl file defining the web service. I would like to do a solution using annotations and inject the service endpoint interface into my session bean.

Any one having any pointers on how to accomplish this?
Reza Rahman
author
Ranch Hand

Joined: Feb 01, 2005
Posts: 580
    
    5
Take a look here: http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/4.3.0.cp04/html/Server_Configuration_Guide/Server_Configuration_Guide-Web_Service_Clients-WebServiceRef.html.

Cheers,
Reza


Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
H Krzeszowski
Greenhorn

Joined: Apr 16, 2009
Posts: 3
Thanks, though I still do not understand how I create the java interface for the web service I want to call (I am guessing I still need to create the corresponding java interface for the wsdl file).

I have tried to generate java code using wsdl2java (the Axis 2 program) but that gives me a bunch of java files that depend on other classes such “as org.apache.axis2.databinding.ADBBean”. I was hoping to be able to skip those parts and be able to call a web service just using a wsdl file and jboss without having to find all the jar-files necessary to solve all apache.axis2 dependencies.

I thought the process was:
1. Create a java interface for the web service (Still don’t know how to do this in an easy way from the wsdl file).
2. Inject the created java interface into the session bean
3. Use the interface to call the web service methods.

As I said before I am very new to web services and I am probably missing some steps?
H Krzeszowski
Greenhorn

Joined: Apr 16, 2009
Posts: 3
Anyone who can give me some more info about this?
 
 
subject: Calling a web service from an session bean.