Professional Documents
Culture Documents
12_WebServices_BestPractices.ppt Page 1 of 44
IBM Software Services for WebSphere
Agenda
What are WebServices?
How do they help?
What’s this “Service Oriented Architecture” Thing?
Architectural Best Practices
Design Best Practices
Interoperability Best Practices
Performance Best Practices
12_WebServices_BestPractices.ppt Page 2 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 3 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 4 of 44
IBM Software Services for WebSphere
Infrastructure
12_WebServices_BestPractices.ppt Page 5 of 44
IBM Software Services for WebSphere
Web Services are part of the answer ... but mostly we'll get to that later
Service Oriented Architecture (SOA) is another part
The two are not the same thing:
ƒMost of today's production Web Services systems aren't service oriented
architectures - they're simple remote procedure calls or point-to-point messaging
via SOAP
ƒMost of today's production service oriented architectures don't primarily use Web
Services - many use existing mature technologies, such as XML, asynchronous
messaging etc.
To really achieve the promoted benefits of Web Services, you need both
12_WebServices_BestPractices.ppt Page 6 of 44
IBM Software Services for WebSphere
All functions (that need to be used by more than one system) are defined as "services"
Service providers agree a defined, implementation-independent interface with service clients
There is only one instance of each service implementation, either at:
Runtime
ƒEach service, e.g. exchange rate calculation, is deployed in one place and one place only,
and is remotely invoked by anything that needs to use it
Deployment time
ƒEach service is built once, but re-deployed to be invoked semi-locally wherever it is needed
These concepts are intended to take "re-use" beyond the more usually achieved "design-time"
re-use, i.e. where function is built once, then deeply embedded, e.g. as a shared code library, in
whatever systems need it.
12_WebServices_BestPractices.ppt Page 7 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 8 of 44
IBM Software Services for WebSphere
Services neither remembers the last thing they were asked to do nor care
what the next is, and are not dependent on the context or state of other
services.
Services are defined using explicit interfaces that are independent of service
implementations, and that both service requestors and service providers
agree to.
12_WebServices_BestPractices.ppt Page 9 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 10 of 44
IBM Software Services for WebSphere
Interface granularity
Interface Code
ƒLarger grained
ƒLoosely coupled Internal code
and
processs
SYSTEM 2
12_WebServices_BestPractices.ppt Page 11 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 12 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 13 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 14 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 15 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 16 of 44
IBM Software Services for WebSphere
http://mygateway.com/services/createOrder
But so what? Why isn't <order>
<id>1234</id>
this just client/server? <customer id>AB35</customer id>
<line>
<item>
<part no>127.87A</part no>
<quantity>2</quantity>
Web Services Best Practices ... © 2003 IBM Corporation
12_WebServices_BestPractices.ppt Page 17 of 44
IBM Software Services for WebSphere
Web Services promises to do the same thing for the way systems talk to
systems:
ƒIntegrate one business directly with another - don't wait for the people
ƒGet your own business talking to itself - joined up IT
ƒDramatic reduction in infrastructure costs and complexity
12_WebServices_BestPractices.ppt Page 18 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 19 of 44
IBM Software Services for WebSphere
e-business is driving the merging of Web, IT & Object technologies to form the
foundation for Web Services
12_WebServices_BestPractices.ppt Page 20 of 44
IBM Software Services for WebSphere
Message Message
Tracking Tracking
12_WebServices_BestPractices.ppt Page 21 of 44
IBM Software Services for WebSphere
Again, we've answered some important and difficult points, but much remains
Let's take a look at Web Services and Service Oriented Architectures combined ...
12_WebServices_BestPractices.ppt Page 22 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 23 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 24 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 25 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 26 of 44
IBM Software Services for WebSphere
Data
Model
Components
Managers
Session Data XML
SOAP Apache
ASP over EJB Java Xalan
HTTP SOAP Xerces
(app objects XSLT parser
WS KBML
control Xerces
Interface
IIS logic) parser
KBML
Open
Source Bad: XML/WS
between application
Domain layers with J2EE
Object server -
Good: WS for Model completely
Interoperability unnecessary
12_WebServices_BestPractices.ppt Page 27 of 44
IBM Software Services for WebSphere
Lessons:
Do NOT use XML/Web Services where they are not needed
ƒno external interfaces being exposed
ƒXML not being flowed through the system
XML/Web Services parsing takes time and generates garbage - it is not free
Good place for Web Services is on the 'edge' of the application server
ƒpreferred strategy for interoperability situations
12_WebServices_BestPractices.ppt Page 28 of 44
IBM Software Services for WebSphere
Swing
(view/controller) Apache SOAP
Bad: Fine-
grained
Web Service
WS calls.
Generated SOAP
stub SOAP
over EJB
HTTP
(controller/model)
Apache SOAP
12_WebServices_BestPractices.ppt Page 29 of 44
IBM Software Services for WebSphere
WebSphere WebSphere
Browser Application Server Application Server
12_WebServices_BestPractices.ppt Page 30 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 31 of 44
IBM Software Services for WebSphere
If the application server may have Java as a service requester, have that
Java application make an RMI/IIOP call to an EJB instead of using SOAP
over HTTP.
Support both RMI/IIOP and web services interfaces
ƒSupport SOAP over MQ for asynchronous requests
JAX-RPC Service
Remote EJB IF MDB
IF
12_WebServices_BestPractices.ppt Page 32 of 44
IBM Software Services for WebSphere
HTTP X X
SMTP X X X X
RMI-IIOP X X X*
12_WebServices_BestPractices.ppt Page 33 of 44
IBM Software Services for WebSphere
WebSphere Application
Applet
Application Server Client
Generated
EJB Client
SOAP stub
SOAP-HTTP
SOAP Engine
SOAP Engine RMI/IIOP
EJB
Firewall
12_WebServices_BestPractices.ppt Page 34 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 35 of 44
IBM Software Services for WebSphere
Interoperability
12_WebServices_BestPractices.ppt Page 36 of 44
IBM Software Services for WebSphere
WSDL
WSDL
WSDL
Coordinator
12_WebServices_BestPractices.ppt Page 37 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 38 of 44
IBM Software Services for WebSphere
Replaceable Component
In one insurance application, the broker obtains policy quotes from several different
systems
Think of this as a large-scale application of the Strategy pattern
getQuote Insurer A
Broker Insurer A
Adapter
Insurer B Insurer
Adapter B
Internal
UDDI Insurer C
Registry Adapter
Insurer C
Insurer X
Adapter
Adapter WSDL
12_WebServices_BestPractices.ppt Page 39 of 44
IBM Software Services for WebSphere
Business Stateless
Delegate Web Services Stateless
Stateless
Web
Proxy Web
Web
Service
Service
Service
Load
Client cache Balancer
12_WebServices_BestPractices.ppt Page 40 of 44
IBM Software Services for WebSphere
Java call
LocalEJBDelegate LocalEJBInterface SessionEJBImpl
SOAP/HTTP
WebServiceDelegate ServiceEndpointInterface
DelegateFactory
Delegate
<<interface>>
12_WebServices_BestPractices.ppt Page 41 of 44
IBM Software Services for WebSphere
Performance - Approach
Do not get hung up on performance concerns until you know the 'cost' of the
web service
ƒoften the business processing takes more time than the Web Service processing
Be smart about designing your application
ƒcache data
ƒsend references
ƒsend the amount of data needed
ƒsupport multiple protocols (don't only use SOAP over HTTP)
Create a prototype and test it under load
Use the fastest SOAP Engine you are comfortable with
Use the fastest XML Parser available
ƒKeep your eye on the latest Apache releases
12_WebServices_BestPractices.ppt Page 42 of 44
IBM Software Services for WebSphere
12_WebServices_BestPractices.ppt Page 43 of 44
IBM Software Services for WebSphere
Resources
12_WebServices_BestPractices.ppt Page 44 of 44