Basics Of Web Service

Web Service 
  1. Web service is nothing but a simple logic that is written in any language. It is used to expose a particular server functionality to outside world so that heterogeneous application can consume it.

  2. These web services are language independent and platform independent. Web services are mainly used for cross communication between heterogeneous technologies.

  3. I can say that it acts as a mediator between the clients and server.

  4. For web service or server logic we can use any language (For example, java, Dot net, PHP, etc). The main things about web service is they expose the data in JSON or XML format.

  5. Heterogeneous application or the application developed using different platform cannot communicate with each other because they did not know the language of each other. This is similar to people who knows his local language can communicate with it only locality, he can’t communicate with other state local people.

  6. In this case the technology like XML and JSON emerge in the internet market. These two technology or language are independent of any technology or language they can communicate with different heterogeneous application. This is similar to HINDI or ENGLISH language. If you know English language especially then you can communicate to every locality person.

  7. Here I  have shown the clear picture about the web services.


  8. If we go inside these things I can show clear picture here.


  9. Here I have clearly explained the Web service or server logic can be done by any language because there output will be on either JSON or XML.

  10. This data exposed by web service by JSON or XML can be consumed by different technologies to communicate with database.

  11. During communication between web service and  different consumers the message is transported through SOAP (SIMPLE OBJECT ACCESS PROTOCOL).

  12. Soap is a communicating protocol.

  13. A client request to the web service for any data using SOAP message. The web service execute the logic fetching the data from the server, the retrieved data or the client requested data is now bundled into a soap message and sent to the client over the internet.



  14. Soap Message will contain envelop.

  15. Soap Envelop will contain the following things.

    SOAP HEADER- It will contain address of destination.

    SOAP BODY- It will contain actually message or methods that will be called.

    SOAP FAULT- It will contain error info.



  16. The soap message will look like this.

    xml

  17. Now the second and most important term that is used most of the time is WSDL (Web Service Description Language).

  18. It contains the overall information about the web service.

  19. It contains information such as-

            - Methods exposed in webservice.

            - Return type of methods.

           -  Parameters of method etc.

  20. WSDL is XML based language to provide description of webservice.

    xml file

  21. WSDL element  will contain the following things.

  • Definations- It is the root element in WSDL documents.
  • Types- It will contain types supported by WSDL to exchange data.
  • Message- It will contain methods supported by webservice.
  • Bindings- It will specify message encoding formats and the protocols for message exchanging.
The above figure of WSDL is not complete. I have just shown a part (half) of WSDL document to ensure that the WSDL looks like this.

Up Next
    Ebook Download
    View all
    Learn
    View all