Web Services For Developer -Rafiq Ahmed
Web Services Web Service is piece of business logic that Accessible through  standard protocol , such as HTTP,SMTP. Platform and language  independent .
Core technologies used for Web services XML  (Extensible Markup Language) is the markup language that underlies most of the specifications used for Web services. It's a generic language that can be used to describe any kind of content in a structured way, separated from its presentation to a specific device. SOAP  (Simple Object Access Protocol) is a network, transport, and programming language and platform-neutral protocol that allows a client to call a remote service. The message format is XML.
Core technologies used for Web services WSDL  (Web Services Description Language) is an XML-based interface and implementation description language. It is in order to specify the operations a Web service provides and the parameters and data types of these operations WSIL  (Web Services Inspection Language) is an XML-based specification about how to locate Web services without the necessity of using UDDI. However, WSIL can be also used together with UDDI, that is, it is orthogonal to UDDI and does not replace it. UDDI  (Universal Description, Discovery, and Integration) is both a client-side API and a SOAP-based server implementation that can be used to store and retrieve information on service providers and Web services.
WSDL The WSDL document contains the following main elements Types Message   Port type   Operation   Binding   Service   Port
WSDL Structure
WSDL  The WSDL document contains the following main elements: Types The types element describes all the data types used between the client and server  <definitions .... > <types> <xsd:schema .... />(0 or more) </types> </definitions> It’s provide an XML container element to define additional type information in case the XSD type system does not provide sufficient modeling capabilities.
Messages A message represents one interaction between a service requestor and service provider.  <definitions .... > <message name=&quot;nmtoken&quot;>  (0 or more) <part name=&quot;nmtoken&quot; element=&quot;qname&quot; (0 or 1)  type=&quot;qname&quot;  (0 or 1) /> (0 or more) </message> </definitions> The message element describes a  one-way  message, whether it is a single message request or a single message response.
Port types The portType element combines multiple message elements to form a complete  one-way or round-trip operation. WSDL supports four basic patterns of operation:  One-Way Request-Response Solicit-Response Notification
Bindings The binding element describes the concrete specifics of how the service will be implemented on the  wire . WSDL includes built-in extensions for defining SOAP services, and SOAP-specific information therefore goes here.  SOAP-specific details:  soap:binding  Transport-  Which Protocol to be use? Style –  Data representation style ? soap:operation  soap:body  Use –  How to do interpretation of data?
Service definition   The service element specifies the location of the services via port. Port   A port definition describes an individual endpoint by specifying a single address for a binding
WSDL 1.1 and WSDL 2.2
SOAP SOAP  is a protocol specification for exchanging  structured information  in the implementation of Web Services in computer networks Three pillars of SOAP SOAP is an XML-based protocol that consists of three parts Envelope with header and body Encoding rules Communication styles
SOAP Envelope An  envelope  containing zero or more  headers  and exactly one  body It might contain exceptions to report failures or unexpected conditions Header  tells  who  and  how  to deal with the message. Body  tells  what  has do be done.
SOAP: Encoding rules Encodings   rules   define how data values defined in the application can be translated to and from a protocol format.  The  literal  encoding is a simple XML message that does not carry encoding information. Usually, an XML Schema describes the format and data types of the XML message The  SOAP encoding   enables marshalling/unmarshalling of values of data types from the SOAP data model. It contain information in EncodingStyle attribute of SOAP. Encoding to be used by the SOAP can be specified at deploy time or at runtime.
SOAP: Communication styles RPC  (remote procedure call) messaging is a  synchronous   invocation of operation returning a result, conceptually similar to other RPCs.  Document  messaging Also known as  message-oriented  style: is a  asynchronous   invocation of operation returning a result, . The input   parameter is any XML document; the  response  can be anything (or nothing).
RESTful Web Service
A Brief Introduction to RESTful WS Representational State Transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. Also called as “RESTful HTTP” Five key principles are: Give every “resource” an ID Link things together Use standard methods Resources with multiple representations Communicate statelessly
Give every “resource” an ID ID here is URI - unique global ID. Make URI - Resource-Oriented. Do proper URI design around resource. Bad:http://company1.com/jsp/foo/report.htm?type=sales&date=2009-3 Good:http://company1.com/report/sales/2009/month/3 Link things together “ Hypermedia as the engine of application state” -HATEOAS. Concept of hypermedia, or in other words:  links . URIs in sufficient context and info.
Use standard methods set of operations supported by the web service using  HTTP methods  (e.g., POST, GET, PUT or DELETE).  RESTful HTTP approach -  HTTP application protocol Action Verb Create POST Retrieve GET Update PUT Delete DELETE
For clients to be able to interact with your resources, they should implement the default  application protocol (HTTP) correctly, i.e. make use of the standard methods GET, PUT, POST, DELETE. And should return HTTP status code like 200, 404, 500 etc.
Resources with multiple representations. How does a server and client know that , how to deal with the data it retrieves? Http header : Content-Type and Accept Communicate statelessly.
Summary ( What I can recall??) WS-* WSDL  < - ->  Interface SOAP < -- > Object RESTFul WS Resource < -- > URI Use Me :: GET – PUT – POST - DELETE Binding ;  Litrel/Encoding HTTP ;SMTP
THE END

Web services for developer

  • 1.
    Web Services ForDeveloper -Rafiq Ahmed
  • 2.
    Web Services WebService is piece of business logic that Accessible through standard protocol , such as HTTP,SMTP. Platform and language independent .
  • 3.
    Core technologies usedfor Web services XML (Extensible Markup Language) is the markup language that underlies most of the specifications used for Web services. It's a generic language that can be used to describe any kind of content in a structured way, separated from its presentation to a specific device. SOAP (Simple Object Access Protocol) is a network, transport, and programming language and platform-neutral protocol that allows a client to call a remote service. The message format is XML.
  • 4.
    Core technologies usedfor Web services WSDL (Web Services Description Language) is an XML-based interface and implementation description language. It is in order to specify the operations a Web service provides and the parameters and data types of these operations WSIL (Web Services Inspection Language) is an XML-based specification about how to locate Web services without the necessity of using UDDI. However, WSIL can be also used together with UDDI, that is, it is orthogonal to UDDI and does not replace it. UDDI (Universal Description, Discovery, and Integration) is both a client-side API and a SOAP-based server implementation that can be used to store and retrieve information on service providers and Web services.
  • 5.
    WSDL The WSDLdocument contains the following main elements Types Message Port type Operation Binding Service Port
  • 6.
  • 7.
    WSDL TheWSDL document contains the following main elements: Types The types element describes all the data types used between the client and server <definitions .... > <types> <xsd:schema .... />(0 or more) </types> </definitions> It’s provide an XML container element to define additional type information in case the XSD type system does not provide sufficient modeling capabilities.
  • 8.
    Messages A messagerepresents one interaction between a service requestor and service provider. <definitions .... > <message name=&quot;nmtoken&quot;> (0 or more) <part name=&quot;nmtoken&quot; element=&quot;qname&quot; (0 or 1) type=&quot;qname&quot; (0 or 1) /> (0 or more) </message> </definitions> The message element describes a one-way message, whether it is a single message request or a single message response.
  • 9.
    Port types TheportType element combines multiple message elements to form a complete one-way or round-trip operation. WSDL supports four basic patterns of operation: One-Way Request-Response Solicit-Response Notification
  • 10.
    Bindings The bindingelement describes the concrete specifics of how the service will be implemented on the wire . WSDL includes built-in extensions for defining SOAP services, and SOAP-specific information therefore goes here. SOAP-specific details: soap:binding Transport- Which Protocol to be use? Style – Data representation style ? soap:operation soap:body Use – How to do interpretation of data?
  • 11.
    Service definition The service element specifies the location of the services via port. Port A port definition describes an individual endpoint by specifying a single address for a binding
  • 12.
    WSDL 1.1 andWSDL 2.2
  • 13.
    SOAP SOAP is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks Three pillars of SOAP SOAP is an XML-based protocol that consists of three parts Envelope with header and body Encoding rules Communication styles
  • 14.
    SOAP Envelope An envelope containing zero or more headers and exactly one body It might contain exceptions to report failures or unexpected conditions Header tells who and how to deal with the message. Body tells what has do be done.
  • 15.
    SOAP: Encoding rulesEncodings rules define how data values defined in the application can be translated to and from a protocol format. The literal encoding is a simple XML message that does not carry encoding information. Usually, an XML Schema describes the format and data types of the XML message The SOAP encoding enables marshalling/unmarshalling of values of data types from the SOAP data model. It contain information in EncodingStyle attribute of SOAP. Encoding to be used by the SOAP can be specified at deploy time or at runtime.
  • 16.
    SOAP: Communication stylesRPC (remote procedure call) messaging is a synchronous invocation of operation returning a result, conceptually similar to other RPCs. Document messaging Also known as message-oriented style: is a asynchronous invocation of operation returning a result, . The input parameter is any XML document; the response can be anything (or nothing).
  • 17.
  • 18.
    A Brief Introductionto RESTful WS Representational State Transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. Also called as “RESTful HTTP” Five key principles are: Give every “resource” an ID Link things together Use standard methods Resources with multiple representations Communicate statelessly
  • 19.
    Give every “resource”an ID ID here is URI - unique global ID. Make URI - Resource-Oriented. Do proper URI design around resource. Bad:http://company1.com/jsp/foo/report.htm?type=sales&date=2009-3 Good:http://company1.com/report/sales/2009/month/3 Link things together “ Hypermedia as the engine of application state” -HATEOAS. Concept of hypermedia, or in other words: links . URIs in sufficient context and info.
  • 20.
    Use standard methodsset of operations supported by the web service using  HTTP methods  (e.g., POST, GET, PUT or DELETE). RESTful HTTP approach - HTTP application protocol Action Verb Create POST Retrieve GET Update PUT Delete DELETE
  • 21.
    For clients tobe able to interact with your resources, they should implement the default application protocol (HTTP) correctly, i.e. make use of the standard methods GET, PUT, POST, DELETE. And should return HTTP status code like 200, 404, 500 etc.
  • 22.
    Resources with multiplerepresentations. How does a server and client know that , how to deal with the data it retrieves? Http header : Content-Type and Accept Communicate statelessly.
  • 23.
    Summary ( WhatI can recall??) WS-* WSDL < - -> Interface SOAP < -- > Object RESTFul WS Resource < -- > URI Use Me :: GET – PUT – POST - DELETE Binding ; Litrel/Encoding HTTP ;SMTP
  • 24.

Editor's Notes

  • #11 A binding defines message format and protocol details for operations and messages defined by a particular portType. There may be any number of bindings for a given portType.