SlideShare uma empresa Scribd logo
1 de 139
Application
Integration
What is Application Integration?
 Mechanism to allow different software to share, route,
or aggregate information
 Sharing, routing, or aggregating information among
application is fundamental to business process
Why care about application integration?
 It improves the flow of information
 It reduces errors and friction in business process
 It helps people get access to information easily
 It HELPS your business.
Who Deals with Application Integration?
 Companies with heterogeneous internal systems
Accounting/
Finance
(Oracle)
Marketing
(Microsoft)
Operation
(SAP)
Human Resources
(JD Edwards)
Information
Systems
Who Deals with Application Integration?
 Companies that are exposing their systems to
business partners
Supplier
Supplier
Supplier
Widget Corp.
Distributors
(US)
Distributors
(Asia)
Distributors
(Europe)
Study Case: Hershey ERP Integration
 1999: $112 million on ERP integration involving
software from SAP, Manugistics, and Siebel
 2000: Problem arises on Order Processing, revenues
drop 19%, blamed and systems problem. Promised
to improve information flow
 2002: Successfully integrating 95% of its business
processing. Benefits:
 Reduced costs and processing times
 Near zero-defect production environment
 Reduced packaging stock outs
How is application integration executed?
 Data-level
How is application integration executed?
 Application-level integration
Data-level Integration
 Applications share information by sharing databases
 Minimum needs to modify existing application
 Useful to build data warehouse (extract and
aggregate data to produce useful report)
 Less costly and easier to execute than Application –
level integration
Application-level Integration
 Applications share information by exposing their
Application Programming Interfaces (APIs).
 Reduce code duplicates and maintain business rules
 Good to use when applications perform transactional
process
 More difficult and expansive to execute than Data-
level integration
Communication Middleware
 Communication Middleware helps applications to
interact to each others
 Hides complexities of performing network
communication
 Programmers/developers concentrate on solving
business problem
 Figure of Communication Middleware
MOM Middleware Styles
 Message-oriented middleware (MOM)
 Asynchronous, peer based style of communication for
passing messages
 IBM WebSphereMQ, Microsoft MQ,Sonic Software
SonicMQ, TIBCO Rendezvous
 Two application using different MOM products cannot
interact
RPC Middleware Styles
 Remote Procedure Call (RPC) middleware
 Synchronous, client/server based style of communication
 Client invokes methods provided by the middleware that are
routed/mapped to the server
 More intuitive than MOM
 Open Network Computing (ONC) RPC, Microsoft DCOM, Common
Object Request Broker Architecture (CORBA), and Java RMI
 It’s hard to find single RPC systems that all your programming
languages
Challenges with Traditional Middleware
 RPC Middleware uses tightly coupled connection
 MOM Middleware uses loosely coupled connection,
but harder to use than RPC styles
 Most of RPC & MOM Middleware uses proprietary
protocol
 Traditional middleware solutions are expensive
 Traditional middleware does not work across the
Internet
Web Service to the rescue
Web Services promote several benefits that transform
application integration process less painful:
 It solves the heterogeneous communication problems
 It is easier to learn and implement
 It is less expensive than the traditional middleware
 It promotes the promise of reusability
W e b S e r v i c e s
Web Services
 Defining Web Services
 Why Web Services?
 Characteristics of Web Services
 Web Services Quick Study Cases
 Web Services Technologies
Defining Web Services
 Web Service is a service oriented application that
communicates over the Internet using XML
messages
 Web Service is a Web resource that provides an API
 Web Service is an application with a Web API
Why Web Services
Reviewing issues with traditional middleware:
 Does not support heterogeneity
 Does not work across the Internet
 Does not promote reusability
 Hard to use
 Expensive
Characteristics of Web Services
 Web services provides an interface – a Web API
 Web services is typically registered
 Loosely couple connection
Web Service Study Case
 Kinko’s
 Google
 Amazon
 UPS
 Merrill Lynch
Web Services Technologies
 The Web
 Global interconnection
 XML (XML Schema, XSLT)
 Platforms & languages independent
 SOA
 Describe a service (WSDL)
 Advertise and discover a service (UDDI)
 Communicate with other services (SOAP)
SOA
 Service-Oriented Architecture
SOA (Continued…)
 SOA Patterns on Web Services
WSDL
 Web Services Descriptor Languages
 WSDL is an XML language that describes a Web
Service.
 WSDL is contract between the service provider and
service consumer
 WSDL describes WHAT, HOW, and WHERE
WSDL (Continued…)
UDDI
 Universal Description, Discovery, and Integration
 UDDI provides a mechanism to publish and discover
Web services.
 UDDI provides a mechanism to categorize business
and services
 UDDI manages information about service types and
service providers
 UDDI conceptually is a yellow page, a white page,
and a green page.
UDDI (Continued…)
SOAP
 Simple Object Access Protocol
 SOAP is an XML protocol used to communicate with
Web services
 SOAP provides a container for an XML message (a
header and a body)
 The SOAP body contains the message payload
 SOAP message can be sent over any transport
protocol
SOAP (Continued…)
S O A P
Simple Object Access Protocol
Introducing SOAP
 Simple Object Access Protocol
 SOAP is a protocol used to exchange message between
SOAP applications on the network (Intranet & Internet)
 Utilizing text-based data representation using XML
 Enabling communication between heterogeneous
applications in a distributed environment
Why SOAP?
 Programming language independent
 Firewall friendly with HTTP Tunneling
 Appropriate/ better choice for application-to-
application communication (B2B)
 Problems with current Client-Server Protocols
(DCOM or RMI IIOP)
 A format that is agreed by all major industry players
that will work over the common internet protocols
SOAP Message
 SOAP Message is an instance of SOAP XML Document
 SOAP defined how messages can be structured and
processed by software
 Two types of SOAP Message: SOAP Request and SOAP
Response
 SOAP 1.1 specifies that a SOAP Message contains:
o Envelope
o Header
o Body
o Attachment
SOAP Message
SOAP Message
SOAP Message
SOAP Message
SOAP Message
SOAP Nodes
 Types of SOAP Nodes
 SOAP Sender (generates & sends message)
 SOAP Receiver (receives & processes message)
 SOAP Intermediary (can switch role as a sender &
receiver)
SOAP Nodes - Intermediaries
 Auditing/ logging a message
 Storing the message for reliability
 Checking security credentials
 Encrypting and decrypting the message
 Validating payload
 Transforming the payload
 Etc…
SOAP’s Basic Structure
SOAP Envelope
 It is the primary, mandatory, and root of SOAP Message
 SOAP Envelope that does not follow the namespace is
considered to be invalid
 It contains 2 possible children (SOAP-Header & SOAP
Body)
SOAP Envelope
SOAP Header
 SOAP Header contains useful information in decoding a
payload (from, to, service, action, etc)
 It is the first immediate child element of a SOAP Envelope
and it has to be a namespace qualified
 It may contain 0/more optional child elements commonly
called as “header block”
 SOAP specification defines rules by which header block
must be processed in the message path
SOAP Header
 Two special attributes for SOAP Header
 mustUnderstand (do not process if you do not
understand)
o mustUnderstand=“0” | “1”
 actor (determines which code modules will process the
particular header block)
o actor=http://www.sjsu.edu/validateStudent
SOAP actor Attribute
 Actor attribute is used in combination with XML
namespace to determine which code modules will
process the particular header block
 Process:
 A node receives a SOAP message
 The node checks if it has a role designated by the actor
attribute in the header block
 If yes, choose the correct module to process the header
block
 Else, ignore the SOAP header block
SOAP mustUnderstand attribute
 SOAP nodes must be able to process any header
block that’s marked as mandatory if they play the role
specified by the actor attribute
 Understand means the node must recognize the
header block by its XML structure and know how to
process it
 If a node fails to understand a mandatory header
block, it must generate SOAP fault and discard the
message.
SOAP Header
SOAP Body
 It is a required element in a SOAP Message
 There must be 1 or more SOAP Body elements in the
body
 Body block can contain:
• Information defining the RPC Call
• Business document in XML
• SOAP Fault for reporting error/status information
SOAP Fault
 It is contained inside SOAP Body
 It is a mechanism to handle and report error “upstream”,
to the nodes earlier in the message path
 It is generated by receivers, either an intermediary or the
ultimate receiver of a message
 A receiver is required to send a SOAP fault back to
sender only if bidirectional MEP is used. SOAP faults are
returned to the receiver’s immediate sender
 If unidirectional MEP is used, the receiver should
generate a fault and may store it somewhere, but it must
not attempt to transmit it to sender
SOAP Fault
Faults are usually caused by improper message
formatting, version mismatch, trouble processing
a header, and application specific error
When fault message is generated, a SOAP Body
must contain only a single fault element and
nothing else.
A <soap:fault> element must contain a
<faultcode> element, a <faultstring> element,
and optionally <faultactor> and <detail>
elements.
<faultcode> element
 <faultcode> may use any of for standard SOAP fault
code to identify an error
 Client (receiver is unable to process the SOAP message)
 Server (Malfunctioned occurs in the receiver)
 Mismatch (Receiver does not understand the namespace
specified on the SOAP envelope)
 MustUnderstand (Fail to recognize/understand the required
header block)
<faultstring> element
 It is a mandatory element when a <fault> element
exists.
 It should provide a human-readable description of the
fault
<faultactor> and <detail> elements
 <faultactor> indicates which role in the node that
encountered the error and generated the fault. It’s an
optional element
 <detail> provides a detail information about the
specific error
SOAP Attachment
 SOAP Message may contain SOAP Attachments in any
data formats (ASCII/ Binary)
 SOAP Attachments are not part of SOAP Envelope
 Each attachment is identified with a content-id or a
content-location that can be refer by the SOAP Body block
element
SOAP Attachment
SOAP Message Exchange Patterns
 Messaging Exchange Patterns refers to the flows of
messages on the network
 One Way (Unidirectional)
 Request/Response (Bidirectional)
SOAP Messaging Modes
 Two types of SOAP Communication Models
 SOAP RPC/Literal mode
o Remote Procedural Call-based synchronous
communication and tightly coupled using
 SOAP Document/Literal mode (Messaging)
o Document-driven communication and loosely coupled
Document/Literal Mode (Messaging)
 SOAP Body contains any valid XML message (such
as purchase order)
 Maybe respond immediately (bidirectional MEP) or
later (unidirectional MEP)
 Suitable for asynchronous processing
 Expose and exploit lower-level SOAP APIs to build
the SOAP Message and send it
RPC/Literal Mode
 Suitable for synchronous processing (bidirectional MEP)
 It enables SOAP message to model a call to procedure/method
with parameters and return values
 An RPC Request message contains the method name and input
parameters of the call
 An RPC Response contains the return value and any output
parameters
 RPC mode is commonly used to expose traditional components
as Web Service
SOAP RPC vs. SOAP Document
 SOAP RPC Mode
 More intuitive more developer to use
 Message can be validated according to the schema
 SOAP Document Mode
 A more loosely coupled approach
 A more peer to peer approach
Security Issues
 Authentication
 Verifying identity of user/application
 Authorization
 Determine the authenticated entity has permission to
perform a specific action
 Confidentiality
 Preventing unauthorized access
 Integrity
 Preventing unauthorized modification
 No repudiation
 Provides a proof that a particular entity sent a message
Securing SOAP Messages
 Secure Sockets Layer/ Transport Layer Security
(SSL/TLS)
 Hypertext Transfer Protocol Secure (HTTPSS)
 Digital Signature
Utilizing SOAP Header for Security Use
 Provide login information
 Make sure it’s encrypted
 Provide a security token
 Digital certificates
 Kerberos
 Security Assertions Markup Language (SAML)
authentication
SOAP with Apache Axis
 Apache eXtensible Interaction Systems
 A middleware engine that processes SOAP Message
 Open-source implementation
 Provides a Java-based SOAP implementation for
developing Web Services
 Pluggable to Tomcat/Servlet Engine
 Portable for non-J2EE application (as long as JVM is
available)
Axis as Core Web Services Solution
 Axis Programming Model
 Creating the Service & Client
 Axis Deployment Model
 Easy deployment toolkit
 JWS and WSDD
 Apache Axis SOAP Engine
 Provides classes to create and parse SOAP Message
Roles of Axis SOAP Engine
Roles of Axis SOAP Engine
 Receive a message from transport
 Check the SOAP semantics
 Process the SOAP Headers
 De-serialize the message
 Route the message to the service
 Serialize the response
 Send the response back over the transport
W S D L
(Web Services Description Language)
Introducing WSDL
 Web Service Descriptor Language
 A document that describes the service a Web Service (It tells
you how to use a Web Service)
 It is used to specify the exact message format, Internet protocol,
and address that a client must use to communicate with a
particular web service
 Contract between Web services providers and the clients
 Combination of Microsoft SCL (SOAP Contract Language) and
IBM NASSL(Network Accessible Service Specification
Language)
Introduction to WSDL
 It’s not simple due to designer’s intention to create IDC
(Interface Definition Language) for Web Services that’s
not tied to any specific protocol, programming language,
or operating systems
 It’s not specific to SOAP. It can be used to describe non-
SOAP based Web Services.
 It’s well suited for code generator which can read a WSDL
document and generate a programmatic interface for
accessing a web service
Role of WSDL in Web Service
 Provides what kind of services that are available
 Provides the location of a Web services
 Provides what kind of data that client must provide to
invoke a Web services
 Defines the structure of the messages that a Web
services sends and receives
WSDL Basic Structure
 It adheres WSDL XML Schema
 Important elements in a WSDL document:
Elements: Category:
<definitions> WSDL Root Element
<types> <import> WSDL Declaration
<messages> <portType> <operation> WSDL Abstract Interface
<binding> <service> <port> WSDL Implementation
WSDL Root Element
 <definitions>
 Root of WSDL document
 Name attribute is optional. It’s just to provide a name for the
WSDL document
 Namespace declarations
<?xml version=“1.0” encoding=“UTF-8”?>
<declarations name=“StockQuoteWS”
targetNamespace=“http://…”
xmlns:xsd=“http://…”
xlmns:soapbind=“http://…”.
……………………..
WSDL Declaration
 <types>
 Serves as a container for defining any data types that are not
described by XML schema built-in types
 These data types will be used by <message> definition when
declaring parts of messages
<types>
<xsd:schema targetNamespace=“http…”>
<xsd:simpleType name=“ISBN”>
<xsd:restriction base=“xsd:string”>
<xsd:pattern value=“[0-9]{9}[0-9x]”
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
</types>
WSDL Declaration
 <import>
 It provides a way to make other elements from other WSDL
documents available in to the present WSDL document
 It’s a way to modularize the WSDL document
 It’s a way to consolidate several WSDL documents that are
maintained separately into one WSDL document
<import
namespace=“http://…./StockQuote” location=“http://…/wsdl”/>
<import
namespace=“http://…./Fortune500” location=“http://…/wsdl>
WSDL Abstract Interface
 <message>
 It describe the payload of a message used by web service
 It can also describe the content of the header blocks/
<detail> fault elements that the payload could carry
 It can be defined according to RPC-style or document-style
messaging
o RPC style <message> elements describe the payloads of the
SOAP request and response message
o Document style <message> elements refer to the top level
elements in type definition
WSDL Abstract Interface
 The <message> for RPC-style
<message name=“GetBookPriceRequest”>
<part name=“isbn” type=“amz:isbn”/>
</message>
<message name=“GetBookPriceResponse”>
<part name=“price” type=“xsd:float”/>
</message>
<message name=“InvalidArgumentFault”>
<part name=“error” element= “amz:InvalidIsbnFaultDetail”/>
</message>
WSDL Abstract Interface
 The <message> for Document-Style
<types>
<xsd:schema targetNamespace=“http://…”>
<xsd:import namespace=“http://…/purchaseOrder”
schemaLocation=“http://…/purchaseOrder.xsd”
</xsd:schema>
</types>
<message name=“SubmitPurchaseOrderMessage”>
<part name=“order” element=“amz:purchaseOrder”
</message>
WSDL Abstract Interface
 <portType>
 It defines the abstract interface of Web Service, similar to
Java interface
 <operation>
 Methods of the <portType>
 Each <portType> may have one or more <operation> where
each operation elements is defined as rpc or document-style
web service method
 Each operation uses one or more message definitions to
define its input, output, faults
WSDL Abstract Vs. Java Interface
WSDL
<portType name=“BookQuote”>
<operation name=“GetBookPrice”>
<input name=“ticker” message=“GetBookPriceRequest”/>
<output name=“price” message=“GetBookPriceResponse”>
<fault name=“exception” message=“InvalidArgumentFault”>
</operation>
JAVA
public interface BookQuote
{
public float getBookPrice(Strinbg isbn) throws InvalidArgumentException;
}
WSDL Implementation
 <binding>
 Maps an abstract <portType> to a set of concrete protocol
(SOAP and HTTP), messaging style (RPC or document)
<binding name=“BookPrice_Binding” type=“BookQuote”>
<soapbind:binding style=“rpc”
<transport=“ http://schemas.xmlsoap.org/soap/http/ “>
……
</binding>
WSDL Implementation
 <service>
 Service element contains one/more <port> elements
 Each <port> represents a different web service and
assigned to a specific <binding>
<service name=“BookPriceService”>
<port name=“BookPrice_Port” binding=“BookPrice_Binding”>
<soapbind:address location=“http://…/BookQuote1”/>
</port>
<port name=“BookPrice_Failover_Port”
binding=“BookPrice_Binding”>
<soapbind:address location=“http://…/BookQuote2”/>
</port>
</service>
UDDI
Universal Description, Discovery, and
Integration
UDDI
 Enables the businesses providing e-commerce
services to register their information.
 It becomes a B2B market place.
 Initially started by IBM, Microsoft, and Ariba
 Version released 1.0, 2.0, and 3.0
 UDDI.org and OASIS (IBM, Microsoft, Sun, Oracle,
Fujitsu, Systinet, etc)
UDDI Registries
 It is the implementation of UDDI Specification
 It is a database that supports a set of standard data
structure defined by UDDI Spec
 Data structure represents information about
organizations (corporation, business units,
government agencies, etc) and technical
requirements for access to web services hosted by
these organizations
 It can be implemented using a relational database,
LDAP services, and XML databases
UDDI Registries
 Public Registries
 Available for everyone to publish/query business and service
information
 UDDI Business Registry (UBR): Massive Public Registries
o Operator Site (Microsoft, IBM, SAP, and NTT)
o Synchronized process
 Private Registries
 Available for participating organizations or groups
Interacting with a UDDI Registry
 Graphical User Interface
 Microsoft
 IBM
 HP
 Systinet
 SAP
 Programmatic Interface (JAX-R, UDDI4J, or other vendor API specific)
 Communication model to UDDI Registry is using SOAP Messages
Business’ Uses of UDDI Registry
1. White pages level – to publish business’ basic
business information such as company name,
contact info, business identifier number, etc
2. Yellow pages level – to classify business based
on its service category
3. Green pages level – to classify technical
information describing its web services information
UDDI Data Structures
 <businessEntity>
 <publisherAssertion>
 <businessService>
 <bindingTemplate>
 <tModel>
UDDI Data Structures
<businessEntity>
 It represents the primary information about business
such as:
 contact info
 categorization of the business
 Identifiers
 description of the business
<publisherAssertion>
 It represents active business relationships with other business
 UDDI Registry will not make the relationship visible to public
until both parties has created similar <publisherAssertion>
structure
<businessService>
 It represents the service of business in a logical manner
 It’s merely a logical representation of the services
 <businessService> share many to many relationships with
<businessEntity>
<bindingTemplate>
 It points to technical descriptions and access URLs of the
service
 tModel
 Access Point/ End Point
 Note: it does not represent details of the service specification
<tModel>
 It represents a description of a particular specification
or behavior of the service that is managed
somewhere else
 WSDL reference is usually published here
 It does not contain service specification directly, but it
contains a link to some specification
UDDI Programming API
 Inquiry API
Consists of XML messages defined using UDDI schema which can
be used to locate information about business
 Publisher API
Consist of XML messages which can be used to create, update,
and delete information presents in the registry. Require
authentication.
Inquiry API
 <find_business>
 <find_relatedBusiness>
 <find_service>
 <find_binding>
 <find_tModel>
 <get_businessDetail>
 <get_businessDetailExt>
 <get_serviceDetail>
 <get_tModelDetail>
Publishing API
 <save_business>
 <set_publisherAssertions>
 <add_publisherAssertions>
 <save_service>
 <save_binding>
 <save_tModel>
 <delete_business>
 <delete_publisherAssertions>
 <delete_service>
 <delete_binding>
 <delete_tModel>
Examples of <find_service>
 Request SOAP
<uddi:find_service>
<findQualifiers>
<findQualifier>
caseSensitiveMatch
</findQualifier>
</findQualifiers>
<uddi:name>
Sumatra Widget Corporation
</uddi:name>
</uddi:find_service>
Examples of <find_service>
 Response SOAP
<serviceList operator="IBM" xmlns="urn:uddi-org:api_v2">
<serviceInfos>
<serviceInfo
serviceKey="uuid:12345-1234-e3433"
businessKey="uuid:3456-s123-3435">
<name>
Import Widget Services
</name>
</serviceInfo>
</serviceInfos>
</serviceList>
Limitations of UDDI
 UDDI has limited information model compared to
ebXML Registry/ Repository
 UDDI is just a registry, not a repository
AXIS
WSDD and BeanSerializer
Limitations of Axis JWS
 It is intended for a simple web services
 You cannot use packages
 You cannot discover error until deployment
 You cannot undeploy the web services
 You cannot give an alias or mapping to the web
services
 You are exposing your source code
Axis WSDD
 Axis Web Service Deployment Descriptor
 XML-based that describe the process of the web
services deployment and undeployment
 Axis WSDD provides extra power and flexibility in
deploying your web services
Benefits from using Axis WSDD
 You write a regular Java class
 WSDD can provide alias/mapping to the services
 You can just deploy your Java classes
 You can deploy all or limited Web API
 You can undeploy without removing your classes
 You can include Java Bean as parameter or return
value
Example of WSDD (Deployment)
<deployment
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="HumanResourceSystem" provider="java:RPC">
<parameter name="className"
value="com.xyz.service.HumanResourceSystem"/>
<parameter name="allowedMethods“
value="getEmployeeByEmployeeId"/>
</service>
</deployment>
Example of WSDD (Undeployment)
<undeployment
name="UndeploymentTemperatureConverterService"
xmlns="http://xml.apache.org/axis/wsdd/">
<service name="HumanResourceSystem"/>
</undeployment>
BeanSerializer
 You can include custom Java object as parameter or
return value on a method call
 You are registering the classes that will be serialized
or deserialized WSDL will recognize and describe the
Java object
Example of WSDD with BeanSerializer
<deployment
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="HumanResourceSystem" provider="java:RPC">
<parameter name="className"
value="com.xyz.service.HumanResourceSystem"/>
<parameter name="allowedMethods"
value="getEmployeeByEmployeeId"/>
<beanMapping qname="myNS:Employee"
xmlns:myNS="urn:xyz"
languageSpecificType="java:com.xyz.valueobject.Employee"/>
</service>
</deployment>
How to Deploy and Undeploy?
 Deploying web services
java org.apache.axis.cleint.AdminClient
-l http://localhost:8080/HumanResourceService/services/AdminService
deployService.wsdd
 Undeploying web services
java org.apache.axis.cleint.AdminClient
-l http://localhost:8080/HumanResourceService/services/AdminService
undeployService.wsdd
How to Deploy and Undeploy?
1. Compile your classes
2. Deploy your application by placing it into Tomcat’s
WEB-INF folder
3. Restart Tomcat
4. Deploy/Undeploy Web Services
JAX-RPC
Introducing JAX-RPC
One of JAX-RPC features is to provide a way for
client to invoke a method remotely
It can be used by Java applications, servlet, jsp,
and EJBs to exchange SOAP messages with
remote Web Services on any platforms
2 kind of JAX-RPC approaches
 Generated Stubs
 DII (Dynamic Invocation Interface)
Generated Stubs
 Stubs are Java classes/objects provides implementation codes
to communicate to your Web Services functionalities (methods)
 As a developer, you can just see the Web Service provider just
as another regular java object.
 When a stub’s method is invoked, the JAX-RPC stub sends a
SOAP Request message to the Web Service endpoint that will
return a SOAP Response message to stub
 You don’t need to understand WSDL that much
Generated Stubs (Deployment)
Generated Stubs (Run Time)
Generated Stubs
 Sample Codes
// 1. Instantiate TemperatureConverterServiceLocator as a
// TemperatureConcerterService
TemperatureConverterService myService = new
TemperatureConverterServiceLocator();
// 2. Get TemperatureConverter object from TemperatureConverterService
TemperatureConverter converter = myService.getTemperatureConverter()
// 3. Convert Fahrenheit to Celsius by using the method provided by the
// TemperatureConverter object
double result = converter.convertFahrenheitToCelsius(34.00);
DII (Dynamic Invocation Interface)
 No stub is being used . You manually need to program
what the stub is doing for you.
 Use classes provided by JAX-RPC library
 More complicated approach since you are not seeing the
Web Service as a regular java object anymore
 You need to know and understand more details about
WSDL
 Provides you more flexibility since you are not tied to the
stubs
DII (Dynamic Invocation Interface)
 JAX-RPC Interfaces
 javax.xml.rpc.Service
o You need this to create “virtual service” that represents the
Web Service application (TemperatureConverterService)
o You need this to get a Call type object
 javax.xml.rpc.Call
o You can the endpoint where the web service is located
o This is a “virtual mapping” to your web service application
component (TemperatureConverter.jws)
DII (Dynamic Invocation Interfaces)
 Sample Codes:
// In order to create a service type object, we need to use ServiceFactory
ServiceFactory sfactory = serviceFactory.new Instance();
// Creating service type object from the factory
Service service = sfactory.creaetService(…pass service info…);
// Create a call object from service type object
Call call = service.createCall(…pass port info…);
// Set the endpoint property
call.setTargetEndpoint(..pass endpoint info..);
// Set the operation name
call.setOperationName(..pass method…);
DII (Dynamic Invocation Interfaces)
 Side Notes:
 With DII, there is no specific java data type provided when
you send data as parameters or receives data from Web
Services
 When you are invoking a connection with Web Service, you
use the invoke method from the call object
Object result = call.invoke(Object[] array);
 Invoke method only take 1 parameter (Object array)
 Invoke method will return a generic java Object
SAAJ & JAXM
SAAJ
 SOAP with Attachments API for Java
 API-based SOAP toolkit that models structure of
SOAP Messages
 SAAJ is used to manipulate SOAP Messages
 “Attachment” part is still work in progress
 It can be used independently (synchronous)
 It can be used with JAX-RPC and JAXM
SAAJ Structures
JAXM
 Java API for XML Messaging
 It is used to send pure XML document from one node
to another without calling methods
 Supports synchronous and asynchronous
communication mode
 Approved by JCP
JAXM
 Not part of J2EE specification
 Rejected by major J2EE vendors (BEA and IBM)
 Overlap capabilities with other messaging API (JMS
and JavaMail)
 Demand for JAXM is not enough in marketplace
 Future of JAXM is uncertain
 No tool to create WSDL with JAXM
Programming Steps
 Create SOAPConnection using SOAPConnectionFactory
 Create SOAPMessage using MessageFactory
 Create reference to SOAP Part object
 Create reference to SOAP Envelope from SOAP Part object
 Create reference to SOAP Header from SOAP Envelope and
remove it
 Create reference to SOAPBody from SOAP Envelope
 Add SOAP Body Element to SOAP Body and get its
reference
 Add Other elements to SOAP Body Element
 Send to receiver
 Close connection
Exercise
Exercise
 Purchase Order
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<amz:purchaseOrder xmlns:amz="http://www.amazon.com">
<amz:book>
<amz:book-title>Head First Java</amz:book-title>
<amz:price>30.00</amz:price>
<amz:quantity>10</amz:quantity>
</amz:book>
</amz:purchaseOrder>
</soapenv:Body>
</soapenv:Envelope>
Exercise
 Confirmation
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-
env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<ori:confirmation
xmlns:ori="http://www.oreilly.com">
Thank you for your order
</ori:confirmation>
</soap-env:Body>
</soap-env:Envelope>

Mais conteúdo relacionado

Mais procurados

SOAP, UDDI, WSDL. XML definitions
SOAP, UDDI, WSDL. XML definitions SOAP, UDDI, WSDL. XML definitions
SOAP, UDDI, WSDL. XML definitions Wish Mrt'xa
 
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...ecosio GmbH
 
web service technologies
web service technologiesweb service technologies
web service technologiesYash Darak
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaJignesh Aakoliya
 
Description of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDIDescription of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDITUSHAR VARSHNEY
 
Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0Aravindharamanan S
 
Xml web services
Xml web servicesXml web services
Xml web servicesRaghu nath
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method InvocationSonali Parab
 
Dot net training-navimumbai
Dot net training-navimumbaiDot net training-navimumbai
Dot net training-navimumbaivibrantuser
 
WEB SERVICES COMPOSITION METHODS AND TECHNIQUES: A REVIEW
WEB SERVICES COMPOSITION METHODS AND TECHNIQUES: A REVIEWWEB SERVICES COMPOSITION METHODS AND TECHNIQUES: A REVIEW
WEB SERVICES COMPOSITION METHODS AND TECHNIQUES: A REVIEWijcseit
 
AGENTS AND OWL-S BASED SEMANTIC WEB SERVICE DISCOVERY WITH USER PREFERENCE SU...
AGENTS AND OWL-S BASED SEMANTIC WEB SERVICE DISCOVERY WITH USER PREFERENCE SU...AGENTS AND OWL-S BASED SEMANTIC WEB SERVICE DISCOVERY WITH USER PREFERENCE SU...
AGENTS AND OWL-S BASED SEMANTIC WEB SERVICE DISCOVERY WITH USER PREFERENCE SU...IJwest
 

Mais procurados (20)

SOAP, UDDI, WSDL. XML definitions
SOAP, UDDI, WSDL. XML definitions SOAP, UDDI, WSDL. XML definitions
SOAP, UDDI, WSDL. XML definitions
 
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
 
Web service introduction 2
Web service introduction 2Web service introduction 2
Web service introduction 2
 
Introduction to Web Services
Introduction to Web ServicesIntroduction to Web Services
Introduction to Web Services
 
web service technologies
web service technologiesweb service technologies
web service technologies
 
Web services SOAP Notes
Web services SOAP NotesWeb services SOAP Notes
Web services SOAP Notes
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company india
 
WSDL 2.0 and Apache Woden
WSDL 2.0 and Apache WodenWSDL 2.0 and Apache Woden
WSDL 2.0 and Apache Woden
 
Description of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDIDescription of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDI
 
Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0Secc tutorials development and deployment of rest web services in java_v2.0
Secc tutorials development and deployment of rest web services in java_v2.0
 
Xml web services
Xml web servicesXml web services
Xml web services
 
Osbsoa1
Osbsoa1Osbsoa1
Osbsoa1
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Dot net training-navimumbai
Dot net training-navimumbaiDot net training-navimumbai
Dot net training-navimumbai
 
.NET Tutorial
.NET Tutorial.NET Tutorial
.NET Tutorial
 
WEB SERVICES COMPOSITION METHODS AND TECHNIQUES: A REVIEW
WEB SERVICES COMPOSITION METHODS AND TECHNIQUES: A REVIEWWEB SERVICES COMPOSITION METHODS AND TECHNIQUES: A REVIEW
WEB SERVICES COMPOSITION METHODS AND TECHNIQUES: A REVIEW
 
Intro To AOP
Intro To AOPIntro To AOP
Intro To AOP
 
Web Service Composition
Web Service CompositionWeb Service Composition
Web Service Composition
 
AGENTS AND OWL-S BASED SEMANTIC WEB SERVICE DISCOVERY WITH USER PREFERENCE SU...
AGENTS AND OWL-S BASED SEMANTIC WEB SERVICE DISCOVERY WITH USER PREFERENCE SU...AGENTS AND OWL-S BASED SEMANTIC WEB SERVICE DISCOVERY WITH USER PREFERENCE SU...
AGENTS AND OWL-S BASED SEMANTIC WEB SERVICE DISCOVERY WITH USER PREFERENCE SU...
 
Oracle soa training
Oracle soa training Oracle soa training
Oracle soa training
 

Destaque

Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108nit Allahabad
 
Simple API for XML
Simple API for XMLSimple API for XML
Simple API for XMLguest2556de
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPIMC Institute
 
Java Web Services [5/5]: REST and JAX-RS
Java Web Services [5/5]: REST and JAX-RSJava Web Services [5/5]: REST and JAX-RS
Java Web Services [5/5]: REST and JAX-RSIMC Institute
 
Xml Java
Xml JavaXml Java
Xml Javacbee48
 
Java Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIJava Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIIMC Institute
 
java API for XML DOM
java API for XML DOMjava API for XML DOM
java API for XML DOMSurinder Kaur
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesIMC Institute
 
Web Technologies in Java EE 7
Web Technologies in Java EE 7Web Technologies in Java EE 7
Web Technologies in Java EE 7Lukáš Fryč
 
Java Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesJava Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesIMC Institute
 
Community and Java EE @ DevConf.CZ
Community and Java EE @ DevConf.CZCommunity and Java EE @ DevConf.CZ
Community and Java EE @ DevConf.CZMarkus Eisele
 
Writing simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorWriting simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorSantosh Kumar Kar
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutesglassfish
 

Destaque (17)

JAXP
JAXPJAXP
JAXP
 
Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108Jaxp Xmltutorial 11 200108
Jaxp Xmltutorial 11 200108
 
Simple API for XML
Simple API for XMLSimple API for XML
Simple API for XML
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAP
 
Java Web Services [5/5]: REST and JAX-RS
Java Web Services [5/5]: REST and JAX-RSJava Web Services [5/5]: REST and JAX-RS
Java Web Services [5/5]: REST and JAX-RS
 
Xml Java
Xml JavaXml Java
Xml Java
 
Java Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIJava Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDI
 
java API for XML DOM
java API for XML DOMjava API for XML DOM
java API for XML DOM
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web Services
 
Web Technologies in Java EE 7
Web Technologies in Java EE 7Web Technologies in Java EE 7
Web Technologies in Java EE 7
 
Java Web Services
Java Web ServicesJava Web Services
Java Web Services
 
Java Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web ServicesJava Web Services [4/5]: Java API for XML Web Services
Java Web Services [4/5]: Java API for XML Web Services
 
6 xml parsing
6   xml parsing6   xml parsing
6 xml parsing
 
Java XML Parsing
Java XML ParsingJava XML Parsing
Java XML Parsing
 
Community and Java EE @ DevConf.CZ
Community and Java EE @ DevConf.CZCommunity and Java EE @ DevConf.CZ
Community and Java EE @ DevConf.CZ
 
Writing simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorWriting simple web services in java using eclipse editor
Writing simple web services in java using eclipse editor
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
 

Semelhante a Java Web Service - Summer 2004

Soa business centric and soap basic
Soa business centric and soap basicSoa business centric and soap basic
Soa business centric and soap basicJothi Lakshmi
 
Web services for developer
Web services for developerWeb services for developer
Web services for developerRafiq Ahmed
 
Web services concepts, protocols and development
Web services concepts, protocols and developmentWeb services concepts, protocols and development
Web services concepts, protocols and developmentishmecse13
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technologysanjoysanyal
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technologysanjoysanyal
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolMasud Rahman
 
Soap web service
Soap web serviceSoap web service
Soap web serviceNITT, KAMK
 
fffSeminar
fffSeminarfffSeminar
fffSeminarpavanpp
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architectureYisal Khan
 
Web services and SOA
Web services and SOAWeb services and SOA
Web services and SOASubin Sugunan
 
Introduction to soapui and webservices
Introduction to soapui  and webservicesIntroduction to soapui  and webservices
Introduction to soapui and webservicesAnil Yadav
 
Osb Bam Integration
Osb Bam IntegrationOsb Bam Integration
Osb Bam Integrationguest6070853
 
SynapseIndia dotnet web applications development
SynapseIndia  dotnet web applications developmentSynapseIndia  dotnet web applications development
SynapseIndia dotnet web applications developmentSynapseindiappsdevelopment
 

Semelhante a Java Web Service - Summer 2004 (20)

Soa business centric and soap basic
Soa business centric and soap basicSoa business centric and soap basic
Soa business centric and soap basic
 
soap toolkit
soap toolkitsoap toolkit
soap toolkit
 
Web services
Web servicesWeb services
Web services
 
Web services for developer
Web services for developerWeb services for developer
Web services for developer
 
Web services concepts, protocols and development
Web services concepts, protocols and developmentWeb services concepts, protocols and development
Web services concepts, protocols and development
 
SOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIESSOAP WEB TECHNOLOGIES
SOAP WEB TECHNOLOGIES
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
SOA and web services
SOA and web servicesSOA and web services
SOA and web services
 
MIDELWARE TECH
MIDELWARE TECHMIDELWARE TECH
MIDELWARE TECH
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access Protocol
 
Service view
Service viewService view
Service view
 
Soap web service
Soap web serviceSoap web service
Soap web service
 
fffSeminar
fffSeminarfffSeminar
fffSeminar
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
 
Web services and SOA
Web services and SOAWeb services and SOA
Web services and SOA
 
Introduction to soapui and webservices
Introduction to soapui  and webservicesIntroduction to soapui  and webservices
Introduction to soapui and webservices
 
Osb Bam Integration
Osb Bam IntegrationOsb Bam Integration
Osb Bam Integration
 
SynapseIndia dotnet web applications development
SynapseIndia  dotnet web applications developmentSynapseIndia  dotnet web applications development
SynapseIndia dotnet web applications development
 

Último

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Último (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

Java Web Service - Summer 2004

  • 2. What is Application Integration?  Mechanism to allow different software to share, route, or aggregate information  Sharing, routing, or aggregating information among application is fundamental to business process
  • 3. Why care about application integration?  It improves the flow of information  It reduces errors and friction in business process  It helps people get access to information easily  It HELPS your business.
  • 4. Who Deals with Application Integration?  Companies with heterogeneous internal systems Accounting/ Finance (Oracle) Marketing (Microsoft) Operation (SAP) Human Resources (JD Edwards) Information Systems
  • 5. Who Deals with Application Integration?  Companies that are exposing their systems to business partners Supplier Supplier Supplier Widget Corp. Distributors (US) Distributors (Asia) Distributors (Europe)
  • 6. Study Case: Hershey ERP Integration  1999: $112 million on ERP integration involving software from SAP, Manugistics, and Siebel  2000: Problem arises on Order Processing, revenues drop 19%, blamed and systems problem. Promised to improve information flow  2002: Successfully integrating 95% of its business processing. Benefits:  Reduced costs and processing times  Near zero-defect production environment  Reduced packaging stock outs
  • 7. How is application integration executed?  Data-level
  • 8. How is application integration executed?  Application-level integration
  • 9. Data-level Integration  Applications share information by sharing databases  Minimum needs to modify existing application  Useful to build data warehouse (extract and aggregate data to produce useful report)  Less costly and easier to execute than Application – level integration
  • 10. Application-level Integration  Applications share information by exposing their Application Programming Interfaces (APIs).  Reduce code duplicates and maintain business rules  Good to use when applications perform transactional process  More difficult and expansive to execute than Data- level integration
  • 11. Communication Middleware  Communication Middleware helps applications to interact to each others  Hides complexities of performing network communication  Programmers/developers concentrate on solving business problem  Figure of Communication Middleware
  • 12. MOM Middleware Styles  Message-oriented middleware (MOM)  Asynchronous, peer based style of communication for passing messages  IBM WebSphereMQ, Microsoft MQ,Sonic Software SonicMQ, TIBCO Rendezvous  Two application using different MOM products cannot interact
  • 13. RPC Middleware Styles  Remote Procedure Call (RPC) middleware  Synchronous, client/server based style of communication  Client invokes methods provided by the middleware that are routed/mapped to the server  More intuitive than MOM  Open Network Computing (ONC) RPC, Microsoft DCOM, Common Object Request Broker Architecture (CORBA), and Java RMI  It’s hard to find single RPC systems that all your programming languages
  • 14. Challenges with Traditional Middleware  RPC Middleware uses tightly coupled connection  MOM Middleware uses loosely coupled connection, but harder to use than RPC styles  Most of RPC & MOM Middleware uses proprietary protocol  Traditional middleware solutions are expensive  Traditional middleware does not work across the Internet
  • 15. Web Service to the rescue Web Services promote several benefits that transform application integration process less painful:  It solves the heterogeneous communication problems  It is easier to learn and implement  It is less expensive than the traditional middleware  It promotes the promise of reusability
  • 16.
  • 17. W e b S e r v i c e s
  • 18. Web Services  Defining Web Services  Why Web Services?  Characteristics of Web Services  Web Services Quick Study Cases  Web Services Technologies
  • 19. Defining Web Services  Web Service is a service oriented application that communicates over the Internet using XML messages  Web Service is a Web resource that provides an API  Web Service is an application with a Web API
  • 20. Why Web Services Reviewing issues with traditional middleware:  Does not support heterogeneity  Does not work across the Internet  Does not promote reusability  Hard to use  Expensive
  • 21. Characteristics of Web Services  Web services provides an interface – a Web API  Web services is typically registered  Loosely couple connection
  • 22. Web Service Study Case  Kinko’s  Google  Amazon  UPS  Merrill Lynch
  • 23. Web Services Technologies  The Web  Global interconnection  XML (XML Schema, XSLT)  Platforms & languages independent  SOA  Describe a service (WSDL)  Advertise and discover a service (UDDI)  Communicate with other services (SOAP)
  • 25. SOA (Continued…)  SOA Patterns on Web Services
  • 26. WSDL  Web Services Descriptor Languages  WSDL is an XML language that describes a Web Service.  WSDL is contract between the service provider and service consumer  WSDL describes WHAT, HOW, and WHERE
  • 28. UDDI  Universal Description, Discovery, and Integration  UDDI provides a mechanism to publish and discover Web services.  UDDI provides a mechanism to categorize business and services  UDDI manages information about service types and service providers  UDDI conceptually is a yellow page, a white page, and a green page.
  • 30. SOAP  Simple Object Access Protocol  SOAP is an XML protocol used to communicate with Web services  SOAP provides a container for an XML message (a header and a body)  The SOAP body contains the message payload  SOAP message can be sent over any transport protocol
  • 32.
  • 33. S O A P Simple Object Access Protocol
  • 34. Introducing SOAP  Simple Object Access Protocol  SOAP is a protocol used to exchange message between SOAP applications on the network (Intranet & Internet)  Utilizing text-based data representation using XML  Enabling communication between heterogeneous applications in a distributed environment
  • 35. Why SOAP?  Programming language independent  Firewall friendly with HTTP Tunneling  Appropriate/ better choice for application-to- application communication (B2B)  Problems with current Client-Server Protocols (DCOM or RMI IIOP)  A format that is agreed by all major industry players that will work over the common internet protocols
  • 36. SOAP Message  SOAP Message is an instance of SOAP XML Document  SOAP defined how messages can be structured and processed by software  Two types of SOAP Message: SOAP Request and SOAP Response  SOAP 1.1 specifies that a SOAP Message contains: o Envelope o Header o Body o Attachment
  • 42. SOAP Nodes  Types of SOAP Nodes  SOAP Sender (generates & sends message)  SOAP Receiver (receives & processes message)  SOAP Intermediary (can switch role as a sender & receiver)
  • 43. SOAP Nodes - Intermediaries  Auditing/ logging a message  Storing the message for reliability  Checking security credentials  Encrypting and decrypting the message  Validating payload  Transforming the payload  Etc…
  • 45. SOAP Envelope  It is the primary, mandatory, and root of SOAP Message  SOAP Envelope that does not follow the namespace is considered to be invalid  It contains 2 possible children (SOAP-Header & SOAP Body)
  • 47. SOAP Header  SOAP Header contains useful information in decoding a payload (from, to, service, action, etc)  It is the first immediate child element of a SOAP Envelope and it has to be a namespace qualified  It may contain 0/more optional child elements commonly called as “header block”  SOAP specification defines rules by which header block must be processed in the message path
  • 48. SOAP Header  Two special attributes for SOAP Header  mustUnderstand (do not process if you do not understand) o mustUnderstand=“0” | “1”  actor (determines which code modules will process the particular header block) o actor=http://www.sjsu.edu/validateStudent
  • 49. SOAP actor Attribute  Actor attribute is used in combination with XML namespace to determine which code modules will process the particular header block  Process:  A node receives a SOAP message  The node checks if it has a role designated by the actor attribute in the header block  If yes, choose the correct module to process the header block  Else, ignore the SOAP header block
  • 50. SOAP mustUnderstand attribute  SOAP nodes must be able to process any header block that’s marked as mandatory if they play the role specified by the actor attribute  Understand means the node must recognize the header block by its XML structure and know how to process it  If a node fails to understand a mandatory header block, it must generate SOAP fault and discard the message.
  • 52. SOAP Body  It is a required element in a SOAP Message  There must be 1 or more SOAP Body elements in the body  Body block can contain: • Information defining the RPC Call • Business document in XML • SOAP Fault for reporting error/status information
  • 53. SOAP Fault  It is contained inside SOAP Body  It is a mechanism to handle and report error “upstream”, to the nodes earlier in the message path  It is generated by receivers, either an intermediary or the ultimate receiver of a message  A receiver is required to send a SOAP fault back to sender only if bidirectional MEP is used. SOAP faults are returned to the receiver’s immediate sender  If unidirectional MEP is used, the receiver should generate a fault and may store it somewhere, but it must not attempt to transmit it to sender
  • 54. SOAP Fault Faults are usually caused by improper message formatting, version mismatch, trouble processing a header, and application specific error When fault message is generated, a SOAP Body must contain only a single fault element and nothing else. A <soap:fault> element must contain a <faultcode> element, a <faultstring> element, and optionally <faultactor> and <detail> elements.
  • 55. <faultcode> element  <faultcode> may use any of for standard SOAP fault code to identify an error  Client (receiver is unable to process the SOAP message)  Server (Malfunctioned occurs in the receiver)  Mismatch (Receiver does not understand the namespace specified on the SOAP envelope)  MustUnderstand (Fail to recognize/understand the required header block)
  • 56. <faultstring> element  It is a mandatory element when a <fault> element exists.  It should provide a human-readable description of the fault
  • 57. <faultactor> and <detail> elements  <faultactor> indicates which role in the node that encountered the error and generated the fault. It’s an optional element  <detail> provides a detail information about the specific error
  • 58. SOAP Attachment  SOAP Message may contain SOAP Attachments in any data formats (ASCII/ Binary)  SOAP Attachments are not part of SOAP Envelope  Each attachment is identified with a content-id or a content-location that can be refer by the SOAP Body block element
  • 60. SOAP Message Exchange Patterns  Messaging Exchange Patterns refers to the flows of messages on the network  One Way (Unidirectional)  Request/Response (Bidirectional)
  • 61. SOAP Messaging Modes  Two types of SOAP Communication Models  SOAP RPC/Literal mode o Remote Procedural Call-based synchronous communication and tightly coupled using  SOAP Document/Literal mode (Messaging) o Document-driven communication and loosely coupled
  • 62. Document/Literal Mode (Messaging)  SOAP Body contains any valid XML message (such as purchase order)  Maybe respond immediately (bidirectional MEP) or later (unidirectional MEP)  Suitable for asynchronous processing  Expose and exploit lower-level SOAP APIs to build the SOAP Message and send it
  • 63. RPC/Literal Mode  Suitable for synchronous processing (bidirectional MEP)  It enables SOAP message to model a call to procedure/method with parameters and return values  An RPC Request message contains the method name and input parameters of the call  An RPC Response contains the return value and any output parameters  RPC mode is commonly used to expose traditional components as Web Service
  • 64. SOAP RPC vs. SOAP Document  SOAP RPC Mode  More intuitive more developer to use  Message can be validated according to the schema  SOAP Document Mode  A more loosely coupled approach  A more peer to peer approach
  • 65. Security Issues  Authentication  Verifying identity of user/application  Authorization  Determine the authenticated entity has permission to perform a specific action  Confidentiality  Preventing unauthorized access  Integrity  Preventing unauthorized modification  No repudiation  Provides a proof that a particular entity sent a message
  • 66. Securing SOAP Messages  Secure Sockets Layer/ Transport Layer Security (SSL/TLS)  Hypertext Transfer Protocol Secure (HTTPSS)  Digital Signature
  • 67. Utilizing SOAP Header for Security Use  Provide login information  Make sure it’s encrypted  Provide a security token  Digital certificates  Kerberos  Security Assertions Markup Language (SAML) authentication
  • 68. SOAP with Apache Axis  Apache eXtensible Interaction Systems  A middleware engine that processes SOAP Message  Open-source implementation  Provides a Java-based SOAP implementation for developing Web Services  Pluggable to Tomcat/Servlet Engine  Portable for non-J2EE application (as long as JVM is available)
  • 69. Axis as Core Web Services Solution  Axis Programming Model  Creating the Service & Client  Axis Deployment Model  Easy deployment toolkit  JWS and WSDD  Apache Axis SOAP Engine  Provides classes to create and parse SOAP Message
  • 70. Roles of Axis SOAP Engine
  • 71. Roles of Axis SOAP Engine  Receive a message from transport  Check the SOAP semantics  Process the SOAP Headers  De-serialize the message  Route the message to the service  Serialize the response  Send the response back over the transport
  • 72.
  • 73. W S D L (Web Services Description Language)
  • 74. Introducing WSDL  Web Service Descriptor Language  A document that describes the service a Web Service (It tells you how to use a Web Service)  It is used to specify the exact message format, Internet protocol, and address that a client must use to communicate with a particular web service  Contract between Web services providers and the clients  Combination of Microsoft SCL (SOAP Contract Language) and IBM NASSL(Network Accessible Service Specification Language)
  • 75. Introduction to WSDL  It’s not simple due to designer’s intention to create IDC (Interface Definition Language) for Web Services that’s not tied to any specific protocol, programming language, or operating systems  It’s not specific to SOAP. It can be used to describe non- SOAP based Web Services.  It’s well suited for code generator which can read a WSDL document and generate a programmatic interface for accessing a web service
  • 76. Role of WSDL in Web Service  Provides what kind of services that are available  Provides the location of a Web services  Provides what kind of data that client must provide to invoke a Web services  Defines the structure of the messages that a Web services sends and receives
  • 77. WSDL Basic Structure  It adheres WSDL XML Schema  Important elements in a WSDL document: Elements: Category: <definitions> WSDL Root Element <types> <import> WSDL Declaration <messages> <portType> <operation> WSDL Abstract Interface <binding> <service> <port> WSDL Implementation
  • 78. WSDL Root Element  <definitions>  Root of WSDL document  Name attribute is optional. It’s just to provide a name for the WSDL document  Namespace declarations <?xml version=“1.0” encoding=“UTF-8”?> <declarations name=“StockQuoteWS” targetNamespace=“http://…” xmlns:xsd=“http://…” xlmns:soapbind=“http://…”. ……………………..
  • 79. WSDL Declaration  <types>  Serves as a container for defining any data types that are not described by XML schema built-in types  These data types will be used by <message> definition when declaring parts of messages <types> <xsd:schema targetNamespace=“http…”> <xsd:simpleType name=“ISBN”> <xsd:restriction base=“xsd:string”> <xsd:pattern value=“[0-9]{9}[0-9x]” </xsd:restriction> </xsd:simpleType> </xsd:schema> </types>
  • 80. WSDL Declaration  <import>  It provides a way to make other elements from other WSDL documents available in to the present WSDL document  It’s a way to modularize the WSDL document  It’s a way to consolidate several WSDL documents that are maintained separately into one WSDL document <import namespace=“http://…./StockQuote” location=“http://…/wsdl”/> <import namespace=“http://…./Fortune500” location=“http://…/wsdl>
  • 81. WSDL Abstract Interface  <message>  It describe the payload of a message used by web service  It can also describe the content of the header blocks/ <detail> fault elements that the payload could carry  It can be defined according to RPC-style or document-style messaging o RPC style <message> elements describe the payloads of the SOAP request and response message o Document style <message> elements refer to the top level elements in type definition
  • 82. WSDL Abstract Interface  The <message> for RPC-style <message name=“GetBookPriceRequest”> <part name=“isbn” type=“amz:isbn”/> </message> <message name=“GetBookPriceResponse”> <part name=“price” type=“xsd:float”/> </message> <message name=“InvalidArgumentFault”> <part name=“error” element= “amz:InvalidIsbnFaultDetail”/> </message>
  • 83. WSDL Abstract Interface  The <message> for Document-Style <types> <xsd:schema targetNamespace=“http://…”> <xsd:import namespace=“http://…/purchaseOrder” schemaLocation=“http://…/purchaseOrder.xsd” </xsd:schema> </types> <message name=“SubmitPurchaseOrderMessage”> <part name=“order” element=“amz:purchaseOrder” </message>
  • 84. WSDL Abstract Interface  <portType>  It defines the abstract interface of Web Service, similar to Java interface  <operation>  Methods of the <portType>  Each <portType> may have one or more <operation> where each operation elements is defined as rpc or document-style web service method  Each operation uses one or more message definitions to define its input, output, faults
  • 85. WSDL Abstract Vs. Java Interface WSDL <portType name=“BookQuote”> <operation name=“GetBookPrice”> <input name=“ticker” message=“GetBookPriceRequest”/> <output name=“price” message=“GetBookPriceResponse”> <fault name=“exception” message=“InvalidArgumentFault”> </operation> JAVA public interface BookQuote { public float getBookPrice(Strinbg isbn) throws InvalidArgumentException; }
  • 86. WSDL Implementation  <binding>  Maps an abstract <portType> to a set of concrete protocol (SOAP and HTTP), messaging style (RPC or document) <binding name=“BookPrice_Binding” type=“BookQuote”> <soapbind:binding style=“rpc” <transport=“ http://schemas.xmlsoap.org/soap/http/ “> …… </binding>
  • 87. WSDL Implementation  <service>  Service element contains one/more <port> elements  Each <port> represents a different web service and assigned to a specific <binding> <service name=“BookPriceService”> <port name=“BookPrice_Port” binding=“BookPrice_Binding”> <soapbind:address location=“http://…/BookQuote1”/> </port> <port name=“BookPrice_Failover_Port” binding=“BookPrice_Binding”> <soapbind:address location=“http://…/BookQuote2”/> </port> </service>
  • 88.
  • 90. UDDI  Enables the businesses providing e-commerce services to register their information.  It becomes a B2B market place.  Initially started by IBM, Microsoft, and Ariba  Version released 1.0, 2.0, and 3.0  UDDI.org and OASIS (IBM, Microsoft, Sun, Oracle, Fujitsu, Systinet, etc)
  • 91. UDDI Registries  It is the implementation of UDDI Specification  It is a database that supports a set of standard data structure defined by UDDI Spec  Data structure represents information about organizations (corporation, business units, government agencies, etc) and technical requirements for access to web services hosted by these organizations  It can be implemented using a relational database, LDAP services, and XML databases
  • 92. UDDI Registries  Public Registries  Available for everyone to publish/query business and service information  UDDI Business Registry (UBR): Massive Public Registries o Operator Site (Microsoft, IBM, SAP, and NTT) o Synchronized process  Private Registries  Available for participating organizations or groups
  • 93. Interacting with a UDDI Registry  Graphical User Interface  Microsoft  IBM  HP  Systinet  SAP  Programmatic Interface (JAX-R, UDDI4J, or other vendor API specific)  Communication model to UDDI Registry is using SOAP Messages
  • 94. Business’ Uses of UDDI Registry 1. White pages level – to publish business’ basic business information such as company name, contact info, business identifier number, etc 2. Yellow pages level – to classify business based on its service category 3. Green pages level – to classify technical information describing its web services information
  • 95. UDDI Data Structures  <businessEntity>  <publisherAssertion>  <businessService>  <bindingTemplate>  <tModel>
  • 97. <businessEntity>  It represents the primary information about business such as:  contact info  categorization of the business  Identifiers  description of the business
  • 98. <publisherAssertion>  It represents active business relationships with other business  UDDI Registry will not make the relationship visible to public until both parties has created similar <publisherAssertion> structure
  • 99. <businessService>  It represents the service of business in a logical manner  It’s merely a logical representation of the services  <businessService> share many to many relationships with <businessEntity>
  • 100. <bindingTemplate>  It points to technical descriptions and access URLs of the service  tModel  Access Point/ End Point  Note: it does not represent details of the service specification
  • 101. <tModel>  It represents a description of a particular specification or behavior of the service that is managed somewhere else  WSDL reference is usually published here  It does not contain service specification directly, but it contains a link to some specification
  • 102. UDDI Programming API  Inquiry API Consists of XML messages defined using UDDI schema which can be used to locate information about business  Publisher API Consist of XML messages which can be used to create, update, and delete information presents in the registry. Require authentication.
  • 103. Inquiry API  <find_business>  <find_relatedBusiness>  <find_service>  <find_binding>  <find_tModel>  <get_businessDetail>  <get_businessDetailExt>  <get_serviceDetail>  <get_tModelDetail>
  • 104. Publishing API  <save_business>  <set_publisherAssertions>  <add_publisherAssertions>  <save_service>  <save_binding>  <save_tModel>  <delete_business>  <delete_publisherAssertions>  <delete_service>  <delete_binding>  <delete_tModel>
  • 105. Examples of <find_service>  Request SOAP <uddi:find_service> <findQualifiers> <findQualifier> caseSensitiveMatch </findQualifier> </findQualifiers> <uddi:name> Sumatra Widget Corporation </uddi:name> </uddi:find_service>
  • 106. Examples of <find_service>  Response SOAP <serviceList operator="IBM" xmlns="urn:uddi-org:api_v2"> <serviceInfos> <serviceInfo serviceKey="uuid:12345-1234-e3433" businessKey="uuid:3456-s123-3435"> <name> Import Widget Services </name> </serviceInfo> </serviceInfos> </serviceList>
  • 107. Limitations of UDDI  UDDI has limited information model compared to ebXML Registry/ Repository  UDDI is just a registry, not a repository
  • 108.
  • 110. Limitations of Axis JWS  It is intended for a simple web services  You cannot use packages  You cannot discover error until deployment  You cannot undeploy the web services  You cannot give an alias or mapping to the web services  You are exposing your source code
  • 111. Axis WSDD  Axis Web Service Deployment Descriptor  XML-based that describe the process of the web services deployment and undeployment  Axis WSDD provides extra power and flexibility in deploying your web services
  • 112. Benefits from using Axis WSDD  You write a regular Java class  WSDD can provide alias/mapping to the services  You can just deploy your Java classes  You can deploy all or limited Web API  You can undeploy without removing your classes  You can include Java Bean as parameter or return value
  • 113. Example of WSDD (Deployment) <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="HumanResourceSystem" provider="java:RPC"> <parameter name="className" value="com.xyz.service.HumanResourceSystem"/> <parameter name="allowedMethods“ value="getEmployeeByEmployeeId"/> </service> </deployment>
  • 114. Example of WSDD (Undeployment) <undeployment name="UndeploymentTemperatureConverterService" xmlns="http://xml.apache.org/axis/wsdd/"> <service name="HumanResourceSystem"/> </undeployment>
  • 115. BeanSerializer  You can include custom Java object as parameter or return value on a method call  You are registering the classes that will be serialized or deserialized WSDL will recognize and describe the Java object
  • 116. Example of WSDD with BeanSerializer <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="HumanResourceSystem" provider="java:RPC"> <parameter name="className" value="com.xyz.service.HumanResourceSystem"/> <parameter name="allowedMethods" value="getEmployeeByEmployeeId"/> <beanMapping qname="myNS:Employee" xmlns:myNS="urn:xyz" languageSpecificType="java:com.xyz.valueobject.Employee"/> </service> </deployment>
  • 117. How to Deploy and Undeploy?  Deploying web services java org.apache.axis.cleint.AdminClient -l http://localhost:8080/HumanResourceService/services/AdminService deployService.wsdd  Undeploying web services java org.apache.axis.cleint.AdminClient -l http://localhost:8080/HumanResourceService/services/AdminService undeployService.wsdd
  • 118. How to Deploy and Undeploy? 1. Compile your classes 2. Deploy your application by placing it into Tomcat’s WEB-INF folder 3. Restart Tomcat 4. Deploy/Undeploy Web Services
  • 119.
  • 121. Introducing JAX-RPC One of JAX-RPC features is to provide a way for client to invoke a method remotely It can be used by Java applications, servlet, jsp, and EJBs to exchange SOAP messages with remote Web Services on any platforms 2 kind of JAX-RPC approaches  Generated Stubs  DII (Dynamic Invocation Interface)
  • 122. Generated Stubs  Stubs are Java classes/objects provides implementation codes to communicate to your Web Services functionalities (methods)  As a developer, you can just see the Web Service provider just as another regular java object.  When a stub’s method is invoked, the JAX-RPC stub sends a SOAP Request message to the Web Service endpoint that will return a SOAP Response message to stub  You don’t need to understand WSDL that much
  • 125. Generated Stubs  Sample Codes // 1. Instantiate TemperatureConverterServiceLocator as a // TemperatureConcerterService TemperatureConverterService myService = new TemperatureConverterServiceLocator(); // 2. Get TemperatureConverter object from TemperatureConverterService TemperatureConverter converter = myService.getTemperatureConverter() // 3. Convert Fahrenheit to Celsius by using the method provided by the // TemperatureConverter object double result = converter.convertFahrenheitToCelsius(34.00);
  • 126. DII (Dynamic Invocation Interface)  No stub is being used . You manually need to program what the stub is doing for you.  Use classes provided by JAX-RPC library  More complicated approach since you are not seeing the Web Service as a regular java object anymore  You need to know and understand more details about WSDL  Provides you more flexibility since you are not tied to the stubs
  • 127. DII (Dynamic Invocation Interface)  JAX-RPC Interfaces  javax.xml.rpc.Service o You need this to create “virtual service” that represents the Web Service application (TemperatureConverterService) o You need this to get a Call type object  javax.xml.rpc.Call o You can the endpoint where the web service is located o This is a “virtual mapping” to your web service application component (TemperatureConverter.jws)
  • 128. DII (Dynamic Invocation Interfaces)  Sample Codes: // In order to create a service type object, we need to use ServiceFactory ServiceFactory sfactory = serviceFactory.new Instance(); // Creating service type object from the factory Service service = sfactory.creaetService(…pass service info…); // Create a call object from service type object Call call = service.createCall(…pass port info…); // Set the endpoint property call.setTargetEndpoint(..pass endpoint info..); // Set the operation name call.setOperationName(..pass method…);
  • 129. DII (Dynamic Invocation Interfaces)  Side Notes:  With DII, there is no specific java data type provided when you send data as parameters or receives data from Web Services  When you are invoking a connection with Web Service, you use the invoke method from the call object Object result = call.invoke(Object[] array);  Invoke method only take 1 parameter (Object array)  Invoke method will return a generic java Object
  • 130.
  • 132. SAAJ  SOAP with Attachments API for Java  API-based SOAP toolkit that models structure of SOAP Messages  SAAJ is used to manipulate SOAP Messages  “Attachment” part is still work in progress  It can be used independently (synchronous)  It can be used with JAX-RPC and JAXM
  • 134. JAXM  Java API for XML Messaging  It is used to send pure XML document from one node to another without calling methods  Supports synchronous and asynchronous communication mode  Approved by JCP
  • 135. JAXM  Not part of J2EE specification  Rejected by major J2EE vendors (BEA and IBM)  Overlap capabilities with other messaging API (JMS and JavaMail)  Demand for JAXM is not enough in marketplace  Future of JAXM is uncertain  No tool to create WSDL with JAXM
  • 136. Programming Steps  Create SOAPConnection using SOAPConnectionFactory  Create SOAPMessage using MessageFactory  Create reference to SOAP Part object  Create reference to SOAP Envelope from SOAP Part object  Create reference to SOAP Header from SOAP Envelope and remove it  Create reference to SOAPBody from SOAP Envelope  Add SOAP Body Element to SOAP Body and get its reference  Add Other elements to SOAP Body Element  Send to receiver  Close connection
  • 138. Exercise  Purchase Order <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <amz:purchaseOrder xmlns:amz="http://www.amazon.com"> <amz:book> <amz:book-title>Head First Java</amz:book-title> <amz:price>30.00</amz:price> <amz:quantity>10</amz:quantity> </amz:book> </amz:purchaseOrder> </soapenv:Body> </soapenv:Envelope>
  • 139. Exercise  Confirmation <?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope xmlns:soap- env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Body> <ori:confirmation xmlns:ori="http://www.oreilly.com"> Thank you for your order </ori:confirmation> </soap-env:Body> </soap-env:Envelope>