SOA Using Java Web Services
SOA Using Java Web Services
Mark Hansen
Founder & President AgileIT
http://agileitinc.com
(Delete this element) If applicable, place your company logo here
Learn how to build SOA Applications using JAX-WS, JAXB, and Ajax
(JAX-RS on Thursday)
www.javapolis.com
Speakers Qualifications
!
Mark Hansen is the Founder and President of AgileIT Author of SOA Using Java Web Services Developed the SOA-J Framework PhD from MITs Lab for Computer Science
www.javapolis.com
The Java 6 (JEE 5) Java Web Services Tools enable real SOA Application Development.
www.javapolis.com
Intro: Am I Stupid, or Is Java Web Services Really Hard? Part I: Architecture, Concepts, Standards
! ! ! !
Web Services Platform Architecture (WSPA) Basic REST with HttpServlet WSDL, SOAP, and Java/XML Binding JAXB and JAX-WS
www.javapolis.com
Code First, Contract First, and Meet in the Middle SOA Integration Case Study (eBay, Amazon, Yahoo!)
www.javapolis.com
www.javapolis.com
www.javapolis.com
SOA Using Java Web Services - Introduction Web Services are Hard
!
"A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable." - Leslie Lamport
www.javapolis.com
www.javapolis.com
Intro: Am I Stupid, or Is Java Web Services Really Hard? Part I: Architecture, Concepts, Standards
! ! ! !
Web Services Platform Architecture (WSPA) Basic REST with HttpServlet and JAX-WS WSDL, SOAP, and Java/XML Binding JAXB, JAX-WS
www.javapolis.com
SOA Using Java Web Services Part I Web Services Platform Architecture
!
Invocation
! ! !
Proxies Represent Web Services in Java Interface to Messaging System (HTTP) QoS (Handlers) Java/XML Binding Implement Web Service Endpoints (SOAP, REST) with Java
www.javapolis.com
Deployment
!
www.javapolis.com
www.javapolis.com
www.javapolis.com
www.javapolis.com
Intro: Am I Stupid, or Is Java Web Services Really Hard? Part I: Architecture, Concepts, Standards
! ! ! ! !
Web Services Platform Architecture (WSPA) Basic REST with HttpServlet and JAX-WS WSDL, SOAP, and Java/XML Binding JAXB and JAX-WS JAX-RS (Under Development for Java EE 6)
SOA Using Java Web Services Part I Basic REST SOAP Comparison
REST SOAP
Message Format XML1 SOAP WSDL HTTP3, FTP, MIME, JMS, SMTP, etc. Interface Definition None2 Transport
1. 2. 3.
HTTP
Also uses HTTP headers and query string. XML Schema sometimes provided. And out of band documentation. Without WS-Addressing, SOAP relies on the message transport for dispatching (e.g., HTTP context path).
www.javapolis.com
SOA Using Java Web Services Part I Basic REST HttpURLConnection (JDK 1.1)
www.javapolis.com
SOA Using Java Web Services Part I Basic REST Dispatch<Source> (JAX-WS 2.0 )
www.javapolis.com
www.javapolis.com
www.javapolis.com
DEMO
Basic REST HttpServlet vs. Provider<T>
Intro: Am I Stupid, or Is Java Web Services Really Hard? Part I: Architecture, Concepts, Standards
! ! ! ! !
Web Services Platform Architecture (WSPA) Basic REST with HttpServlet and JAX-WS WSDL, SOAP, and Java/XML Binding JAXB and JAX-WS JAX-RS (Under Development for Java EE 6)
SOA Using Java Web Services Part I The Role of WSDL in Enterprise SOA
www.javapolis.com
www.javapolis.com
www.javapolis.com
Intro: Am I Stupid, or Is Java Web Services Really Hard? Part I: Architecture, Concepts, Standards
! ! ! ! !
Web Services Platform Architecture (WSPA) Basic REST with HttpServlet and JAX-WS WSDL, SOAP, and Java/XML Binding JAXB and JAX-WS JAX-RS (Under Development for Java EE 6)
SOA Using Java Web Services Part I JAXB Binding vs. Mapping
www.javapolis.com
SOA Using Java Web Services Part I JAXB The Standard Binding
www.javapolis.com
SOA Using Java Web Services Part I JAXB Custom Mappings with DIY Recursion
www.javapolis.com
SOA Using Java Web Services Part I JAXB Customization with XmlAdapter
www.javapolis.com
SOA Using Java Web Services Part I JAX-WS Client Side Invocation with Proxy
www.javapolis.com
SOA Using Java Web Services Part I JAX-WS WSDL to Java Binding
www.javapolis.com
SOA Using Java Web Services Part I JAX-WS Server Side Invocation Subsystem
www.javapolis.com
SOA Using Java Web Services Part I JAX-WS SOAP Fault Message
www.javapolis.com
DEMO
Examining the JAX-WS WSDL ! Invoking a Web Service
!
Intro: Am I Stupid, or Is Java Web Services Really Hard? Part I: Architecture, Concepts, Standards
! ! ! !
Web Services Platform Architecture (WSPA) Basic REST with HttpServlet WSDL, SOAP, and Java/XML Binding JAXB and JAX-WS
www.javapolis.com
Code First, Contract First, and Meet in the Middle SOA Integration Case Study (eBay, Amazon, Yahoo!)
www.javapolis.com
SOA Using Java Web Services Part II Code First, Contract First, Meet in the Middle
???
www.javapolis.com
The Demo before the break illustrated Code First development. Start with a Java Class and generate WSDL using JAX-WS. Modify the WSDL using Annotations.
www.javapolis.com
Start with WSDL and XML Schema. JAX-WS WSDL to Java Binding and JAXB provide a mapping to Java. J2SE 6 provides the wsimport tool.
www.javapolis.com
SOA Using Java Web Services Part II Meet in the Middle ! Start with WSDL and XML Schema ! AND existing Java classes. ! Two sides of the same problem:
! !
Invoke the Web services using your existing Java classes as parameters (e.g., PurchaseOrder). Deploy your existing Java classes to provide Web services that conform to the existing WSDL and XML Schema.
This is the most common scenario faced by enterprises that are implementing SOA using Java Web Services.
www.javapolis.com
To illustrate Meet in the Middle, we look at a SOA integration case study. Step back for a few minutes to look at the architecture. Then, look at some Meet in the Middle code.
www.javapolis.com
Code First, Contract First, and Meet in the Middle SOA Integration Case Study (eBay, Amazon, Yahoo!)
www.javapolis.com
What is AJAX?
!
! !
Asynchronous JavaScript and XML An Interaction Model A Set of Technologies for Rich Client Development ... A Composite Application Framework for Flexible Business Process Management ???
! !
www.javapolis.com
SOAShopper Architecture
www.javapolis.com
eBay WSDL
www.javapolis.com
www.javapolis.com
www.javapolis.com
www.javapolis.com
www.javapolis.com
www.javapolis.com
public abstract class BindingService { public static <C> C getBinding( Class<C> client, Class<?> service) { ... } }
www.javapolis.com
Demo
SOAShopper Integrating Yahoo!, Amazon, and eBay
Flash Demo
www.javapolis.com
<table dojoType="filteringTable" id="fromSOAShopperData" multiple="true" alternateRows="true" cellpadding="0" cellspacing="0" border="0" style="margin-bottom:24px;"> <thead> <tr> <th field="source" dataType="String">Source</th> <th field="thumbnail" dataType="html" align="center">Image</th> <th field="price" dataType="String">Price</th> <th field="summary" dataType="String">Summary</th> <th field="url" dataType="html">Link</th> </tr> </thead> </table>
www.javapolis.com
Summary
! ! ! !
Summary point one Summary point two Summary point three Summary point
This is where the END portion of the presentation starts. Summarize all of the key content points covered in your presentation.
www.javapolis.com
Concluding statement
Insert concluding statement or quote here. Remember, this is the final take-away that will challenge your audience with a call to action.
Instructions: (Delete this element)
This is the time to challenge your audience with a call to action. What would you like them to think, do, or feel as a result of attending your presentation?
www.javapolis.com
Q&A
View JavaPolis talks @ www.parleys.com