Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
Web Services….Web Services….
• 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
Why Use XML Web Services?
�������
� � ��� � �� �� ������������ ��� ����
� � ��� �� � �� ����� ����������
� ���� ���
� �� ��
�� ���� �� � � ��� ��� � �� ��� ����� ���� �� � � ��� ��� � �� ��� ���
�� ���� ���� ���� �� � � � ��� � �� ���
� � ��� � �� �� �
� ����� ����������
� � ���� �� ��� ��� �����
� �������������� � �����������
� ���� ���
� � ��
� � !" " " �" #
� ������
� ���� �� �
� ������
� � ��� � �� �� �
Evolution to Web Services XML Is the Glue
������������������������������ �������� ����������������������
��������������������
����� ����� ��� ������ ��� ������ ������
��� ������ ���
����������������������
����� ����� ��� ������ ���
Data Access Application Models
Evolution of data access
$ ���� ���� ��% ����������� ��& � ��� ��� �
� ��� ! " ���� �
# ��! " ���� �
� �
� �� �� �
� �
���
� �� �� �
$%� ���
&' � � � ������ (
& � ��� ��� �
)%� ����%� ���
*%� ���
�� ���� ��
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
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
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
• 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
Web Services Overview Evolution of the Web
HTML, XML
Generation 1Static HTML
HTML
Generation 2Web Applications
HTMLHTML, XML
HTML, XML
Generation 3Web Services
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
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
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
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
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
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
• 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
• 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
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
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
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
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
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
• 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
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
Questions?