Web Services - FAU College of Engineering

advertisement
Web Services
Development Environment
CNT5715 Fall 2010
Computer Network Programming
S. Mansfield
Agenda
Application of Web Services
Web Services Application Example
The OSI Model and Web Services
Web Services Development Flow
Web Services Tool Chain
WSDL Example
Web Service Example
Advanced Topic: Mobile Web Services
09/09/2010
Web Services Development Environment
2
Application of Web Services
Development of started around 1999
Focus was web centric services and applications
Far Reaching – Any Operating System, Any Language, Any Hardware
Its really a communications architecture
Simple application programming centric – Looks like classes
Leverages TCP/IP infrastructure
Initially Over Hyped – Complex, many standards, technology hurdles
Key Standards Settled 2005
1st Decade Mergers and Acquisitions Drove Initial Adoption
Many disperse companies – All different IT Solutions
Integrated many systems into one
Legacy Application Migration
Federal Government – Social Security
Department of Defense – Procurement
Many Emerging Web Services Applications
Expanding into New Areas – Cloud Computing
09/09/2010
Web Services Development Environment
3
The OSI Model & Web Services
Application
Presentation
Application
Application
Web Services
Session
Transport
Others
UDP
TCP
Network
Ipv4, IPv6
Ipv4, IPv6
Datalink
Device Driver
&
Hardware
Device Driver
&
Hardware
Internet Protocol
Suite
Web Services
Model
Physical
OSI Model
09/09/2010
TCP
Web Services Development Environment
4
Who Is Using Web Services?
SOA/WS Markets & Solutions(Forrester)
Wide Adoption Across Public, Education & Private Sectors
Excellent Vendor Development & Tool Support
Supports New & Legacy Environments
Excellent Architecture for Mobile Data Delivery
Public & Private Sector Growth(Gartner)
Universal in Europe, Rapidly Growing in the USA
2007 – 50%> All New Large System Deployments Used SOA
2010 – 80%> All New Large System Deployments Will Use SOA
Industry Examples(CIO)
Synovus – Commercial/Retail/ Investment Banking
T-Mobile – Re-engineered IT Solutions using SOA
Dell – Integrated WW Mfg & Delivery System with 3rd Parties
Twitter – Fully integrated SOA Service Delivery Model
Linkedin – Integrated Internal
Amazon – Integrated SOA Business Model
eBay – Integrated SOA Business Model
FedEx – Integrated SOA Business Model
Ford Motor Company – Integrated WW Supplier SOA Network
Starwood Hotels – Replace Multiple Legacy Systems with One SOA System
Verizon- Merged Multiple Legacy Acquisition Companies
CitGroup – Integrated SOA Top/Down Throughout Business
Motorola – Integrated 180 Separate Business Groups
Federal Government – Published Comprehensive SOA Roadmap
US Army – Replacing All Legacy Systems with SOA
DoD – Created Target SOA Architecture, Successfully Deploy Pilot Programs
Veterans Administration – Plans to Migrate All Systems to SOA
Several States Migrating to SOA – AZ, IA, MA, UT, TX, WA
Web Service Application
Web Services Based Travel Web Site
Web Services
Client
Application
RDMS
Airlines -- Delta
Web Browser
Hotels -- Marriot
Web Browser
Web Browser
Travel
Customers
09/09/2010






Before WS – Many 100’s Klocs
With WS – Few 10’s Klocs
Much Faster Development
Much Less Cost
Much Less Testing
World Wide 24/7 Access
Web Services Development Environment
Automobiles -- Hertz
Travel Services -- Sabre
6
The SOA Composite Map
UDDI
UDDI – Universal Description, Discovery, and Integration
Universal phone book for Web Services
White Pages: Direct contact information
Yellow Pages: Business Description
Green Pages: Technical Information
WS
Client
WSDL – Web Service Description Language
WS
Server
WSDL
WS
Server
WSDL
Describes the complete server operation,
interface, protocols, and web ports.
WSDL
BEPL – Business Execution Process Language
BPEL is the industry standard for business process
orchestration. It is an XML-based language used
for the definition and execution of business
processes as well as scientific workflows
using Web services.
WS
Server
BPEL
WSCI
WSCI – Web Services Choreography Interface
A form of service composition in which the
interaction protocol between several partner
services is defined from a global perspective
09/09/2010
Web Services Development Environment
7
Web Services Development Environment
Java Enterprise
Environment
Java
RDBMS
Application
WS Endpoint
Interface
Internet
WSDL
Java Client
Environment
wsimport
Web Service Server
RDBS
Framework
•Java
•.Net
WS Endpoint
Publisher
• Java Web Services Development Environment
• Fully Integrated Framework and Utilities
• End to End Enterprise/Client Communications
09/09/2010
Web Services Development Environment
WS Attribute
Classes
Web Service
Client
Application
JSE 6 .jar
javax.jws
javax.xml.ws
javax.xml.rpc
javax.xml.soap
javax.xml.bind
8
The WSDL
WSDL the most important component of Web Services
WSDL 1.1
Describes what the Web Services does and how
The WSDL actually describes server classes
Class name
Class methods
Class properties
Abstract Section
Functions
Data types
Protocols
Where to find service
Types
Message
PortType
Operation
Output
Input
When either class is invoked the underlying SOAP response/request
creates method calls and updates (synchronizes) the class properties
Extremely powerful seem-less communications architecture
Maximum flexibility with no exposure to underlying communications methods
Concrete Section
The server has real objects and the client creates abstract interfaces
Binding
Service
Port
End-to-End Type Safe
Underlying programming model is all Sockets TCP/IP bases
Very strong tool support -- automatic client abstract interface class generation
(wsimport)
09/09/2010
Web Services Development Environment
9
WSDL Structure
Definitions
Target Namespace
WSDL XML Schema
PortType  Class { }
Operation  Method()
Message  Property Type
Msg Name  Property Name
Types  Property Attributes
Binding  Message Protocol
Service  Server Location
09/09/2010
Web Services Development Environment
10
Web Services Platform Architecture
Client
Abstract
Interface
Server
Target
Object
class {}
class {}
Invocation Subsystem
(Client Side)
method()
Invocation Subsystem
(Server Side)
Parameter
return
method()
Parameter
Service Endpoint
Interface Proxy
Parameter
return
Request
SOAP
Request
SOAP
Parameter
Parameter
Parameter
Parameter
return
return
method()
Response
SOAP
Response
SOAP
Synchronization – Serialization -- Transmission
Method
Invocation
Parameter
Parameter
return
return
Transmission – Serialization -- Synchronization
SOAP Message
Exchange
(Specified by WSDL
Create Abstract Classes with wsimport
09/09/2010
method()
Web Services Development Environment
Method
Invocation
Annotate & Publish Objects
11
wsimport/wsexport
object factory
Server
WSDL
service{ }
wsimport
Client
fclass1 {
method1()
prop1
method2()
prop2
}
• Extracts WSDL
• Creates XML Schemas
• Compiles Attribute Classes
objectfactory class { }
fmethods()
getprop()
setprop()
• Error Handling
fclass1 {
method1()
prop1
method2()
prop2
}
getClass1 {
getprop1()
getprop2()
}
• Multi-Threaded
setClass1 {
setprop1()
setprop2()
}
09/09/2010
Web Services Development Environment
12
Who’s First Debate
(Server)
(Client)
WSDL First
Code First
WSDL
wsexport
end
Implementation
Interfaces { }
Three Design Models
Very Stable Clients
Easy to Read WSDL
WSDL Syntax Interoperability
Less Stable Server Side Code
09/09/2010
attribute
classes { }
• Code First
• WSDL First
• Code-WSDL First
Write WSDL
Compile Server Side EIC’s
Code Server Side Business Impl
Compile WSDL Client Attribute Classes
+
+
-
wsimport
Code Server Side Business Impl
Create Server Side EIC’s
Publish WSDL
Compile WSDL Client Attribute Classes
+ Stable Server Side Code
- Less Stable Client Code
- Difficult to Read WSDL
- Cross Platform Compatibility
Web Services Development Environment
13
Web Services Tool Chain
Java
RDBMS
Application
WS Endpoint
Interface
WSDL
Web Service Server
RDBS
Framework
•Java
•.Net
WS Endpoint
Publisher
wsimport
WS Attribute
Classes
Web Service
Client
Application
JSE 6 .jar
javax.jws
javax.xml.ws
javax.xml.rpc
javax.xml.soap
javax.xml.bind
09/09/2010
Web Services Development Environment
14
A WSDL Example: .NET TimeServer
Display WSDL on Internet Browser
Examine Structure of WSDL
Extract WSDL and Create Client Attribute Classes
09/09/2010
Web Services Development Environment
15
A Simple Web Services Example: TimeServer Execution in Java
Compile TimeServer Server
Create Server Proxy on Local Host
Compile TimeServer Client
Exchange Data between Client and Local Host Server
09/09/2010
Web Services Development Environment
16
Advanced Web Service Example: Amazon Web Service Client
Extract WSDL and Create Attribute Classes
Compile and Link Client Program with Attribute Classes
Execute Amazon Web Service – Book Search
09/09/2010
Web Services Development Environment
17
Advanced Web Services Topic: Mobile Web Services
Android Web Services Development Environment
Web Service
Missing Tool
Components
RDBS
Java
RDBMS
Application
WS Endpoint
Interface
Framework
•Java
•.Net
WS Endpoint
Publisher
WSDL
wsimport
Web Services Development Environment
kSOAP2
Android
Java WS
Client
Missing Library
Components
Figure 1
09/09/2010
Proc beans
xml Abst
Java .jars
javax.jws
javax.xml
othes...
18
Initial Android SOA Development Environment
WSDL
awsimport
Proposed WS Environment
•
•
•
•
•
•
Quick demonstration platform
Android specific environment
New wsimport  awsimport
Creates Android attribute classes
New Android WS Library
Utilizes kSOAP2 Libraries
3/23/2016
Android WS
Attribute Classes
Android WS
Library
Android
Client
Application
Android
Platform
COT6905 Directed Independent Study
kSOAP2
Library
19
3/23/2016
Mobile OS
Platforms
Programming
Languages
Android
Java
Apple iOS
Objective C/C++
Blackberry OS
Java
BREW/REX
C/C++, Java
Palm OS
C/C++, Java
Symbian
C/C++, Java
Windows Mobile
C++, C#, VB
COT6905 Directed Independent Study
20
Embedded OS Programming
Platforms
Languages
3/23/2016
VXWorks
Asm, C
Win Embedded
Asm,C, C#, VB
Red Hat Linux
Asm, C, C++
DSP/BIOS
Asm, C
QNX
Asm, C
pSOS
Asm, C
eCOS
Asm, C
COT6905 Directed Independent Study
21
Symbian
iOS
Blackberry OS
Mobile SOA Development
Environment
Android
IDE Plug In’s
WSDL
mwsimport
Mobile SOA Environment
•
•
•
•
•
•
3/23/2016
Fully W3C Compliant
WSDL-to-Code Environment
Multiple Platform Support
mwsimport virtual compiler
Platform Specific IDE Plug-In’s
Platform Specific Libraries
Mobile WS
Attribute Classes
Mobile
Client
Application
COT6905 Directed Independent Study
Symbian
iOS
Blackberry OS
Android
Libraries
Mobile
Platform
22
Emerging Android WS Architecture
Limited Resource Client Web Service
Development platform
Extracted
WSDL
Common Code Modules
Code Re-Use Modules
Platform Specific Client
WSDL
Pseudo
Class
Builder
Extracted
WSDL
Platform
Class
Compiler
WSDL
Object
Factory
Platform
Web Service
Client
Platform
Library
Platform
Support
Environment
Pseudo Class Builder
Pseudo Class Builder (WSDL 1.1/1.2)
WSDL
Decomposes WSDL
Creates & Defines Classes & Methods
Defines Elements & Types
Builds Pseudo Classes
Parse
portType
Class1
Class2
Classm
Method11()
Method12()
Method1n()
Figure 12.
3/23/2016
Bind I/O
&
Protocols
Parse
Operation
Abstract
Classes
Parse
Message
Element11
Parse
Element
Type
Element12
Parse
Element
Type
Element1o
Parse
Element
Type
Pseudo
Class
ArrayList
Define service
Ports
Method11()
Method11()
Method12()
Method12()
Method1n()
Method1n()
Class1
Class2
Classm
Concrete Classes
COT6905 Directed Independent Study
24
Platform Class Factory
Pseudo
Class
New
classNam
e
Constructor {
Platform Class Factory
Build class }
WS Input
(Output from WS Client)
Marshal
SOAP
Object
Method1()
Set(element)
Pseudo
Class
New
classNam
e
Issue
SOAP
RPC
Element
Message
OK
Return
Message
Error
Post
Error
Constructor {
Object Factory
Class1{}
Class2{}
Class3{}
...
Service.language.source
Build class }
WS Output
(Input from WS Client)
Method1()
Get(element)
Marshal
SOAP
Object
element
Issue
SOAP
RPC
Message
OK
Deserialize
SOAP
Object
Message
Error
Post
Error
Update
Elements
Return
Figure 13.
3/23/2016
COT6905 Directed Independent Study
25
Platform Library
Classes
Description
Methods to facilitate SOAP calls over HTTP using
the J2ME generic connection framework.
Interface for custom Serialization/Deserialization
HttpTransport
HttpTransportBasicAuth
HttpTransportSE
MarshalBase64
MarshalDate
MarshalFloat
MarshalHashtable
Interface to allow the abstraction of the raw
transport information.
ServiceConnection
ServiceConnectionMidp
ServiceConnectionSE
Basic classes required for handling SOAP
Envelopes and literal XML content.
SoapEnvelope
SoapFault
SoapObject
SoapPrimative
Provides get and set methods for properties. Can
be used to replace reflection for serialization
aware classes.
KvmSerializable
SoapSerialization
SoapServlet
Abstract class which holds common methods and
members that are used by the transport layers.
3/23/2016
COT6905 Directed Independent Study
Transport
26
Backup
3/23/2016
COT6905 Directed Independent Study
27
WSDL 2.0 Structure
<description> -- XML target namespaces
<documentation> -- Simple text description of the WSDL WS
</documentation>
<types> -- Describes the message and message types used in the WSDL
</types>
<interface> -- Defines the interface of a WS as a set of abstract operations
</interface>
<binding> -- A binding specifies concrete message format and transmission
protocol details for an interface and fault in the operation
</binding>
<service> -- Describes a single interface that the service will support and
describes al list of endpoints where the service can be found
</service>
</description>
3/23/2016
COT6905 Directed Independent Study
28
Download