web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? •...
Transcript of web services anica - nbende.files.wordpress.com · Web Services Overview What Is a Web Service? •...
![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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/1.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/2.jpg)
• 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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/3.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/4.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/5.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/6.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/7.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/8.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/9.jpg)
• 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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/10.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/11.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/12.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/13.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/14.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/15.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/16.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/17.jpg)
• 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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/18.jpg)
• 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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/19.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/20.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/21.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/22.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/23.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/24.jpg)
• 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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/25.jpg)
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](https://reader036.fdocuments.in/reader036/viewer/2022070910/5f9a1254ea3faa380a3304fe/html5/thumbnails/26.jpg)
Questions?