Presentation is loading. Please wait.

Presentation is loading. Please wait.

What are Web Services? Definition of web service A web service is a distributed unit of business logic that can be accessed over Internet standard web.

Similar presentations


Presentation on theme: "What are Web Services? Definition of web service A web service is a distributed unit of business logic that can be accessed over Internet standard web."— Presentation transcript:

1

2 What are Web Services? Definition of web service A web service is a distributed unit of business logic that can be accessed over Internet standard web protocols, such as HTTP and that uses XML for sending and receiving messages. ClientWeb ServiceBusiness Logic Network Call

3 Goals of Web Services To solve interoperability in a platform-neutral way and remove all that mismatches that exist between the various vendors. To create an abstraction layer between heterogeneous nodes on the network. To be highly accessible to all platforms through the use of Internets protocols and XML. To enable interoperability between any type of system. To provide a solution to bypass firewalls, thus allowing any client to access a remote services. To take advantage of reduction in communication and server costs. To advocate designing software as a set of distributed services rather that a component run within a singles process.

4 Web pages Vs Web services CharacteristicsWeb pagesWeb services Transport mechanismHTTP, SMTP, FTP URLsYes Message FormatHTMLXML Information TypeEmbedded DataStructured Data InteractiveYes (DHTML)No Remote application Communication NoYes Platform NeutralYes Deployed environmentWeb/Application server Distributed ModelClient/ServerP2P

5 Web service Technology Stack Discovery Description Messaging Transport Network UDDI, DISCO, WSIL, ebXML WSDL, RDF, ebXML SOAP, XML-RPC (XML) HTTP, SMTP, FTP TCP/IP, UDP Layer Protocol/ Standard UDDI : Universal Description Discovery and Integration DISCO : Web Service Discovery Tool WSIL : Web Services Inspection Language RDF : Resource Description Framework UDP : User Datagram Protocol

6 Web services Architecture Provider The provider is essentially the company offering a set of Web Services. Consumer The consumer in P2P model is essentially a client that can do 2 things; discover and consume set of web services. Registry This is essentially an XML base repository for business entities and list of published services offered by organizations. ConsumerRegistry Provider 1. publish 2. Discover 3. Bind

7 Web Service Development Life-Cycle Design Implementing &Test Describe Deploy Publish Maintain

8 Web Service Development Life-Cycle Design Figure out what kind of Web Services want to build. Whether legacy business logic is to be expose or new code should be created or several existing web services should be aggregated to coordinate a business process etc. Decide what kind of tool kits to use and which protocols should be used. Implementing and Test Create a Web Service server using selected tool kit. Test interoperability issues between the various toolkits, ex : both PHP and other platforms. Describe and Deploy Create a description document using WSDL and deploy the service on server. Publish (Optional) Optionally, your organization may wish to publish your web service to a UDDI registry. Maintain Ensuring the application is performing, is secure, and that the developers may implement new features and bug fixes as required.

9 HTTP Hyper Text Transfer Protocol HTTP 1.0 HTTP 1.1 The default mechanism of communication for the World Wide Web.

10 HTTP 1.0 Header Request Header GET /index.php HTTP/1.0 Response Header HTTP/1.0 200 OK Date : Fri, 09 August 2008 11:53:56 GMT Content Length : 152 Content-Type : text/html

11 HTTP 1.1 Header Request Header GET /index.php HTTP/1.1 Accept : image/gif, image/jpeg, */* Accept-Language : en-us Accept-Encoding : gzip, deflate User-Agent : Mozilla/4.0 (compatible; MSIE 6.02; windows NT) Host : www.domain.com:80www.domain.com:80 Connection : Keep-Alive

12 HTTP 1.1 Header Response Header HTTP/1.1 200 OK Date : Fri, 09 August 2008 11:53:56 GMT Server : Apache X-Powered-By: PHP/4.4.9 Last-Modified : Thu, 08 August 2008 11:53:56 GMT Content Length : 152 Connection : close Transfer-Encoding : chunked Content-Type : text/html

13 HTTP methods Get Post Head The client sends a HEAD request when it wants to see only the headers of a response, such as Content-Type or Content-Length. Put Allows a client to place a file on the server and is similar to sending a file by FTP. Delete The DELETE operation allows a client to remove a document or Web page from the server. Options The OPTIONS request determines which HTTP methods the server supports and returns an appropriate header. Trace A TRACE returns the headers sent with the TRACE request to the client, so that they can be used in debugging.

14 HTTPS HTTPS (HTTP over SSL or HTTP Secure) is the use of Secure Socket Layer (SSL) or Transport Layer Security (TLS) as a sub layer under regular HTTP application layering. HTTPS encrypts and decrypts user page requests as well as the pages that are returned by the Web server. The use of HTTPS protects against man-in-the- middle attacks. HTTPS was developed by Netscape.

15 XML-RPC Overview XML-RPC ClientXML-RPC Server Web Browser HTTP Client make request to the server and fetches request Browse interacts with HTML based application Client make request to the server and fetches request Server receives request and renders response for client to fetch XML-RPC is a remote procedure call protocol encoded in XML First web service protocol Use HTTP POST method

16 XML-RPC Request POST /web_service_api/xmlrpc_server.php HTTP/1.1 User-Agent: PHP/xmlrpc_client Host: www.domain.com Content-Type: text/xml Content-Length: 189 Connection: Close hello XML-RPC

17 XML-RPC Request Header The first line POST /web_service_api/xmlrpc_server.php HTTP/1.1 The general format is [method][responder][protocol] The method used here is HTTP POST The responder defines how the remote device should handle the request. Where PHP is concerned, this will be the location and name of the XML-RPC server script In the protocol field, defined the version of the HTTP using (HTTP 1.0 or HTTP 1.1)

18 XML-RPC Request Header (Cont) On the second line User-Agent: PHP/xmlrpc_client The user agent as a string that identifies the XML-RPC client Third line Host: www.domain.com This is used to identify the server to which the request is being sent. Optionally we can specify a port number here Host: www.domain.com:8080

19 XML-RPC Request Header (Cont) Combining the first and third lines, we have the complete path to our server: www.domain.com/web_service_api/xmlrpc_serve r.php On the line four and five, defines the Content- type, text/xml, and the length of the data being sent to tell the server how much data to except.

20 XML-RPC Request Header (Cont) Finally we have the header: Connection: Close HTTP 1.1 allows for the possibility of the HTTP connection remain open, so we can submit further request. However, a PHP script expecting an FEOF will be waiting indefinitely for the response to finish.

21 The Payload The payload contained within a single XML structure:. In side the method call, the method name want to use along with any associated parameters. hello XML-RPC

22 XML-RPC Response HTTP/1.1 200 OK Connection: Close Content-Length: 189 Content-Type: text/xml Date: Wed, 12 Feb 2006 13:43:03 GTM Server: domain.com/PHP_XMLRPC_SERVER Hello XML-RPC

23 XML-RPC data types - Scalars Data TypeXML TagExample Values Four-byte signed integer or -234, 1435 Boolean 0(false) or 1(true) ASCII String Hello World! Double precision floating point -43.342 ISO 8601 Format Date 20060212T12:00:00 Base64-encoded binary eW3434DSgDG#$

24 XML-RPC data types - Arrays An array are all ways contains a single element, which it self can contains multiple values of any type. 1.4 3.4

25 XML-RPC data types - Struts Which allow us to constructs similar to an associative array of named keys and element in PHP. name John age 23

26 XML-RPC Fault Response faultCode 4 faultString Too many parameters. Contains fault codeand fault string to identify the errors. No global list if error messages. Its up to the developer to assign the fault codes and corresponding fault strings

27 XML-RPC Introspection Methods system.listMethods() – Lists currently registered methods system.describeMethods() – Describes the available methods in detail system.methodHelp() – Return documentation for a specified methid systen.methodSignature() – Returns signature for a specific method system.getCapabilities() – Lists server capabilities

28 What is SOAP? SOAP stands for Simple Object Access Protocol SOAP is a communication protocol SOAP is for communication between applications SOAP is a format for sending messages SOAP communicates via Internet SOAP is platform independent SOAP is language independent SOAP is based on XML SOAP is simple and extensible SOAP allows you to get around firewalls SOAP is a W3C recommendation

29 SOAP vs XML-RPC Everything that XML-RPC can do, SOAP does as well. XML-RPC is much simpler SOAP makes it easier to exchange more complex documents. SOAP runs over many protocols: HTTP, SMTP, FTP, … SOAP allows developers to create their own types using XML schemas.

30 SOAP Message Skelton <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">.........


Download ppt "What are Web Services? Definition of web service A web service is a distributed unit of business logic that can be accessed over Internet standard web."

Similar presentations


Ads by Google