Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

19
Java Web Services Java Web Services CSCI 4300 CSCI 4300 Diagrams from the Sun Java Web Diagrams from the Sun Java Web Services Tutorial, Services Tutorial, http://java.sun.com/webservices/docs/ http://java.sun.com/webservices/docs/ 1.6/tutorial/doc/ 1.6/tutorial/doc/

Transcript of Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Page 1: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Java Web ServicesJava Web Services CSCI 4300CSCI 4300

Diagrams from the Sun Java Web Services Diagrams from the Sun Java Web Services Tutorial,Tutorial,

http://java.sun.com/webservices/docs/1.6/tutorial/doc/http://java.sun.com/webservices/docs/1.6/tutorial/doc/

Page 2: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

What are Web Services?What are Web Services?

• Business-to-Business (B2B) communication• Packaged in XML “SOAP” messages

Page 3: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Example: Travel AgentExample: Travel Agent

Page 4: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Service-Oriented Architecture Service-Oriented Architecture (SOA)(SOA)

Needs:1. Mechanism for discovering services (registry)2. Language for specifying service contract (Web

service semantic)

Page 5: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Simple Object Access Protocol Simple Object Access Protocol (SOAP)(SOAP)

• Envelope: top-level element, represents entire message

• Header: optional info to guide delivery and processing by multiple actors, e.g. shipping, logging, accounting

• Body: contains request / response info

• Fault: carries error messages

<?xml version="1.0"?<soap:Envelope xmlns:soap=…"> <soap:Header> ... ... </soap:Header> <soap:Body> ... ... <soap:Fault> ... ... </soap:Fault> </soap:Body>

</soap:Envelope>

Page 6: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Interfacing SOAP with Proprietary Interfacing SOAP with Proprietary business processbusiness process

Page 7: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Example: SOAP over AJAX Example: SOAP over AJAX

• Using a “WS” package to handle SOAP encoding

Page 8: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

XHttpRequest lifecycleXHttpRequest lifecycle

Page 9: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Java XML Binding (JAXB)Java XML Binding (JAXB)

• Marshalling: collecting data into XML• Binding: generating Java classes to represent

XML

Page 10: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

How Binding WorksHow Binding Works

Page 11: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Old-school remote Java: RMIOld-school remote Java: RMI

Page 12: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Remote Java using Web Services Remote Java using Web Services Model (JAX-RPC)Model (JAX-RPC)

Page 13: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Another View of JAX-RPCAnother View of JAX-RPC

• This shows the JAX-RPC runtime and HTTP/SOAP transport

• In this case client and server are both Java

Page 14: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Yet Another ViewYet Another View

• Showing the role of WSDL to coordinate client and server

• In his case the client is not necessarily in Java!

Page 15: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

Java XML Registry (JAXR)Java XML Registry (JAXR)

• Java API overlaid on native registry systems • A registry allows location of objects

Page 16: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

WSDL (Fujitsu version)WSDL (Fujitsu version)

Page 17: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

WSDL (Sun version)WSDL (Sun version)

Page 18: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

UDDI ArchitectureUDDI Architecture

Page 19: Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,

AcknowledgementsAcknowledgements

• Webservices strategy: http://www.webservices-strategy.com/

• SOAP/proprietary interface: http://www.ebizq.net• SOAP over AJAX diagrams:

http://www.ibm.com/developerworks/webservices/library/ws-wsajax/

• Web services architecture:

http://www.w3.org/2003/Talks/0317-ws-intro/• Fujitsu WDSL diagram: xml.fujitsu.com

• RPC diagrams: http://www.onjava.com/pub/a/onjava/2002/04/24/jax-rpc.html

• “Figure 1”: http://dev2dev.bea.com/lpt/a/345

• JAX-J2EE: www.vsj.co.uk