Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transport Protocols  SOAP is used to send a message over any kind of transport protocol. Some of the protocols are, 1.HTTP 2.TCP/IP 3.UDP 4.SMTP.

Similar presentations


Presentation on theme: "Transport Protocols  SOAP is used to send a message over any kind of transport protocol. Some of the protocols are, 1.HTTP 2.TCP/IP 3.UDP 4.SMTP."— Presentation transcript:

1 Transport Protocols  SOAP is used to send a message over any kind of transport protocol. Some of the protocols are, 1.HTTP 2.TCP/IP 3.UDP 4.SMTP

2 1. HTTP It is a connection-oriented protocol that is based on request and response message. Ex. Request Message GET /cweb/crservice.html HTTP/1.1 Ex. Response Message HTTP/1.1 200 ok Content-Type : text/xml character=utf-8 Content-Length : nnn This is a Html page.

3 2. TCP/IP  It is a connection-oriented protocol.  Enables to send message in sequence and receive acknowledgement of delivery and can have retransmission of messages  Messages are called as packets. Each packet can have 65535 bytes.

4 TCP/IP format

5 3. UDP  It is a connectionless protocol  No acknowledgement for received messages  No servers, Everyone can listen and send.  Unreliable.

6 UDP format

7 4. SMTP  It is the protocol to send e-mail messages  It is Connection-oriented  It looks similar to http messages but reliable.  All smtp data is 7-bit ASCII with high- order bit always 0.  Always use port-25

8 Messaging with Web Services Refer Hard copy Notes

9 SOAP (Simple Object Access Protocol)

10 SOAP SPECIFICATIONS  The Simple Object Access Protocol (SOAP) is an XML-based messaging and remote procedure call (RPC) specification that enables the exchange of information among distributed systems.  Initially proposed by Microsoft, SOAP has established itself as the de facto standard for an open, extensible, XML-based wire protocol.

11 SOAP has achieved its level of widespread acceptance for several reasons: 1.It is an open specification, available for anyone to use. 2.It is simple to write and is “human- readable.” 3.It is extensible, taking advantage of the power of XML to enable loose coupling between remote systems. 4.It is a flexible protocol that is useful both in request / response and message passing/queuing architectures.

12 SOAP provides three key capabilities: 1.SOAP is a messaging framework, consisting of an outer Envelope element that contains an optional Header element and a mandatory Body element. 2.SOAP is an encoding format that describes how objects are encoded, serialized, and how decoded when received. 3.SOAP is an RPC mechanism that enables objects to call methods of remote objects. Capabilities of SOAP

13 SOAP MESSAGE STRUCTURE

14 SOAP Envelope Element  The SOAP Envelope element is the mandatory top element of the XML document that represents the SOAP message being sent.  It may contain namespace declarations as well as other attributes.  The namespace, http://schemas.xmlsoap.org/soap/envelope/, is required by all SOAP messages.

15 NAMESPACES  xmlns:SOAP- ENV=”http://schemas.xmlsoap.org/soap/envel ope/”  xmlns:xsi=”http://www.w3.org/1999/XMLSchem a-instance”  xmlns:xsd=”http://www.w3.org/1999/XMLSche ma”  SOAP- ENV:encodingStyle=”http://schemas.xmlsoap. org/soap/encoding/”>

16 Header Element Optional element offers a flexible framework for specifying additional application-level requirements. Provides an open mechanism for authentication, transaction management and payment authorization. It specifies two attributes. A) Actor : – Is used to point out the next target in the message hop. – Value of the attribute is the URL of the next endpoint. – The absence of indicates that the next endpoint is the ultimate recipient. B) MustUnderstand : – Indicates whether a header element is optional or mandatory. If set to True, the recipient must understand and process the Header attribute according to its defined semantics or return a fault.

17 BODY Element This is mandatory for all SOAP messages. It carries the payload of the soap message which will be processed by the ultimate receiver. Body ( required) Fault ( Optional )

18 Fault In the event of an error, the body element will include a fault element. Fault Subelements : i.faultCode : a text code used to indicate a class of errors ii.faultString : a human-readable explanation of the error. iii.faultActor : a text string indicating which node causes fault. iv.detail : to carry error message and the child element entries. Fault Codes : SOAP-ENV : VersionMismatch - invalid namespace SOAP-ENV : mustUnderstand - Unable to process mustUnderstand attribute SOAP-ENV : Client – client request has error SOAP-ENV : Server is unable to process the client request.

19 SOAP ENCODING SOAP includes a built-in set of rules for encoding data types. this enables the soap message to indicate specific data types like integers, floats, doubles or arrays. SOAP datatypes are divided into two types. A.Scalar type : contain exactly one value like lastname, price, qty, … The datatypes are string, boolean, float, double, binary, integer, long, byte, ….etc.,

20 B. Compound type : – Contain multiple values like purchase order, invoice,..etc., – It is further divided into two. Array : contain multiple values with position no. Struct : contain multiple values and each element specified by an accessor name. Ex.) To specify an array of 10 double values, arrayType = “xsi:double[10]” For two dimensional, arrayType = “xsi:string[5,5]” Namespace used for SOAP-Encoding are, For SOAP1.1, http://schemas.xmlsoap.org/soap/encoding For SOAP1.2, http://www.w3.org/2001/09/soap-encoding

21 Weather Service SOAP Client SOAP Request : What is the temp. for Zip=10016 ? SOAP Client SOAP Response : 71 F

22 WSDL (Web Service Description Language)

23 Describing web services – WSDL WSDL is a specification defining how to describe web services in a common XML grammar. WSDL describes four critical pieces of data:  Interface information describing all publicly available functions  Data type information for all message requests and message responses  Binding information about the transport protocol to be used  Address information for locating the specified service

24 WSDL Specification The specification itself is divided into six major elements: 1.Definitions 2.Types 3.Message 4.PortType 5.Binding 6.Service It has the following utility elements: 1.Documentation 2.import

25 1. Definitions : The definitions element must be the root element of all WSDL documents. It defines the name of the web service, declares multiple namespaces used throughout the remainder of the document, and contains all the service elements described here. EX) <definitions name="HelloService" targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> The targetNamespace is a convention of XML Schema that enables the WSDL document to refer to itself. xmlns=http://schemas.xmlsoap.org/wsdl/ is the default namespace.

26 2. Types The types element describes all the data types used between the client and server. WSDL is not tied exclusively to a specific typing system, but it uses the W3C XML Schema specification as its default choice. If the service uses only XML Schema built-in simple types, such as strings and integers, the types element is not required. 3.Message The message element describes a one-way message, whether it is a single message request or a single message response. It defines the name of the message and contains zero or more message part elements, which can refer to message parameters or message return values.

27 Ex ) for Message element Two message elements are defined. The first represents a request message, SayHelloRequest, and the second represents a response message, SayHelloResponse: Each of these messages contains a single part element. For the request, the part specifies the function parameters; For the response, the part specifies the function return values;

28 4. PortType : The portType element combines multiple message elements to form a complete oneway or round-trip operation. For example, a portType can combine one request and one response message into a single request/response operation, most commonly used in SOAP services. Ex) The portType element defines a single operation, called sayHello. The operation itself consists of a single input message (SayHelloRequest) and a single output message (SayHelloResponse): The input element specifies a message attribute of tns:SayHelloRequest ; the tns prefix references the targetNamespace defined earlier within the definitions element.

29 Patterns of operation a. One-way The service receives a message. The operation therefore has a single input element. b. Request-response The service receives a message and sends a response. To encapsulate errors, an optional fault element can also be specified.

30 c. Solicit-response The service sends a message and receives a response. The operation therefore has one output element, followed by one input element. To encapsulate errors, an optional fault element can also be specified. d. Notification The service sends a message. The operation therefore has a single output element.

31 5. Binding The binding element describes the concrete specifics of how the service will be implemented on the wire. The binding element itself specifies name and type attributes: Ex) The type attribute references the portType 6. Service The service element defines the address for invoking the specified service. Most commonly, this includes a URL for invoking the SOAP service.

32 WSDL specification also defines the following utility elements: 1. Documentation : The documentation element is used to provide human-readable documentation and can be included inside any other WSDL element. 2. Import : The import element is used to import other WSDL documents or XML Schemas. This enables more modular WSDL documents. For example, two WSDL documents can import the same basic elements and yet include their own service elements to make the same service available at two physical addresses. Utility Elements in WSDL

33 WS-Policy Refer Hard copy Notes

34 WS-Inspection is a simple XML grammar for gathering services together. used to inspect endpoints like root of a web server and to find which services the endpoint offers. is a document with extension.wsil

35 Anatomy of WS-Inspection WS_Inspection documents have a root element with the local name and has the namespace, Within the root element there can be service elements which can contain many description elements. EX) <description referredNamespace = "http://schemas.xmlsoap.org/wsdl/" location = "http://test.com/service.asmx?wsdl"/>

36 END OF III UNIT


Download ppt "Transport Protocols  SOAP is used to send a message over any kind of transport protocol. Some of the protocols are, 1.HTTP 2.TCP/IP 3.UDP 4.SMTP."

Similar presentations


Ads by Google