Choosing a Web-Service Implementation Type

Every web service needs to be backed by an implementation class with some number of public business methods . Depending on the type of service, you can choose one of the following implementation types:

  • Stateless Java class. This is just a "plain old" Java class. By default, all public methods will be exposed through the web service, but you can narrow that by pointing to an interface with only the appropriate subset of methods. Every time a request is received for the web service, OC4J will create or reuse an object of this class.

  • Stateful Java class. This option also uses a normal Java class, but ties it to a user 's HTTP session so that the same instance is used across multiple requests . This lets you save state in instance variables between calls. Session timeouts can be configured as described in Chapter 10.

  • Stateless session bean. This option wraps a stateless session EJB, exposing all of the methods found in its remote interface. It can be very useful when the functionality has already been implemented in an EJB, or when it needs to use EJB services.

PL/SQL functions can also be exposed as web services, but the implementation code isn't deployed through J2EE. For more information about PL/SQL web services, visit the Oracle Technology Network (OTN) website.



Oracle Application Server 10g. J2EE Deployment and Administration
Oracle Application Server 10g: J2EE Deployment and Administration
ISBN: 1590592352
EAN: 2147483647
Year: 2004
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net