web services for developer
DESCRIPTION
Web services for developerTRANSCRIPT
![Page 1: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/1.jpg)
Web Services For Web Services For DeveloperDeveloper
-Rafiq Ahmed
![Page 2: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/2.jpg)
Web Services
Web Service is piece of business logic that Accessible through standard protocol, such as HTTP,SMTP. Platform and language independent.
![Page 3: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/3.jpg)
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.
![Page 4: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/4.jpg)
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.
![Page 5: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/5.jpg)
WSDLWSDL
The WSDL document contains the following main elements Types Message Port type Operation Binding Service Port
![Page 6: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/6.jpg)
WSDL Structure
![Page 7: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/7.jpg)
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.
![Page 8: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/8.jpg)
MessagesA message represents one interaction between a servicerequestor and service provider. <definitions .... >
<message name="nmtoken"> (0 or more)<part name="nmtoken" element="qname"(0 or 1) type="qname" (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.
![Page 9: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/9.jpg)
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
![Page 10: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/10.jpg)
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?
![Page 11: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/11.jpg)
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
![Page 12: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/12.jpg)
WSDL 1.1 and WSDL 2.2
![Page 13: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/13.jpg)
SOAPSOAP
SOAP is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks
Three pillars of SOAPSOAP is an XML-based protocol that consists of three parts
1. Envelope with header and body2. Encoding rules3. Communication styles
![Page 14: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/14.jpg)
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.
![Page 15: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/15.jpg)
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.
![Page 16: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/16.jpg)
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).
![Page 17: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/17.jpg)
RESTful Web ServiceRESTful Web Service
![Page 18: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/18.jpg)
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
![Page 19: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/19.jpg)
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-3Good: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.
![Page 20: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/20.jpg)
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
![Page 21: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/21.jpg)
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.
![Page 22: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/22.jpg)
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.
![Page 23: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/23.jpg)
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
![Page 24: Web services for developer](https://reader034.vdocuments.us/reader034/viewer/2022042814/554f9378b4c9052a518b54f1/html5/thumbnails/24.jpg)
THE END