wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes Can't figure out how EJb 2.1 SLSB method is exposed as web-service 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 "Can Watch "Can New topic
Author

Can't figure out how EJb 2.1 SLSB method is exposed as web-service

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Hi,


I have an EJB2.1 Stateless Session bean with one of it's methods being called by a web-service.The thing that is bugging me is that I checked the ejb-jar.xml and didn't see any other interface declarations except 'Remote' and 'Local'.Shouldn't one have like 'Web Service' or something like the EJB3 web service annotation?

Or maybe I'm really confused and it's calling the web-service?And I don't see the right WSDL for the web-service.The web-service apparently lives in a different (web?) application.


===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
yep, there should be a service-endpoint tag in that ejb-jar.xml, if the ejb is to service soap requests, so maybe some other component of your app is doing that and delegating to that ejb you mention.

I took this from the 2.1 spec, for your information:

7.11.9 Session Bean’s Web Service Endpoint Interface
The following are the requirements for a stateless session bean’s web service endpoint interface. The
web service endpoint interface must follow the rules for JAX-RPC service endpoint interfaces [22].
• The web service endpoint interface must extend the java.rmi.Remote interface.
• The methods defined in the interface must follow the rules for JAX-RPC service endpoint
interfaces. This means that their argument and return values must be of valid types for
JAX-RPC, and their throws clauses must include the java.rmi.RemoteException.
The throws clause may additionally include application exceptions.
Note that JAX-RPC Holder classes may be used as method parameters. The JAX-RPC specification
requires support for Holder classes as part of the standard Java mapping of WSDL
operations in order to handle out and inout parameters. Holder classes implement the
javax.xml.rpc.holders.Holder interface. See the JAX-RPC specification [22] for
further details.
• For each method defined in the web service endpoint interface, there must be a matching
method in the session bean’s class. The matching method must have:
• The same name.
• The same number and types of arguments, and the same return type.
• All the exceptions defined in the throws clause of the matching method of the session
bean class must be defined in the throws clause of the method of the web service
endpoint interface.
• The web service endpoint interface must not include an EJBObject or EJBLocalObject as
either a parameter or return type. An array or JAX-RPC value type must not include an
EJBObject or EJBLocalObject as a contained element. The web service endpoint interface
methods must not expose local or remote interface types, local or remote home interface types,
timers or timer handles, or the managed collection classes that are used for entity beans with
container-managed persistence as arguments or results or as fields of value types.
• JAX-RPC serialization rules apply for any value types that are used by the web service endpoint
interface. If it is important that Java serialization semantics apply, the Bean Provider
should use the restricted set of JAX-RPC value types for which the semantics of Java serialization
apply under JAX-RPC serialization. See the JAX-RPC specification [22] for details.
• The web service endpoint interface must not include constant (as public final static)
declarations.
• The Bean Provider must designate the web service endpoint interface in the deployment
descriptor by means of the service-endpoint element. The service endpoint itself is only
exposed within a web service if it is referenced by a web service deployment descriptor as
defined by [25].


You may also find this interesting :
http://docs.jboss.org/jbossas/getting_started/v4/html/ws.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't figure out how EJb 2.1 SLSB method is exposed as web-service