T-4 - Develop Better Java EE Applications With Eclipse Web Tools Platform. Christopher M. Judd. President/Consultant Judd Solutions, LLC



Similar documents
Consuming and Producing Web Services with Web Tools. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Consuming and Producing Web Services with WST and JST. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Developing Web Services with Eclipse

Web Tools Platform (WTP) 3.5

Eclipse Web Tools Platform. Naci Dai (Eteration), WTP JST Lead

WebSphere Training Outline

Java EE 6 development with Eclipse, Netbeans, IntelliJ and GlassFish. Ludovic Champenois Oracle Corporation

OUR COURSES 19 November All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan Göteborg Sweden

JBoss SOAP Web Services User Guide. Version: M5

WEB SERVICES. Revised 9/29/2015

IBM Rational Web Developer for WebSphere Software Version 6.0

Accelerated Java EE Open Source Development with Eclipse CON1905

Developing Java Web Services

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

Developing Web Services Applications

JVA-561. Developing SOAP Web Services in Java

NetBeans IDE Field Guide

Rapid Application Development. and Application Generation Tools. Walter Knesel

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java

How To Develop An Application Developer For An Ubio Websphere Studio 5.1.1

Glassfish, JAVA EE, Servlets, JSP, EJB

JBoss JEE5 with EJB3.0 on NonStop. JAVA SIG, San Jose

An introduction to creating JSF applications in Rational Application Developer Version 8.0

As you learned about in Chapter 1, WebSphere Application Server V6 supports the

Building Web Services with Apache Axis2

JAVA/J2EE DEVELOPER RESUME

This presentation will provide a brief introduction to Rational Application Developer V7.5.

CrownPeak Java Web Hosting. Version 0.20

ITS. Java WebService. ITS Data-Solutions Pvt Ltd BENEFITS OF ATTENDANCE:

OpenShift is FanPaaStic For Java EE. By Shekhar Gulati Promo Code JUDCON.IN

This presentation is for informational purposes only and may not be incorporated into a contract or agreement.

JBS-102: Jboss Application Server Administration. Course Length: 4 days

This training is targeted at System Administrators and developers wanting to understand more about administering a WebLogic instance.

EclipseLink. Solutions Guide for EclipseLink Release 2.5

Developing an EJB3 Application. on WebSphere 6.1. using RAD 7.5

Java EE 7: Back-End Server Application Development

JAVA ENTERPRISE IN A NUTSHELL. Jim Farley and William Crawford. O'REILLY 4 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo.

A standards-based approach to application integration

Module 13 Implementing Java EE Web Services with JAX-WS

Web Services in Oracle Fusion Middleware. Raghu Kodali Consulting Product Manager & SOA Evangelist Oracle Fusion Middleware Oracle USA

Building and Using Web Services With JDeveloper 11g

Enterprise Applications

Reusing Existing * Java EE Applications from Oracle SOA Suite

Workshop for WebLogic introduces new tools in support of Java EE 5.0 standards. The support for Java EE5 includes the following technologies:

APAC WebLogic Suite Workshop Oracle Parcel Service Overview. Jeffrey West Application Grid Product Management

Java in Web 2.0. Alexis Roos Principal Field Technologist, CTO Office OEM SW Sales Sun Microsystems, Inc.

Java EE 6 Ce qui vous attends

GlassFish. Developing an Application Server in Open Source

IBM WebSphere Server Administration

FUSE-ESB4 An open-source OSGi based platform for EAI and SOA

Implementing SQI via SOAP Web-Services

Framework Adoption for Java Enterprise Application Development

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

Client-Server Architecture & J2EE Platform Technologies Overview Ahmed K. Ezzat

Introduction to Sun ONE Application Server 7

WebSphere Application Server V7: Deploying Applications

WebSphere Server Administration Course

ActiveVOS Server Architecture. March 2009

Developing Web Services with Eclipse and Open Source. Claire Rogers Developer Resources and Partner Enablement, HP February, 2004

Mastering Tomcat Development

Enterprise Application Development In Java with AJAX and ORM

The Java EE 6 Platform. Alexis Moussine-Pouchkine GlassFish Team

Install guide for Websphere 7.0

L01: Using the WebSphere Application Server Liberty Profile for lightweight, rapid development. Lab Exercise

Introduction to WebSphere Process Server and WebSphere Enterprise Service Bus

Working with WebSphere 4.0

Agilité des applications Java EE 6

ARM-BASED PERFORMANCE MONITORING FOR THE ECLIPSE PLATFORM

JAX-WS Developer's Guide

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

<Insert Picture Here> Java EE 7. Linda DeMichiel Java EE Platform Lead

Migrating Applications From IBM WebSphere to Apache Tomcat

Administering batch environments

RESIN APPLICATION SERVER JAVA EE 6 WEB PROFILE

WEB APPLICATION DEVELOPMENT. UNIT I J2EE Platform 9

WEBLOGIC ADMINISTRATION

EVALUATION ONLY. WA2088 WebSphere Application Server 8.5 Administration on Windows. Student Labs. Web Age Solutions Inc.

How to Build an E-Commerce Application using J2EE. Carol McDonald Code Camp Engineer

<Insert Picture Here> Betting Big on JavaServer Faces: Components, Tools, and Tricks

Chapter 22: Integrating Flex applications with portal servers

Java Web Services Training

Learning GlassFish for Tomcat Users

<Insert Picture Here> GlassFish v3 - A Taste of a Next Generation Application Server

WA2087 Programming Java SOAP and REST Web Services - WebSphere 8.0 / RAD 8.0. Student Labs. Web Age Solutions Inc.

Web Application Architecture (based J2EE 1.4 Tutorial)

Converting Java EE Applications into OSGi Applications

Announcements. Comments on project proposals will go out by in next couple of days...

Extend WTP Server Tools for your application server. Tim deboer Gorkem Ercan

Oracle WebLogic Server

Introduction to Oracle WebLogic. Presented by: Fatna Belqasmi, PhD, Researcher at Ericsson

Advantage Joe. Deployment Guide for WebLogic v8.1 Application Server

Creating Web Services Applications with IntelliJ IDEA

Understanding class paths in Java EE projects with Rational Application Developer Version 8.0

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

T Network Application Frameworks and XML Web Services and WSDL Tancred Lindholm

JAVA API FOR XML WEB SERVICES INTRODUCTION TO JAX-WS, THE JAVA API FOR XML BASED WEB SERVICES (SOAP, WSDL)

PASS4TEST 専 門 IT 認 証 試 験 問 題 集 提 供 者

IBM InfoSphere MDM Server v9.0. Version: Demo. Page <<1/11>>

Oracle WebLogic Server 11g Administration

applications. JBoss Enterprise Application Platform

Transcription:

T-4 - Develop Better Java EE Applications With Eclipse Web Tools Platform Christopher M. Judd President/Consultant Judd Solutions, LLC

Christopher M. Judd President/Consultant of Judd Solutions Leader Creator Open Source projects FallME and Fiddle

Agenda Java EE/J2EE Landscape WTP Overview WST JST EJBs Web Packaging Web Services Conclusion

J2EE Development is Complicated!!!

But Java EE and the Eclipse Web Tools Platform is simplifying enterprise development!!!

J2EE/Java EE Architecture

Current Java EE Tool Landscape Based on Web Tools Platform Eclipse Ganymede JEE IBM Rational Application Developer CodeGear JBuilder Genuitec MyEclipse NetBeans JetBrains IntelliJ IDEA

Managing Complexity Hand code classes, interfaces deployment descriptors Diagrams Doclet /** Annotations /** * A generated session bean * @ejb.bean name="transservice" * description="a session bean named TransService" * display-name="transservice" * jndi-name="transservice" * type="stateless" * transaction-type="container" */ public abstract class TransServiceBean implements javax.ejb.sessionbean { Java 5 Annotations @Stateless public class TicketServiceImpl implements TicketService {

Agenda J2EE/Java EE Landscape WTP Overview WST JST EJBs Web Packaging Web Services Conclusion

Web Tools Platform Project (WTP) Top Level Eclipse Project www.eclipse.org/webtools/ Included in Ganymede and Europa release Current version 3.0.2 Development tools for web and Java EE development No runtime dependencies Vendor extensible Dependencies Java 5 SDK or higher Eclipse 3.4.1 EMF 2.4.1 GEF 3.4.1 DTP 1.6.1

WTP Subprojects Web Standard Tools (WST) Web artifacts Defined by open standards bodies J2EE Standard Tools (JST) J2EE components Java Community Process (JCP) Depends on WST Dali EJB 3.0 Java Persistance API (JPA) support JavaServer Faces Tools (JSF) AJAX Toolkit Framework (ATF)

WTP Scope

WTP Installation Options Ganymede All-in-one Eclipse 3.4.1 Eclipse Modeling Framework (EMF) 2.4.1 Graphic Editor Framework (GEF) 3.4.1 Data Tools Platform (DTP) 1.6.1 Update Manager Eclipse.org update site Piecemeal * ATF is a separate install

WTP Vendor Support IBM Oracle/BEA CodeGear RedHat/JBoss ObjectWeb Exadel Genuitec Versant

Agenda J2EE/Java EE Landscape WTP Overview WST JST EJBs Web Packaging Web Services Conclusion

WST Scope World Wide Web Consortium (W3C) http://www.w3.org HTML, XHTML, CSS, XML, XSLT, XML Schema, XML Query European Computer Manufactures Association (ECMA) http://www.ecma-international.org JavaScript and C# International Engineering Task Force (IETF) http://www.ietf.org TCP/IP American National Standards Institute (ANSI) http://www.ansi.org SQL, C/C++ Organizations for Advancement of Structured Information Standards (OASIS) http://www.oasis-open.org e-business standards for web services Web Services Interoperability Organizations (WS-I) http://www.ws-i.org Interoperable message exchange between web services

TCP/IP Monitor Window > Preferences > Run/Debug > TCP/IP Monitor Window > Show View > Other > Debug > TCP/IP Monitor

Structured Source Editors Web and XML artifacts HTML, JSP, CSS, XML, XSD, DTD Features Syntax Highlighting Content Assist Error Highlighting Delimiter Matching Source Formatting Inline editing of languages Templates

XML Editor

XML Schema Editor Graphically or via source edit XML Schema files

Web Service Tools WSDL Editor Java to WSDL and WSDL to Java wizards

Test Web Service Web Service Explorer can be used to test out Web Services

Agenda J2EE/Java EE Landscape WTP Overview WST JST EJBs Web Packaging Web Services Conclusion

JST Scope J2EE 1.4 support EJB 2.1 Servlet 2.4 JSP 2.0 JMS 1.1 JTA 1.0 JavaMail 1.3 JAF 1.0 JAXP 1.2 Connector 1.5 Web Services 1.1 JAX-RPC 1.1 SAAJ 1.2 JAXR 1.0 J2EE Management 1.0 JMX 1.2 J2EE Deployment 1.1 JACC 1.0

J2EE 1.4 XDoclet Annotations Plug-able annotations platform XDoclet Open Source Attribute Oriented Programming (AOP) framework xdoclet.sourceforge.net Generates Bean Interfaces Bean Util classes EJB Deployment Descriptors Web Deployment Descriptors

JST Scope Java EE 5 support EJB 3.0 JPA JSR-220 Servlet 2.5 JSP 2.1 JSF 1.2 JMS 1.1 JTA 1.1 JavaMail 1.4.1 JAF 1.1 Connector 1.5 Common Annotations JAX-WS 2.0 JAX-RPC 1.1 JAXB 2.0 SAAJ 1.1.2 SAAJ 1.2 J2EE Management J2EE Deployment JACC

JST Scope JSR 45 Debugging Support JSR 175 Metadata (annotations) JSR 181 Metadata for Web Services Integration with popular open source application servers

JST Projects Projects Types Enterprise Application Project (ear) EJB Project (ejb-jar) Dynamic Web Project (war) Application Client Project (jar) Connector Project (rar)

JST Projects Project Layouts Project per module Enterprise Application Project (ear) Application Client Project (jar) EJB Project (ejb-jar) Dynamic Web Project (war)

Java EE Perspective

Web Perspective

JPA Perspective

Infrastructure Configure workspace Application server Data source

Workspace Setup Configure application server runtime Configure database (really DTP)

Supported Servers Apache Tomcat 3.2-4.0 4.1-5.0 5.5-6.0 Apache Geronimo 1.0 IBM WebSphere 6.0.x JBoss 3.2.x, 4.2, 4.0, 5.0 JOnAS 4.x Oracle OC4J Standalone 10.1.3

Download Additional Server Adapters Pramati Server Apache Geronimo GlassFish Jetty IBM WebSphere Application Server Community Edition IBM WebSphere Oracle WebLogic

Defining Server 1. Configure server appropriate JDK 2. Configure server runtime 3. Configure server 4. Test server

Configure JDK Window > Preferences > Java > Installed JREs Note: You may have to add tools.jar for JSP support

Configure Server Runtime Window > Preferences > Server > Installed Runtimes

Configure Server Use Server View in J2EE Perspective 1. Add server (New > Server)

Test Server 1. Start server 2. Verify server is up

Server View Usability Tip Move Server View above Console view Easier application server startup Easier deployment

Workspace Setup Configure application server runtime Configure database (really DTP)

Define Driver Window > Preferences > Data Management > Connectivity > Driver Definitions Many driver templates for common databases

Define Driver Select driver template

Define Driver Configure driver classpath & properties

Database Development Perspective

Creating Connection Profile New Connection Profile button on Data Source Explorer

Creating Connection Profile Select Profile Type Provide a descriptive name Optionally provide a description

Creating Connection Profile Configure driver details and test connection

Data Source Explorer View database elements Context menus Connect Filter Generate DDL Create Tables Data Import/Export Connection Profiles

Create Enterprise Application Project New > Project > Java EE > Enterprise Application Project Add EJB and Web modules Select Application Server

Projects Tour > EAR TourEJB > EJB TourWeb > WAR

Lab 1 1. Install Ganymede (if not installed already) 2. Install Glassfish V2 UR2 Instructions - https://glassfish.dev.java.net/downloads/v2ur2-b04.html 3. Configure Glassfish Server 4. Install Derby Unzip db-derby-10.4.2.0-bin.zip 5. Start Derby <derby>/bin/startnetworkserver.bat 6. Configure Derby driver 7. Configure Derby Connection Profile 8. Create new EAR, EJB and Web projects

Agenda J2EE/Java EE Landscape WTP Overview WST JST EJBs Web Packaging Web Services Conclusion

EJB Types Session Server-side business logic Stateful Stateless Entity Persistable business objects CMP BMP Message-Driven Consumers of JMS messages

EJB 2.x Files Session Remote Interface Home Interface Local Interface Local Home Interface Bean Class EJB Deployment Descriptor App Server Specific EJB Deployment Descriptor

EJB 2.x Files Entity Remote Interface Home Interface Local Interface Local Home Interface Bean Class EJB Deployment Descriptor App Server Specific EJB Deployment Descriptor App Server Specific CMP Deployment Descriptor

EJB 2.x Files Message-Driven Bean Bean Class EJB Deployment Descriptor App Server Specific EJB Deployment Descriptor

EJB 2.x Problems Too much work Too much to know Too much XML Too many patterns DTO Locator Service Difficult to test Breaks object oriented principals

EJB 3.0 Solution Plain Old Java Objects (POJO) Annotations over XML Java Persistence API (JPA) Dependency Injection Fewer files

Create Entity Bean Process 1. Enable JPA on EJB project 2. Generate Entity Bean 3. Configure application server data source 4. Configure JNDI in application

Enable JPA on EJB project Enable Java Persistence 1.0 EJB Project Properties > Project Facets Configure JPA EJB Project Properties > JPA Discover annotated classes automatically

Generate Entity Bean Right-click on EJB project > JPA Tools > Generate Entities Generate from existing tables in database Select Database connection Synchronize Classes in persistence.xml Select tables

Entity Bean Source @Entity public class Countries implements Serializable { @Id @Column(name="COUNTRY_ISO_CODE") private String countryisocode; private String country; private String region; @OneToMany(mappedBy="countryIsoCode") private Set<Cities> citiescollection; private static final long serialversionuid = 1L; public Countries() { super(); } public String getcountryisocode() { return this.countryisocode; } public void setcountryisocode(string countryisocode) { this.countryisocode = countryisocode; } public Set<Cities> getcitiescollection() { return this.citiescollection; } public void setcitiescollection(set<cities> citiescollection) { this.citiescollection = citiescollection; } } // Other properties removed for simplification

Entity Bean Support Content Assist (Ctrl + Space) for Annotations JPA Details view

Configure App Server Data Source Application server and database specific

Configure JNDI in Application ejbmodule\meta-inf\persistence.xml Add transaction type Add JTA data source <?xml version="1.0" encoding="utf-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="tourejb" transaction-type="jta"> <jta-data-source>jdbc/tourdatasource</jta-data-source> <class>com.juddsolutions.entities.airlines</class> <class>com.juddsolutions.entities.cities</class> <class>com.juddsolutions.entities.countries</class> <class>com.juddsolutions.entities.flights</class> <class>com.juddsolutions.entities.flightspk</class> </persistence-unit> </persistence>

Create Session Bean Process 1. Create Session Interface 2. Create Session Class Inject EntityManager Implement Session Bean

Create Session Interface Standard Java Interface Optional Local or Remote (defaults to Local) public interface FlightService { } List<Flights> findallflights();

Create Session Class Standard Java Class Stateful or Stateless annotation Inject EntityManager and/or other Session Beans @Stateless public class FlightServiceImpl implements FlightService { @PersistenceContext EntityManager entitymanager; } @SuppressWarnings("unchecked") @Override public List<Flights> findallflights() { return (List<Flights>) entitymanager.createquery( "SELECT f FROM Flight f").getresultlist(); }

Lab 2 1. Enable JPA on EJB project 2. Generate Flights Entity Bean 3. Configure Glassfish JNDI Create connection pool Create JDBC resource 4. Configure application datasource 5. Create FlightService Session Bean Create FlightService interface Create FlightService implementation

Agenda J2EE/Java EE Landscape WTP Overview WST JST EJBs Web Packaging Web Services Conclusion

Web Artifact Support JavaServer Faces (JSF) JavaServer Pages (JSP) Tag Libraries Servlets Filters Listeners HTML Cascading Style Sheets (CSS) JavaScript

Enable EJB J2EE Module Provides access to EJB classes Web Project Properties > Java EE Module Dependencies

Enable JavaServer Faces Web Project Properties > Project Facets

Create JSP <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <html> <head> <title>insert title here</title> </head> <body> <f:view> </f:view> </body> </html>

Design Page Add JSF Core and HTML components from Palette

Create Managed Beans Using faces-config.xml editor

Implement Managed Bean public class FlightBean { @EJB private FlightService service; private String airportcode; private List<Flights> flights; public void setairportcode(string airportcode) { this.airportcode = airportcode; } public String getairportcode() { return airportcode; } public List<Flights> getflights() { return flights; } public String find() { flights = service.findallflightsbydepartureairport(airportcode); return "success"; } }

Implement Navigation Using faces-config.xml editor

Deploy Initial Deployment - Right click on server and Add and Remove Projects Redeploys Right click on server and Publish

Test http://localhost:8080/tourweb/faces/

Debugging Just start server in debug mode and debug like standard Java application

Lab 3 1. Create a JSP page. 2. Design Interface for searching by airport and displaying data in DataTable. 3. Create and configure managed bean. 4. Create navigation mapping. 5. Deploy and test.

Agenda J2EE/Java EE Landscape WTP Overview WST JST EJBs Web Packaging Web Services Conclusion

Packaging Export > Java EE > EAR file Deploy to standard Java EE App Server

Deployment Container specific Admin console Deployment directory Ant task Server View

Agenda J2EE/Java EE Landscape WTP Overview WST JST EJBs Web Packaging Web Services Conclusion

Web Services Web Services Overview Consuming Producing Web Services (bottom up) Testing

Simple Object Access Protocol From the draft W3C specification: SOAP is a lightweight protocol for exchange of information in a decentralized, distributed environment. It is an XML based protocol that consists of three parts: an envelope that defines a framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined datatypes, and a convention for representing remote procedure calls and responses. http://www.w3.org/tr/soap/

WSDL Web Service Definition Language Describes What the service can do Where it resides How to invoke it Elements Types data type definition Message definition of data being communicated Port Type abstract set of operations Binding concrete protocol and data format Service collection of related endpoints Port binding and a network address

Web Service Implementations 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/

Weather Forecast Web Service Forecasting weather by zip code 7 day forecast Place name State code Latitude and Longitude Found at X Methods (www.xmethods.net) Service description www.webservicex.net/weatherforec ast.asmx

Weather Forecast Web Service Service description Data transfer objects

Consuming Web Services Strategy A common anti-pattern is to generate the web service client stub code directly into an application. Tip: Generate client code in its own project and export it as a jar Less files to maintain Reuse web service client code Generated code does not follow code quality standards Can always regenerate

Consuming Web Services Steps (Axis) 1. Create Java Project 2. Download WSDL 3. Generate Web Service Client from WSDL 4. Export client Jar

Create Project Create a standard Java Project File > New > Project > Java 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

Generate Web Service Client Right click on WSDL and choose Web Services > Generate Client or File > New > Web Services > Web Service Client Specify Java Proxy Monitor traffic using Monitor traffic using TCP/IP Monintor

Generate Web Service Client Specify project to generate the code in

Generate Web Service Client Optionally, can specify namespace to package mapping Convert targetnamespace to a more conventional Java package naming convention.

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.

Using Generate Classes // Get service locator WeatherForecastLocator forcastlocator = new WeatherForecastLocator(); // Get SOAP service WeatherForecastSoap wfsoap = forcastlocator.getweatherforecastsoap(); // Call remote web service WeatherForecasts forecasts = wfsoap.getweatherbyzipcode(zipcode); WeatherData[] details = forecasts.getdetails(); System.out.println("\nWeather information for " + forecasts.getplacename()); System.out.println(forecasts.getLatitude()); System.out.println(forecasts.getLongitude()); for (int i = 0; i < details.length; i++) { WeatherData detail = details[i]; System.out.println(detail.getDay()); System.out.println(detail.getWeatherImage()); System.out.println(detail.getMaxTemperatureF()); }

Consuming Web Services Steps (Axis2) 1. Configure Axis2 Runtime 2. Create Dynamic Project with Axis2 Facet 3. Download WSDL 4. Generate Web Service Client from WSDL

Configure Axis2 Runtime Configurable to support multiple Axis2 versions

Create Dynamic Project Create a Dynamic Web Project File > New > Project > Dynamic Project Enable Axis2 Facets

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

Generate Web Service Client Right click on WSDL and choose Web Services > Generate Client or File > New > Web Services > Web Service Client Change Web service Runtime

Generate Web Service Client Select port SOAP GET POST Databinding ADB (Axis2 Databinding Framework) Standardize package name Identify synchronous and/or asynchronous calls

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.

Using Generate Classes // Create client stub WeatherForecastStub stub = new WeatherForecastStub(); // Setup parameter data GetWeatherByZipCode zipcode = new GetWeatherByZipCode(); zipcode.setzipcode("90210"); // Call remote method GetWeatherByZipCodeResponse response = stub.getweatherbyzipcode(zipcode); WeatherForecasts forecasts = response.getgetweatherbyzipcoderesult(); WeatherData[] details = forecasts.getdetails().getweatherdata(); System.out.println("\nWeather information for " + forecasts.getplacename()); System.out.println("Latitude: " + forecasts.getlatitude()); System.out.println("Longitude: " + forecasts.getlongitude()); for (int i = 0; i < details.length; i++) { WeatherData detail = details[i]; System.out.println(detail.getDay()); System.out.println(detail.getWeatherImage()); System.out.println(detail.getMaxTemperatureF()); }

Producing Web Services Bottom up Java code -> Generate WSDL Top down WSDL -> Generate Java code

Bottom Up Steps 1. Create Dynamic Web Project 2. Create Service and DTOs 3. Generate Web Service

Create Dynamic Web Project File > New > Other > Web > Dynamic Web Project Project Name Target server

Create Dynamic Web Project Axis2 Web Services Facet

Create Dynamic Web Project Context Root Directories

Create Service public class OrderService { private static final float DISCOUNT = 0.9f; } public float quote(float price, int quantity) { if (quantity > 100) { price = price * DISCOUNT; } return price * quantity; }

Generate Web Service New > File > Other > Web Services > Web Service or Right click on Class: Web Services > Create Web Services Change Web service runtime to Apache Axis2 Select the amount to be generated Monitor using TCP/IP Monitor

Generate Web Service Create or auto generate a Axis2 deployment descriptor

Generate Web Service Start server Generate EAR Deploy to local application server

Output Web Service Axis deployment descriptors WSDL Admin Client

Output http://localhost:8080/<context root>/axis2-web

WSDL http://localhost:8080/<context path>/services/<service name>?wsdl

Data Types Simple Java data types JavaBeans No parameter constructor Arrays

TCP/IP Monitoring View SOAP request and response

Web Service Explorer Testing Test any Web Services

WSDL Editor Graphically edit WSDL

Agenda J2EE/Java EE Landscape WTP Overview WST JST EJBs Web Packaging Web Services Conclusion

Conclusion WTP not only has the tools necessary for developing, deploying and testing J2EE and developing, deploying and testing J2EE and Java EE applications, it is the foundation of many of today s leading enterprise development tools and has wide industry support.

Contact Information Website: http://www.juddsolutions.com Email: cjudd@juddsolutions.com Blog: http://juddsolutions.blogspot.com/ Beginning Groovy and Grails http://www.apress.com/book/view/1430210451 Pro Eclipse JST http://www.apress.com/book/bookdisplay.html?bid=447 Enterprise Java Development on a Budget http://www.apress.com/book/bookdisplay.html?bid=197

Questions? Please fill out your evaluations. Slides can be found at http://www.juddsolutions.com/ew2008/