Web Services

inexpensivebossesΚινητά – Ασύρματες Τεχνολογίες

12 Νοε 2013 (πριν από 4 χρόνια και 1 μήνα)

141 εμφανίσεις

Web Services

Development Environment

CNT5715 Fall 2010

Computer Network Programming

S. Mansfield

09/09/2010

Web Services Development Environment

2

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

3

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


1
st

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

4

The OSI Model & Web Services

Application

Presentation

Session

Transport

Datalink

Network

Physical

OSI Model

Device Driver

&

Hardware

Ipv4, IPv6

Others

TCP

UDP

Application

Internet Protocol

Suite

Device Driver

&

Hardware

Ipv4, IPv6

TCP

Web Services

Application

Web Services

Model

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 3
rd

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 Services

Client

Application

09/09/2010

Web Services Development Environment

6

Web Service Application

Web Services Based Travel Web Site

Airlines
--

Delta

Hotels
--

Marriot

Automobiles
--

Hertz

Travel Services
--

Sabre

RDMS

Travel

Customers



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 Browser

Web Browser

Web Browser

09/09/2010

Web Services Development Environment

7

UDDI

WS

Client

WS

Server

WS

Server

WS

Server

WSDL

WSDL

WSDL

The SOA Composite Map

BPEL

WSCI

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

WSDL


Web Service Description Language


Describes the complete server operation,

interface, protocols, and web ports.

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.

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

8

Web Services Development Environment

Web Service Server

RDBS

Framework


Java


.Net

Java

RDBMS

Application

WS Endpoint

Interface

WS Endpoint

Publisher

WSDL

wsimport

Web Service

Client

Application

JSE 6 .jar

javax.jws

javax.xml.ws

javax.xml.rpc

javax.xml.soap

javax.xml.bind

WS Attribute

Classes

Java Enterprise

Environment

Internet

Java Client

Environment



Java Web Services Development Environment



Fully Integrated Framework and Utilities



End to End Enterprise/Client Communications

09/09/2010

Web Services Development Environment

9

The WSDL

Port

Service

Binding

Input

Output

Operation

PortType

Message

Types

Abstract Section

Concrete Section

WSDL 1.1

WSDL the most important component of Web Services


Describes what the Web Services does and how


Functions

Data types

Protocols

Where to find service


The WSDL actually describes server classes


Class name

Class methods

Class properties


The server has real objects and the client creates abstract interfaces


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


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

10

PortType


Class { }



Operation


Method()



Message


Property Type



Msg Name


Property Name



Types


Property Attributes


Binding


Message Protocol


Service


Server Location

Definitions


Target Namespace

WSDL XML Schema

WSDL Structure

09/09/2010

Web Services Development Environment

11

Web Services Platform Architecture

Request

SOAP

Response

SOAP

Service Endpoint
Interface Proxy

Parameter

class {}

method()

Parameter

return

method()

Parameter

return

Invocation Subsystem

(Client Side)

Request

SOAP

Response

SOAP

Parameter

Parameter

return

Parameter

return

Invocation Subsystem

(Server Side)

Parameter

class {}

method()

Parameter

return

method()

Parameter

return

Client

Abstract

Interface

Server

Target

Object

Synchronization


Serialization
--

Transmission

Transmission


Serialization
--

Synchronization

SOAP Message

Exchange

(Specified by WSDL

Method

Invocation

Method

Invocation

Annotate & Publish Objects

Create Abstract Classes with wsimport

09/09/2010

Web Services Development Environment

12

wsimport/wsexport

WSDL

wsimport

fclass1 {


method1()


prop1


method2()


prop2

}

fclass1 {


method1()


prop1


method2()


prop2

}

object factory

service{ }

getClass1 {


getprop1()


getprop2()

}

setClass1 {


setprop1()


setprop2()

}



Extracts WSDL




Creates XML Schemas




Compiles Attribute Classes


objectfactory class { }

fmethods()

getprop()

setprop()




Error Handling




Multi
-
Threaded

Server

Client

09/09/2010

Web Services Development Environment

13

WSDL

wsimport

wsexport

WSDL First

Code First

(Server)

(Client)

attribute

classes { }

end
Implementation
Interfaces { }

Three Design Models




Code First



WSDL First



Code
-
WSDL First

Code Server Side Business Impl

Create Server Side EIC’s

Publish WSDL

Compile WSDL Client Attribute Classes


Write WSDL

Compile Server Side EIC’s

Code Server Side Business Impl

Compile WSDL Client Attribute Classes

Who’s First Debate

+ Stable Server Side Code

-

Less Stable Client Code

-

Difficult to Read WSDL

-

Cross Platform Compatibility

+ Very Stable Clients

+ Easy to Read WSDL

-

WSDL Syntax Interoperability

-

Less Stable Server Side Code

09/09/2010

Web Services Development Environment

14

Web Services Tool Chain

Web Service Server

RDBS

Framework


Java


.Net

Java

RDBMS

Application

WS Endpoint

Interface

WS Endpoint

Publisher

WSDL

wsimport

Web Service

Client

Application

JSE 6 .jar

javax.jws

javax.xml.ws

javax.xml.rpc

javax.xml.soap

javax.xml.bind

WS Attribute

Classes

09/09/2010

Web Services Development Environment

15

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

16

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

17

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

18

Advanced Web Services Topic: Mobile Web Services

Web Service

RDBS

Framework


Java


.Net

Java

RDBMS

Application

WS Endpoint

Interface

WS Endpoint

Publisher

WSDL

wsimport

Proc beans

xml Abst

Java .jars

javax.jws

javax.xml

othes
...

Android

Java WS

Client

kSOAP2

Missing Tool

Components

Android Web Services Development Environment

Figure 1

Missing Library

Components

11/12/2013

COT6905 Directed Independent Study

19

awsimport

WSDL

Android WS

Attribute Classes

Android

Client

Application

Android

Platform

Android WS

Library

kSOAP2

Library

Initial Android SOA Development Environment

Proposed WS Environment




Quick demonstration platform



Android specific environment



New wsimport


awsimport



Creates Android attribute classes



New Android WS Library



Utilizes kSOAP2 Libraries

11/12/2013

COT6905 Directed Independent Study

20

Mobile OS

Platforms


Android


Apple iOS


Blackberry OS


BREW/REX


Palm OS


Symbian


Windows Mobile

Programming

Languages


Java


Objective C/C++


Java


C/C++, Java


C/C++, Java


C/C++, Java


C++, C#, VB

11/12/2013

COT6905 Directed Independent Study

21

Embedded OS

Platforms


VXWorks


Win Embedded


Red Hat Linux


DSP/BIOS


QNX


pSOS


eCOS

Programming

Languages


Asm, C


Asm,C, C#, VB


Asm, C, C++


Asm, C


Asm, C


Asm, C


Asm, C

11/12/2013

COT6905 Directed Independent Study

22

WSDL

mwsimport

Libraries

Android

Symbian

Blackberry OS

iOS

IDE Plug In’s

Android

Symbian

Blackberry OS

iOS

Mobile WS

Attribute Classes

Mobile

Client

Application

Mobile

Platform

Mobile SOA Development

Environment

Mobile SOA Environment




Fully W3C Compliant



WSDL
-
to
-
Code Environment



Multiple Platform Support



mwsimport virtual compiler



Platform Specific IDE Plug
-
In’s



Platform Specific Libraries

Emerging Android WS Architecture

Extracted

WSDL

Extracted

WSDL

Pseudo

Class

Builder

Platform

Class

Compiler

WSDL

Object

Factory

Platform

Library

Platform

Web Service

Client

Platform

Support

Environment

WSDL

Common Code Modules


Code Re
-
Use Modules


Platform Specific Client

Limited Resource Client Web Service

Development platform

11/12/2013

COT6905 Directed Independent Study

24

Pseudo Class Builder

WSDL

Parse

portType

Class
1

Class
2

Class
m

Parse
Operation

Method
11
()

Method
12
()

Method
1n
()

Parse

Message

Element
11

Parse

Element

Type

Bind I/O
&

Protocols

Method
11
()

Method
12
()

Method
1n
()

Define service
Ports

Method
11
()

Method
12
()

Method
1n
()

Pseudo

Class

ArrayList

Class
1

Class
2

Class
m

Abstract
Classes

Concrete Classes

Parse

Element

Type

Parse

Element

Type

Element
12

Element
1o

Pseudo Class Builder (WSDL 1.1/1.2)


Decomposes WSDL


Creates & Defines Classes & Methods


Defines Elements & Types


Builds Pseudo Classes

Figure 12.

11/12/2013

COT6905 Directed Independent Study

25

Platform Class Factory

Pseudo

Class

New

classNam
e

Constructor {


Build class }

Method
1
()

Marshal

SOAP

Object

Issue

SOAP

RPC

Set(element)

Element

Message

OK

Message

Error

Post

Error

Return

Pseudo

Class

New

classNam
e

Constructor {


Build class }

Method
1
()

Marshal

SOAP

Object

Issue

SOAP

RPC

Get(element)

element

Message

OK

Message

Error

Post

Error

Deserialize

SOAP

Object

WS Input

(Output from WS Client)

WS Output

(Input from WS Client)

Update

Elements

Return

Object Factory

Class1{}

Class2{}

Class3{}

...

Service.language.source

Platform Class Factory

Figure 13.

11/12/2013

COT6905 Directed Independent Study

26

HttpTransport

HttpTransportBasicAuth

HttpTransportSE

MarshalBase64

MarshalDate

MarshalFloat

MarshalHashtable

ServiceConnection

ServiceConnectionMidp

ServiceConnectionSE

SoapEnvelope

SoapFault

SoapObject

SoapPrimative

KvmSerializable

SoapSerialization

SoapServlet

Transport

Platform Library

Interface for custom Serialization/Deserialization

Basic classes required for handling SOAP

Envelopes and literal XML content.

Methods to facilitate SOAP calls over HTTP using

the J2ME generic connection framework.

Interface to allow the abstraction of the raw

transport information.

Provides get and set methods for properties. Can

be used to replace reflection for serialization

aware classes.

Abstract class which holds common methods and

members that are used by the transport layers.

Classes

Description

11/12/2013

COT6905 Directed Independent Study

27

Backup

11/12/2013

COT6905 Directed Independent Study

28

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>