You are on page 1of 18

Web Service Domain knowledge

Documentation By: Lam Nguyen

©2018 LogiGear Corporation 1


Agenda

I. Overview

II. Web Service Structure

III. REST & SOAP

©2018 LogiGear Corporation 2


Overview

©2018 LogiGear Corporation 3


Overview

• What is API?
- API is the acronym for Application
Programming Interface.

- It enables communication and data


exchange between two separate software
systems. A software system implementing
an API contains functions/sub-routines
which can be executed by another software
system.

©2018 LogiGear Corporation 4


Overview (cont.)

• What is Web Service?


 All Web Services are API
 But also have additional attributes:
– available over the Internet or private networks.
– using XML, JSON, text, html,.. messages for
transferring.
– is not tied to any one operating system or
programming language.
– is self-describing via a common XML
grammar (WSDL, WADL)

©2018 LogiGear Corporation 5


Overview (cont.)

The most important of Web services is interoperability:

– Web Services allow various applications to talk to


each other and share data and services among
themselves.

– Web Service can also use the other Web Services.

©2018 LogiGear Corporation 6


Overview (cont.)

• Why is Web Service?


- A web service can be used for any applications on any
environments

©2018 LogiGear Corporation 7


Overview (cont.)

• How does a Web Service work?

Database

©2018 LogiGear Corporation 8


Web Service Structure

©2018 LogiGear Corporation 9


Web Service Structure

The several main points of a web service:

 REQUEST
- URI
- METHOD: GET, POST, PUT, DELETE, …
- HEADER: Authorization, Content-Type, Cookies...
- PARAMETER: path param, query param, …
- CONTENT (Body): xml, json,..

 RESPONSE
- HEADER: Status Code (200, 400, 404, 500,..)
- CONTENT (Body): xml, json, html, text

©2018 LogiGear Corporation 10


Web Service Structure(cont.)

• URI, which stands for Uniform Resource Identifier, is to identify a resource or a


collection of resources.

• Syntax: protocol:[//host-domain[:port]][/]path[?query][#fragment]

host path fragment

http://corptfsapp01:8080/tfs/DefaultCollection/inContact/QA/_workitems?id=29199&mode=edit#Steps

protocol port query

• Example:
• http://lgvn13415:8080/RESTful/rest/customers

• Protocol: http
• Host: lgvn13415
• Port: 8080
• Path: /RESTful/rest/customers

©2018 LogiGear Corporation 11


Web Service Structure (cont.)

Parameters:
• Path Parameter
- It’s located inside the path and before the question mark
https://localhost/config/amptrac/devices/{deviceIP}/units?..

• Query Parameter
- It’s located after the question mark
/config/amptrac/devices?startAtIpAddress=123&retainData=true

• Body Parameter
- A XML/JSON/Text/HTML.. content

©2018 LogiGear Corporation 12


SOAP & REST

©2018 LogiGear Corporation 13


SOAP & REST

• SOAP is an acronym for Simple Object Access Protocol.


It is an XML-based messaging protocol for exchanging
information among computers. SOAP is an application of
the XML specification.

©2018 LogiGear Corporation 14


SOAP & REST (cont.)

More about SOAP:

• Only use POST method

• Only use XML for message transferring

• Using WSDL to describe itself

• WSDL always public – it means if you can use any web


service of SOAP, you are able to get the WSDL

©2018 LogiGear Corporation 15


SOAP & REST (cont.)

• REST stands for Representational State Transfer


• is an architectural style
• is web standards based architecture and uses HTTP Protocol for data
communication.
• In REST architecture, a REST Server simply provides access to
resources and REST client accesses and presents the resources.
• each resource is identified by URIs/ global IDs
• following well known HTTP methods are commonly used in REST
based architecture: GET, PUT, DELETE, POST, HEAD, OPTIONS.

• RESTful, which is web service, implements such an REST architecture

©2018 LogiGear Corporation 16


SOAP & REST (cont.)

• SOAP vs. REST


SOAP REST
is a protocol. is an architectural style.
uses services interfaces to expose the business
uses URI to expose business logic
logic
larger message formats, permits XML data smaller message formats, permits different data
format only format such as Plain text, HTML, XML, JSON etc

defines standards to be strictly followed does not define too much standards like SOAP

requires more bandwidth and resource than


requires less bandwidth and resource than SOAP
REST

RESTful web services inherit security measures from


defines its own security
the underlying transport.

is less preferred than REST more preferred than SOAP

©2018 LogiGear Corporation 17


THANK YOU!

Back to Top

©2018 LogiGear Corporation 18

You might also like