Professional Documents
Culture Documents
Source
Claire Rogers
Developer Resources and Partner Enablement, HP
February, 2004
Introduction
! Presentation objectives:
– present a lifecycle for web services development
– introduce open source tools for development
– share key learnings in using some of these tools
! Scenario
– HotSpell, a new Internet-based startup company
– creating a weather forecast service for consumers
– has selected Java as underlying development platform
– wishes to expose application as a web service
! OS
– Why Linux?
• viable alternative to a commercial operating system
• cost effective
– Why Debian Linux?
• most vendor-neutral (“open source only” policy)
• provides an easy-to-use interface for installing packages
! Database
– PostgreSQL considered more robust in SQL support
– MySQL designed for speed at the cost of features
! Key learnings:
– provides both Unix and Windows look-and-feel
– Linux is not a single development platform
– installation made easier with aptitude and HP’s PTK
– there are many different application packaging formats
2/19/2004 EclipseCon 2004 page 4
Initial Configuration:
Designing the Database
! IDE
– Integrated Development
Environment
– provides tools to edit, compile,
and debug applications
! Several open source IDEs v.s.
for Java available
– NetBeans (www.netbeans.org)
– Eclipse (www.eclipse.org)
! Eclipse selected because of ! both open source
prior experience with tool ! both provide Java-based IDEs
– HP is Eclipse board member ! Eclipse is SWT-based
– Eclipse plug-ins available for
OpenView
! NetBeans is Swing-based
Weather.java
get zipcode information MySQL
zipcode
getWeather(String zip)
! WSDL
– Web Services Description Language what?
– defines the “signature” of the web service how?
– XML-based, independent of platform
where?
! Two approaches for designing a WSDL
– design WSDL first, then map to business objects
– have the WSDL be automatically generated from code
1.Create web
service interface
Weather.java
Forecast.java WeatherLocator.java
WeatherImpl.java
3. Package and deploy
Deploy.wsdd mysql-
connector.jar
Run
Weather.wsdl
Run Run javac and jar weather.jar
Java2WSDL WSDL2Java
Copy to axis
2. Generate server lib on Tomcat
side bindings
Run
AdminClient Web service
deployed
! WSDL2JavaWizard
– Wizard to generate client
stubs
– Invokes Apache
WSDL2Java tool
– Stubs, skeletons, data
types
A target
serverside=”true” A task
url=”${proj.dir}/Weather.wsdl”>
</axis-wsdl2java>
</target>
WeatherClient.java WeatherService.java
Apache
Axis
SOAP
Server
Client Proxy Server-Side Bindings
SOAP/HTTP
Proxy
Configuration
getWeather
SOAP
request
Forecast
SOAP
Response
! Important considerations:
– create graphical interfaces to test web services
– design a test framework usable by non-developers
– build tests into the development process early on
– test security, reliability, interoperability, and scalability
– consider the use of automated testing tools
# print response
sprint “Avg. Response Time =“
sprint totaltime/100
sprint “ms to complete.”
! Review:
– outlined a process for creating web services
– presented some open source tools that could be used