26
Web Services…. Web Services….

web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Web Services….Web Services….

Page 2: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

• A programmable component– Provides a particular

function for an application

– Can be published, located, and invoked across the Web

COM Component

Platform: Windows

RPC

Difficult to run through Firewalls

Previously

XML Web Service?

across the Web

• Based on Internet technologies– SOAP, XML and

transport protocols such as HTTP, SMTP

Component

Platform: any platform

SOAP over HTTP

Easy to run through Firewalls

Firewalls

.NET

Page 3: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Why Use XML Web Services?

�������

� � ��� � �� �� ������������ ��� ����

� � ��� �� � �� ����� ����������

� ���� ���

� �� ��

�� ���� �� � � ��� ��� � �� ��� ����� ���� �� � � ��� ��� � �� ��� ���

�� ���� ���� ���� �� � � � ��� � �� ���

� � ��� � �� �� �

� ����� ����������

� � ���� �� ��� ��� �����

� �������������� � �����������

� ���� ���

� � ��

� � !" " " �" #

� ������

� ���� �� �

� ������

� � ��� � �� �� �

Page 4: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Evolution to Web Services XML Is the Glue

������������������������������ �������� ����������������������

��������������������

����� ����� ��� ������ ��� ������ ������

��� ������ ���

����������������������

����� ����� ��� ������ ���

Page 5: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Data Access Application Models

Evolution of data access

$ ���� ���� ��% ����������� ��& � ��� ��� �

� ��� ! " ���� �

# ��! " ���� �

� �

� �� �� �

� �

���

� �� �� �

$%� ���

&' � � � ������ (

& � ��� ��� �

)%� ����%� ���

*%� ���

�� ���� ��

Page 6: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Web Services Overview What Is a Web Service?

• The solution? Web Services!• A Web Service exposes functionality to a consumer

– Over the Internet or intranet– A programmable URL– Functions you can call over the Internet– Functions you can call over the Internet

• Based on Web standards– HTTP, XML, SOAP, WSDL, UDDI, with more to come

• Can be implemented in any language on any platform

• Black boxes– Component-like, reusable

Page 7: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Web Services Overview What Is a Web Service?

• A Web Service combines the best features of distributed computing and portals and eliminates the worst– Provides a mechanism for invoking methods – Provides a mechanism for invoking methods

remotely– Uses Web standards (e.g. HTTP, XML) to do so

Page 8: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Web Services Overview What Is a Web Service?

• Web Services allow you to interconnect:– Different companies– Many/any devices– Applications– Different clients– Different clients

• Not just browsers

• Distribution and integration of application logic

• Enable the programmable Web– Not just the purely interactive Web

• Web Services are loosely coupled

Page 9: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

• New paradigm for Internet development• Deliver applications as services• Richer, customer-driven experience• Continuous delivery of value/bits

Web Services Overview What is a Web Service?

• Continuous delivery of value/bits• Third-generation Internet

Page 10: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Web Services Overview Evolution of the Web

HTML, XML

Generation 1Static HTML

HTML

Generation 2Web Applications

HTMLHTML, XML

HTML, XML

Generation 3Web Services

Page 11: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Web Services Overview Benefits

• Everyone– Leverage existing infrastructure– “Build or buy” development decisions– Minimize development time/costs

• Enterprises• Enterprises– Integration imperative– Dynamic, easy B2B relationships

• New Web-based businesses– Greater personalization– New services/new revenue streams– Be “everywhere” vs. single destination

Page 12: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Underlying TechnologiesWeb Services Stack

Description: Formal Service Descriptions: WSDL

Directory: Publish & Find Services: UDDI

Inspection: Find Services on server: DISCO

Ubiquitous Communications: Internet

Universal Data Format: XML

Wire Format: Service Interactions: SOAP

Simple, Open, Broad Industry Support

Page 13: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Network

XML Web Services Message Flow

ClientWeb

Servic

SOAP MESSAGE

SOAP MESSAGE

Phase I Serialize

Phase II DeserializeSOAP Request

ClientProxy

Service

SOAP MESSAGE

SOAP MESSAGE

Phase IIISerialize

Phase IVDeserialize

SOAP Response

Page 14: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Underlying TechnologiesWeb Services Stack

• Discovery– Directory allows potential clients to locate

relevant Web Services• UDDI

– Inspection allows you to locate documents about Web Services located on at a given URL• DISCO

– A Description language defines the format of methods provided by a Web Service• WSDL

Page 15: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Underlying TechnologiesWeb Services Stack

Directoryhttp://www.uddi.org

����������������

��������������������Inspectionhttp://www.ibuyspy.com/ibuyspy.disco

Locate a Service

Link to Discovery Document (XML)

Web

Ser

vice

Clie

nt

UD

DI or

otherdirectory

service

����������������

��������

Descriptionhttp://www.ibuyspy.com/ibuyspycs/InstantOrder.asmx?wsdl

Wire Format

Request Discovery Document

Return Discovery Document (XML)

Return Service Description (XML)

Return Service Response (XML)

Request Service

Request Service Description

Web

Ser

vice

Clie

nt

Web S

ervice

Page 16: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Underlying TechnologiesWeb Service Wire Format - SOAP

• The Web Service Wire Format specifies how specific messages are exchanged– HTTP-GET– HTTP-POST– SOAP– SOAP

• HTTP-GET and HTTP-POST use a minimal HTTP interface to invoke Web Services– Limited support for data types

• SOAP provides a robust HTTP/XML interface– Extensive support for data types

Page 17: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

• Guiding principle: “Invent no new technology”

• Builds on key Internet standards– SOAP � HTTP + XML

SOAP Overview

– SOAP � HTTP + XML– Submitted to W3C

• The SOAP specification defines:– The SOAP message format– How to send messages– How to receive responses– Data encoding

Page 18: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

• Objects-by-reference– Distributed garbage collection– Bi-directional HTTP

• Activation

SOAP SOAP Is Not…

• Activation• Complicated

– Doesn’t try to solve every problem in distributed computing

– Can be easily implemented

Page 19: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

SOAPThe HTTP Aspect

• SOAP requests

���� ������������� ������������������� ������� ������������� ������������������� ������� ������������� ������������������� ������� ������������� ������������������� ���

���������������������������������� �!����� ����� �!����� ����� �!����� ����� �!����� ������������������������������������� �!����� ����� �!����� ����� �!����� ����� �!����� ���

����"��!�#$�� ! ��� ��"���% &&'����"��!�#$�� ! ��� ��"���% &&'����"��!�#$�� ! ��� ��"���% &&'����"��!�#$�� ! ��� ��"���% &&'

�����������������������������������%�$!�()*���%�$!�()*���%�$!�()*���%�$!�()*

+,����-���"��.#��/',0+,����-���"��.#��/',0+,����-���"��.#��/',0+,����-���"��.#��/',0

+��� !1�-��� �����0+��� !1�-��� �����0+��� !1�-��� �����0+��� !1�-��� �����0

������������

+ ��� !1�-��� �0+ ��� !1�-��� �0+ ��� !1�-��� �0+ ��� !1�-��� �0

Page 20: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

SOAP Message

SOAP Envelope

SOAP Header

Headers

+���&��0+���&��0+���&��0+���&��0 encloses headers

+1�-��� �0+1�-��� �0+1�-��� �0+1�-��� �0 encloses payload

Protocol binding headers

The complete SOAP message

SOAPMessage Structure

SOAP Header

SOAP Body

Message Name & Data

Headers

XML-encoded SOAP message name & data

+2�&�0+2�&�0+2�&�0+2�&�0 contains SOAP message name

Individual headers

Page 21: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

SOAPSOAP Message Format

• An XML document using the SOAP schema:

+,����-���"��.#��/',0+,����-���"��.#��/',0+,����-���"��.#��/',0+,����-���"��.#��/',0

+��� !1�-��� �����0+��� !1�-��� �����0+��� !1�-��� �����0+��� !1�-��� �����0

+��� !���&������0+��� !���&������0+��� !���&������0+��� !���&������0

������������

+ ��� !���&��0+ ��� !���&��0+ ��� !���&��0+ ��� !���&��0

+��� !2�&�0+��� !2�&�0+��� !2�&�0+��� !2�&�0

+&&������.#$�� ! ��� ��"���% '0+&&������.#$�� ! ��� ��"���% '0+&&������.#$�� ! ��� ��"���% '0+&&������.#$�� ! ��� ��"���% '0

+��0�3+ ��0+��0�3+ ��0+��0�3+ ��0+��0�3+ ��0

+�30�/+ �30+�30�/+ �30+�30�/+ �30+�30�/+ �30

+ &&0+ &&0+ &&0+ &&0

+ ��� !2�&�0+ ��� !2�&�0+ ��� !2�&�0+ ��� !2�&�0

+ ��� !1�-��� �0+ ��� !1�-��� �0+ ��� !1�-��� �0+ ��� !1�-��� �0

Page 22: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

SOAPServer Responses

• Server replies with a “result” message:

��� ����3//��4��� ����3//��4��� ����3//��4��� ����3//��4���������������������������������������������� �!���� ����� �!���� ����� �!���� ����� �!���� ��������������������������������������%�$!�(5����%�$!�(5����%�$!�(5����%�$!�(5�

+,����-���"��.#��/',0+,����-���"��.#��/',0+,����-���"��.#��/',0+,����-���"��.#��/',0+��� !1�-��� �����0+��� !1�-��� �����0+��� !1�-��� �����0+��� !1�-��� �����0

+��� !2�&�0+��� !2�&�0+��� !2�&�0+��� !2�&�0+&&6�����������.#$�� ! ��� ��"���% '0+&&6�����������.#$�� ! ��� ��"���% '0+&&6�����������.#$�� ! ��� ��"���% '0+&&6�����������.#$�� ! ��� ��"���% '0

+������03)�*+ ������0+������03)�*+ ������0+������03)�*+ ������0+������03)�*+ ������0+ &&6�����0+ &&6�����0+ &&6�����0+ &&6�����0

+ ��� !2�&�0+ ��� !2�&�0+ ��� !2�&�0+ ��� !2�&�0+ ��� !1�-��� �0+ ��� !1�-��� �0+ ��� !1�-��� �0+ ��� !1�-��� �0

Page 23: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

SOAPEncoding Complex Data

• Data structures are serialized as XML:

+��� !1�-��� �����0+��� !1�-��� �����0+��� !1�-��� �����0+��� !1�-��� �����0

+��� !2�&�0+��� !2�&�0+��� !2�&�0+��� !2�&�0

+7������8����6�����������.#$�� ! ��� ��"���% '0+7������8����6�����������.#$�� ! ��� ��"���% '0+7������8����6�����������.#$�� ! ��� ��"���% '0+7������8����6�����������.#$�� ! ��� ��"���% '0

+������0+������0+������0+������0

+�����" �"��0����"��9�-���"�����&+ �����" �"��0+�����" �"��0����"��9�-���"�����&+ �����" �"��0+�����" �"��0����"��9�-���"�����&+ �����" �"��0+�����" �"��0����"��9�-���"�����&+ �����" �"��0

+�"��0�35+ �"��0+�"��0�35+ �"��0+�"��0�35+ �"��0+�"��0�35+ �"��0

+�"�8��0��+ �"�8��0+�"�8��0��+ �"�8��0+�"�8��0��+ �"�8��0+�"�8��0��+ �"�8��0

+ ������0+ ������0+ ������0+ ������0

+ 7������8����6�����0+ 7������8����6�����0+ 7������8����6�����0+ 7������8����6�����0

+ ��� !2�&�0+ ��� !2�&�0+ ��� !2�&�0+ ��� !2�&�0

+ ��� !1�-��� �0+ ��� !1�-��� �0+ ��� !1�-��� �0+ ��� !1�-��� �0

Page 24: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

• Open – allows for other namespaces and thus highly extensible

• Ability to import other schemas & WSDL• Provides “source” for Web Services

WSDL WSDL Elements

• Provides “source” for Web Services• Provides both interface and implementation

details• Allows for separation of the two

Page 25: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

3) Client requests discovery document

1) Client attempts to locate a Web service

2) URL to discovery document is returned

XML Web Services Infrastructure

Directory

Discovery

7) Client requests the web service

8) Web service returns result response

5) Client requests service description

6) Description document is returned

3) Client requests discovery document

4) Discovery document is returned

Description

Wire Format

Page 26: web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? • A Web Service combines the best features of distributed computing and portals and

Questions?