Professional Documents
Culture Documents
Producing Web
Services in Java EE
Christopher M. Judd
President/Consultant
Judd Solutions, LLC
Christopher M. Judd
1
Agenda
• WTP Overview
• Web Services Overview
• Consuming
• Producing Web Services (bottom up)
• Testing
• Deployment
• Conclusion
2
WTP Subprojects
WTP Scope
3
WTP Web Services Scope
• Europa
• All-in-one
– Eclipse 3.3.1
– Eclipse Modeling Framework (EMF) 2.3.1
– Graphic Editor Framework (GEF) 3.3.1
– Data Tools Platform (DTP) 1.5.1
• Update Manager
– Eclipse.org update site
• Piecemeal
4
Agenda
• WTP Overview
• Web Services Overview
• Consuming
• Producing Web Services (bottom up)
• Testing
• Deployment
• Conclusion
http://www.w3.org/TR/soap/
5
WSDL
• Apache Axis
– Apache Web Services Project
– Open Source
– SOAP implementation
– Version 1.4
– http://ws.apache.org/axis/
• Apache Axis 2
– Pull Parser
– Multiple Binding Frameworks
– SOAP, REST, Async
– Version 1.3
– http://ws.apache.org/axis2/
6
Agenda
• WTP Overview
• Web Services Overview
• Consuming
• Producing Web Services (bottom up)
• Testing
• Deployment
• Conclusion
7
Weather Forecast Web Service
Service description
8
Consuming Web Services Steps (Axis)
Create Project
• Create a standard
Java Project
• File > New > Project… >
Java Project
9
Download WSDL
• Download WSDL
• Add WSDL to project
• Include it in the exported Jar file
• Provides traceability incase there is a need
to know which WSDL version was used to
generate stubs and Jar
10
Generate Web Service Client
11
Output
• Classes
– Service interface
– Dynamic proxy service impl
– Stub service impl
– Service locator interface
– Service locator impl
– Data transfer objects
• Axis Jars
– axis.jar
– jaxrpc.jar
– saaj.jar
– wsdl4j-1.5.1.jar
– commons-discovery-0.2.jar
– commons-logging-1.0.4.jar
* When using the client Jar, these Axis jars will be required in the classpath.
12
Consuming Web Services Steps (Axis2)
13
Create Dynamic Project
Download WSDL
• Download WSDL
• Add WSDL to project
• Include it in the exported Jar file
• Provides traceability incase there is a need
to know which WSDL version was used to
generate stubs and Jar
14
Generate Web Service Client
• Select port
– SOAP
– GET
– POST
• Databinding
– ADB (Axis2 Databinding
Framework)
• Standardize package
name
• Identify synchronous
and/or asynchronous
calls
15
Output
• Classes
– Stub
– CallbackHandler
• Added Axis2 Jars to
WebContent/WEB-
INF/lib
* When using the client Jar, Axis2 jars from WEB-INF/lib will be required in the classpath.
16
Agenda
• WTP Overview
• Web Services Overview
• Consuming
• Producing Web Services (bottom up)
• Testing
• Deployment
• Conclusion
• Bottom up
– Java code -> Generate WSDL
• Top down
– WSDL -> Generate Java code
17
Bottom Up Steps
• File > New > Other > Web > Dynamic Web Project
• Project Name
• Target server
18
Create Dynamic Web Project
• Context Root
• Directories
19
Create Service
20
Generate Web Service
• Start server
• Generate EAR
• Deploy to local application server
21
Output
• Web Service
– Axis deployment
descriptors
– WSDL
• Admin Client
Output
• http://localhost:8080/<context root>/axis2-web
22
WSDL
Data Types
23
Agenda
• WTP Overview
• Web Services Overview
• Consuming
• Producing Web Services (bottom up)
• Testing
• Deployment
• Conclusion
TCP/IP Monitoring
24
Web Service Explorer Testing
WSDL Editor
25
Agenda
• WTP Overview
• Web Services Overview
• Consuming
• Producing Web Services (bottom up)
• Testing
• Deployment
• Conclusion
Package
26
Deployment
• Container specific
• Admin console
• Deployment directory
• Ant task
• Server View
Agenda
• WTP Overview
• Web Services Overview
• Consuming
• Producing Web Services (bottom up)
• Testing
• Deployment
• Conclusion
27
WTP Resources
• www.eclipse.org/webtools/
• www.projst.com
• Tutorials
– http://www.eclipse.org/webtools/community/communityr
esources.html#tutorials
• Articles
– http://www.eclipse.org/webtools/community/communityr
esources.html#articles
– Consuming Web Services Using Eclipse Web Tools -
http://www.eclipsereview.com/issues/eclipsereview_20061
2.pdf
• New Group
– news://news.eclipse.org/eclipse.webtools
Contact Information
• http://www.juddsolutions.com
• cjudd@juddsolutions.com
• Blog
– http://blogs.apress.com/authors.php?author=Christopher%20Judd
– http://juddsolutions.blogspot.com/
28
Questions ?
Please fill out your evaluations.
29