10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Undeploying the cart Example<br />

To undeploy cart.ear using NetBeans IDE:<br />

1. Click the Services tab.<br />

2. Expand the Servers node and locate the Application Server instance to which you deployed<br />

cart.<br />

3. Expand your Application Server instance node, then Applications→Enterprise<br />

Applications.<br />

4. Right-click cart and select Undeploy.<br />

To undeploy cart.ear using Ant, enter the following command:<br />

ant undeploy<br />

AWeb Service Example: helloservice<br />

This example demonstrates a simple web service that generates a response based on<br />

information received from the client. HelloServiceBean is a stateless session bean that<br />

implements a single method, sayHello. This method matches the sayHello method invoked by<br />

the client described in “A Simple JAX-WS Client” on page 482.<br />

<strong>The</strong>Web Service Endpoint Implementation Class<br />

HelloServiceBean is the endpoint implementation class. <strong>The</strong> endpoint implementation class is<br />

typically the primary programming artifact for enterprise bean web service endpoints. <strong>The</strong> web<br />

service endpoint implementation class has the following requirements:<br />

■ <strong>The</strong> class must be annotated with either the javax.jws.WebService or<br />

javax.jws.WebServiceProvider annotations.<br />

AWeb Service Example: helloservice<br />

■ <strong>The</strong> implementing class may explicitly reference an SEI through the endpointInterface<br />

element of the @WebService annotation, but is not required to do so. If no<br />

endpointInterface is specified in @WebService, an SEI is implicitly defined for the<br />

implementing class.<br />

■ <strong>The</strong> business methods of the implementing class must be public, and must not be declared<br />

static or final.<br />

■ Business methods that are exposed to web service clients must be annotated with<br />

javax.jws.WebMethod.<br />

■ Business methods that are exposed to web service clients must have JAXB-compatible<br />

parameters and return types. See “Default Data Type Bindings” on page 491.<br />

■ <strong>The</strong> implementing class must not be declared final and must not be abstract.<br />

Chapter 22 • Session Bean Examples 663

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!