Thursday, 5 July 2012

WEB Services



The Audio blog for the page is on here

WEB SERVICES AND INTER NETWORKING

Internet :
                 Internet is the interconnection of networks ranging from small networks to very large networks. In internet all the machines which are connected will have an IP address assigned to it.Here IP stands for Internet Protocol. An IP address is a 32-bit number and it is divided into four octets (eg:120.118.109.18). There is an ISP(Internet Service Provider) which assigns the IP address to the machines.The IP address is used to uniquely find a machine in the network.

URL:
           URL(Uniform Resource Locater) is used to locate a particular machine on the Internet. To avoid people from remembering the address of the machines by their IP's , URLs are used. URL for the google server is www.googel.com and it contains the following parts

  1. Host name(“www”)
  2. Domain name(“google”)
  3. Top-level domain name(“com”)
Each domain will need a DNS to get the name resolved. There can be up to 127 domain levels for the given URL.


DNS:
                 Domain Name Server is the Name server which will map the human understandable url(eg.https://www.google.com) into an IP address of a machine. Whenever we enter an url into a web browser, the browser will forward the request to the name server which will identify the IP address of the requested machine.
           The name server will search the given URL ,if found it gives the IP back, else it will forward the request to another name server .Inorder to prevent long searches the found page is usually placed in a cache sot that it can be retrieved easily.

PORTS:
               Ports are the path through will the system sends and receives messages from the Networks. There are various ports available in a system. There can be many applications running in the system and each one is assigned a particular port number . The popular ones are HTTP-80 ,FTP-21,Telnet-23. But these applications can be made to listen to different ports also.

                 If you want to fetch a file from a server .You will communicate to the server using port number 21 and make the FTP server running in that port to get a particular file.The same applies for fetching a web page from a server having web server running at port 80. The popular web servers apache, tomcat.



COOKIES:
                  Cookie is a piece of text that is issued by the server and is placed in the client's hard disk. The information is usually used by the site to give the user better satisfication. When the client connects to the server, the server uses the cookie from the client for various reasons like authentication, conting the number of visitors the website actually have, customize the data to be presented.

                  The cookies will be stored as a name-value pair. The cookies will usually be encrypted and it will mostly come up with a expiration date.

                The cookies also have problems with privacy of the user. As the cookie contain the personal information of the user it can be sold to other companies which may need them.

SESSIONS :
               Sessions are the details maintained about the user on the server-side. They are used along with cookies. It starts with the start of communication and deleted at later time.The session helps to maintain the details of the person communicating with by maintaining the session id.

INTERNET PROTOCOLS:
Protocols are the general rules that are to be followed while transmitting the data between the machines using Internet.



HTTP:
               HTTP(HyperText Transfer Protocol) is an application layer protocol and it is widely followed for over the Internet. Its port number is 80 and it is a stateless protocol.Stateless in the sense it doesn't save the state of the connections.
                If you ask for a page to a server the page will get loaded and the connection between you and the server gets canceled.It is stateless as it doesn't want to keep track of details of all the connections it has at a time.Cookies and server side sessions help in overcoming the statelessness of the HTTP.
                HTTP also allows us to cache the pages. We can also set options like till when we can use this cached page and whether it could be placed in cached only in the browser or in any public caches.


Web Server :
                        Web server are used to handle the HTTP requests coming from the clients and respond them by replying them with a HTML file containing extra features like picture , script or anything requested. If a request comes like http://www.sb.com/index/first.html , then it will be translated as
            GET   /index/first.HTML and host
            Host : www.sb.com
with the root node for the web server as any folder you set as root .

FTP:
         File Transfer Protocol is a application layer protocol. It is used to send and receive files using TCP based networks. It is primarily used to get the web pages from a private machine to the web server. It is also used in private networks.The initial connection between the client and the server is control connection and then the data is transferred in the data connection.
        FTP uses port 21 to establish connections and port 20 to send the files.They are often used in private networks sharing information from a server.

SCP:
        Secure Copy is a way to transfer data from client to server in a secure way. It employs encryption/decryption techniques. It is generally slower than the TCP, but it is more secure than the FTP. It works on two modes, source mode where it sends files to the client and sink mode where it gets the file from the client.

SOAP:
           SOAP is a format for exchanging information between web server and other machines in the network. It employs the use of XML files to send data i.e, the message transferred between client and server will be a XML document. SOAP uses either HTTP GET or POST methods.As it uses XML it is highly structural.

RESTful Web Services:
                          REpresentational State Transfer is an architecture which describes the way in which the data is to be transfered from the client to the server .It helps in transferring the data through the url and it prevents parsing any XML files to retrieve the data as they do it in SOAP. But soap is more safe to makes use of type checking .The methods used in REST are ,
             1) GET
             2)POST
             3)DELETE
             4)PUT

                     No matter how hard you study only if you program using REST you will know its concepts clearly.

No comments:

Post a Comment