Introduction to Web Services презентация

Содержание


Презентации» Информатика» Introduction to Web Services
Introduction to 	Web Services
 Last update: September 2014
 Ihor Kohut
 ReviewedAgendaWhat is Web Service ?
 Web service - a software system,What is Web Service ?
 SOA - Service Oriented Architecture ofMain Web Services protocols
  SOAP (Simple Object Access Protocol)
 RPC Remote Procedure Call 
  Other approaches with nearly theMain Web Services protocols
  SOAP–services
 	- are focused on actions
SOAP - services
 SOAP-services publish the “contract” (set of methods, parametersHow does a WebService work?SOAP request and response 
 <SOAP-ENV:Envelope><br>
 xmlns:SOAP-ENV="http://[soaporg]/envelope"
 SOAP-ENV:encodingStyle="http://[soapporg]/encoding//"
 <SOAP-ENV:BODY>
 <m:GetStockRespense xmlns:m="SOME-URL">
REST - services
 REST-services publish the data source 
 Client sendsREST
 REST (Representational state transfer) - very simple interface without anyWindows Communication Foundation
 The main technology for building Web Services .NETWeb Services Architecture
 The architecture allows multiple web services to beWeb Services Architecture
 The web services architecture has three distinct roles:Standards
 Web Services based on 3 main standarts:
 SOAP - messagingExample:  MSDI description of web serviceWS Inspection
 WS Inspection is based on WSIL (Web Services InspectionWSIL documentAdvantages and disadvantages
 Advantages of Web Services
 Web services provide cooperationDesign methodologies
 Automated tools can help in the creation of aExample
 Web Services for the developer:
 File web-service has an extensionExample
 Create a new application in VS.NET and add to itExample
 On the Web service page:
 the name of a WebWebMethod attribute
 WebMethod attribute has six properties that affect the web-method:
WebMethod attribute
 TransactionOption. Web-service limits support transactions. With this property weWebMethod attribute
 BufferResponse. BufferResponse property allows you to manage web-buffered responseQuestions?



Слайды и текст этой презентации
Слайд 1
Описание слайда:
Introduction to Web Services Last update: September 2014 Ihor Kohut Reviewed by Oleksandr Mykhailyshyn


Слайд 2
Описание слайда:
Agenda

Слайд 3
Описание слайда:
What is Web Service ? Web service - a software system, is identified by string URI, whose public interfaces are defined in XML. Web services - software components that can be accessed and executed remotely via a network by a client application using standard protocols such as Hypertext Transfer Protocol (HTTP) and Simple Object Access Protocol (SOAP) Web service - a method of communication between two electronic devices.

Слайд 4
Описание слайда:
What is Web Service ? SOA - Service Oriented Architecture of Web applications Main task: supporting interoperable machine-to-machine interaction over a network Web Services don’t have a GUI but have programming interface Web Services are not user-oriented but application-oriented

Слайд 5
Описание слайда:
Main Web Services protocols SOAP (Simple Object Access Protocol) is based on XML, for messages exchanging between services SOAP/WSDL/UDDI REST (Representational State Transfer) for interacting with resources XML-RPC (XML Remote Procedure Call) The early version of SOAP

Слайд 6
Описание слайда:
RPC Remote Procedure Call Other approaches with nearly the same functionality as RPC are: Object Management Group's (OMG) Common Object Request Broker Architecture (CORBA) Microsoft's Distributed Component Object Model (DCOM) Sun Microsystems's Java/Remote Method Invocation (RMI).

Слайд 7
Описание слайда:
Main Web Services protocols SOAP–services - are focused on actions - WCF, ASMX-webservices REST -services - are focused on data - WCF REST, ADO.NET Services

Слайд 8
Описание слайда:
SOAP - services SOAP-services publish the “contract” (set of methods, parameters and return values descriptions) in WSDL Clients know about contract – call methods (using XML), which are executed on service Interaction with service - throw endpoints: URL-address of web service binding – interaction protocol, security parameters

Слайд 9
Описание слайда:
How does a WebService work?

Слайд 10
Описание слайда:
SOAP request and response <SOAP-ENV:Envelope><br> xmlns:SOAP-ENV="http://[soaporg]/envelope" SOAP-ENV:encodingStyle="http://[soapporg]/encoding//" <SOAP-ENV:BODY> <m:GetStockRespense xmlns:m="SOME-URL"> <Symbol>HST</Symbol> <m:GetLastStock> <SOAP-ENV:Body> </SOAP-ENV:Envelope>

Слайд 11
Описание слайда:
REST - services REST-services publish the data source Client sends the request (GET, PUT, POST, DELETE) – not XML Service returns the part of data Each unit is uniquely determined by the URL

Слайд 12
Описание слайда:
REST REST (Representational state transfer) - very simple interface without any additional internal layers. Each unit of information is uniquely determined by a global identifier such as a URL: URL is actually a primary key for the data unit. For example: the third book from the bookshelf will look: /book/3 35 pages in this book : /book/3/page/35 returns strictly specified format. it doesn’t matter what format the data resides at /book/3/page/35 - HTML file or jpeg-file, MW document Just give the data. Don’t wrap the data in XML. Interaction is based on the communication protocol - HTTP. The actions of CRUD (Create-Read-Update-Delete) GET, PUT (add, replace), POST (add, change, delete), DELETE (to delete). For Example: GET /book/3/ - to get a book number 3 PUT /book/ - add a book (the data in the request body) POST /book/3 - change the book (the data in the request body) DELETE /book/3 - remove a book

Слайд 13
Описание слайда:
Windows Communication Foundation The main technology for building Web Services .NET (Framework 3.5) Is based on layers: Standard layers: code, codding (message), transport, …

Слайд 14
Описание слайда:
Web Services Architecture The architecture allows multiple web services to be combined to create new functionality.

Слайд 15
Описание слайда:
Web Services Architecture The web services architecture has three distinct roles: Provider creates the web service and makes it available to clients who want to use it Requestor is a client application that consumes the web service. The requested web service can also be a client of other web services. Broker, such as a service registry, provides a way for the provider and the requestor of a web service to interact.

Слайд 16
Описание слайда:
Standards Web Services based on 3 main standarts: SOAP - messaging protocol based on XML; WSDL (Web Service Definition Language) - The language describing web services interface based on XML; UDDI (Universal Discovery, Description and Integration) universal interface identification, description and integration. Catalogue of Web services, and information about companies providing Web services into general use or specific companies. is similar to a telephone directory: Business Entity, Business Service, Binding Template and Technology Model (“white, yellow and green” pages ) Web service developing -> WSDL document creating ->web service publishing in UDDI registry -> searching and using by clients

Слайд 17
Описание слайда:
Example: MSDI description of web service

Слайд 18
Описание слайда:
WS Inspection WS Inspection is based on WSIL (Web Services Inspection Language), like UDDI, provides a method of service discovery for web services. Unlike UDDI, WSIL uses a de-centralized, distributed model, rather than a centralized model. The WSIL specification provides standards for using XML-formatted documents to inspect a site for services and a set of rules for how the information is mading available. The WSIL document is then hosted by the provider of the service, so consumers can find out about available services.

Слайд 19
Описание слайда:
WSIL document

Слайд 20
Описание слайда:
Advantages and disadvantages Advantages of Web Services Web services provide cooperation between software systems regardless of platform; Web services are based on open standards and protocols. Using XML provides ease development and debugging Web services; Using the Internet Protocol provides HTTP-interaction software systems through a firewall. Disadvantages of Web services: Lower performance and larger network traffic compared with the technologies RMI, CORBA, DCOM through the use of text XML-based messages. However, some Web servers can configure the compression of network traffic.

Слайд 21
Описание слайда:
Design methodologies Automated tools can help in the creation of a web service: bottom up method: developer writes implementing classes first (in some programming language), and then uses a WSDL generating tool to expose methods from these classes as a web service. top down method: developer writes the WSDL document first and then uses a code generating tool to produce the class skeleton, to be completed as necessary. This way is generally considered more difficult but can produce cleaner designs.

Слайд 22
Описание слайда:
Example Web Services for the developer: File web-service has an extension of asmx; The creation of web-service is not much different from creating a web form in. NET Framework; File the Web service must begin with a directive WebService; The web-service class may (but dosen’t need) be inherited from System.Web.Services.Webservice. A method that is called through the web, must have the attribute WebMethod.

Слайд 23
Описание слайда:
Example Create a new application in VS.NET and add to it File the web service. nw.asmx file contains the line - a directive WebService, which states that this file - is really a web service. <%@ WebService Language="c#" Class="WebServicesExample.nw" %> Code for the Web service will be located in the codebehind file nw.asmx.cs.

Слайд 24
Описание слайда:
Example On the Web service page: the name of a Web service (marked 1), a reference to the description of the service (2) (this link will continue to interest us in creating a Web service client) and a list of Web methods declared in a Web service (3).

Слайд 25
Описание слайда:
WebMethod attribute WebMethod attribute has six properties that affect the web-method: Description. This property(string) is for general description of the web-method. Description property value is displayed on the page describing web-service. EnableSession. This feature allows you to enable sessions. To enable it, specify the web-method as follow: MessageName. This property allows you to assign web-method name that is different from a class web-service method.

Слайд 26
Описание слайда:
WebMethod attribute TransactionOption. Web-service limits support transactions. With this property we can control how our method uses the transaction. It may take the following values: Disabled. Web method is executed outside the transaction; Supported. If a transaction exists - the method is executed in the context of this transaction, but if not - performance goes beyond the transaction; Required. Method requires a transaction to be executed. It always creates a new transaction (similar RequiresNew); RequiresNew. Method requires the creation of a new transaction. Each time you call the method it is creating a new transaction. CacheDuration. Caching of web services with an indication of time period in seconds, at which cached web service.

Слайд 27
Описание слайда:
WebMethod attribute BufferResponse. BufferResponse property allows you to manage web-buffered response method. Default output is buffered and sent to the client only after it is fully formed. However, if your web-method is very long runs, perhaps it makes sense to disable the buffering effect.

Слайд 28
Описание слайда:
Questions?


Скачать презентацию на тему Introduction to Web Services можно ниже:

Похожие презентации