Authoring a web service
105
Authoring a web service
The Compass Travel sample application simulates a vacation reservation system in which
you can browse adventure trip descriptions and booking information, and make trip
reservations. Compass Travel exposes two web services, Trip and Reservation, in its
WSDD file.
Authoring a web service in JRun can consist of including a Java class and a properly
configured WSDD file in the web application WEB-INF directory and deploying the
application. In the next procedure, you examine the Trip and Reservation web services
code in the Compass Travel application WSDD file.
In addition to the general configuration information, the Compass Travel application
WSDD file contains a
service
element for the Trip and Reservation Java classes that it
exposes as a web service. The
className
element is the name of the Java implementation
class, and
methodName
is the name of the allowed methods. TravelNet, running on the
tutorial server, consumes these web services from the Compass Travel application,
running on the samples server.
To examine the WSDD code:
•
Open the file jrun_root/servers/samples/compass-ear/compass-war/WEB-INF/
server-config.wsdd
and look at the following code:
<service name="Trip" provider="java:RPC">
<parameter name="methodName" value="getInfo getList"/>
<parameter name="className" value="compass.Trip"/>
<beanMapping languageSpecificType="java:compass.TripInfo"
qname="ns1:TripInfo" xmlns:ns1="http://compass"/>
</service>
<service name="Reservation" provider="java:RPC">
<parameter name="methodName" value="reserve"/>
<parameter name="className" value="compass.Reservation"/>
</service>
In the code, notice the following information:
•
The Trip web service exposes two methods,
getInfo
and
getList
, in Java class
compass.Trip
.
•
The Reservation web service exposes one method,
reserve
, in Java class
compass.Reservation
.
In the next procedure, you generate a WSDL file for each web service.
Summary of Contents for 38000382 - Macromedia JRun - Mac
Page 1: ...Getting Started with JRun...
Page 16: ......
Page 68: ...54 Chapter 5 Introduction to EJB...
Page 82: ......
Page 110: ...96 Lesson 3 EJB Tutorial...
Page 128: ...114 Lesson 4 Web Services Tutorial...
Page 132: ...118 Index...