Newsletter

What is Web Services, Web Services Introduction

Web Services » on Jul 6, 2014 { 24 Comments } By Sivateja

What is Web Services ? Over the internet, you might have seen different kinds of definitions for Web services. My definition will almost resembles them 🙂 Web Services, the name it self indicates that its a service which is available over the Web, that’s it. As an example you can consider Java4s.com, When ever you hit the URL in the web browser it will gives you some output in HTML format, you can also consider this as a Web service.  With web services, we can communicate different applications on different platforms, i mean a java application in Windows platform can easily communicate with the application developed using .net/php in Linux operation system.

Understanding SOAP and REST

Web Services are mainly of 2 types, SOAP [Simple Object Access Protocol] and REST [Representational state transfer] based services. We have different type of specifications to implement SOAP and REST services. I believe so far you might be in confusion with these kind keywords like, JAX-RS, JAX-WS, RESTful, SOAP, Apache Axis2, Apache CXF bla bla…  Let me try to bring you out of them.

  • JAX-RS provides the implementation of RESTful web services,  JAX-RS is a specification for RESTful Web Services with Java and it is given by Sun.  Since it is a specification, other frameworks can be written to implement these specifications, and that includes Jersey from Oracle, Resteasy from Jboss, CXF from Apache bla bla.
  • JAX-WS, Apache Axis2 provides the implementation for SOAP
  • Apache CXF provides implementation for SOAP and RESTful services both.

RESTful

What ever the data/response we will get from the server is known as Resource [remember this point], Each resource can be accessed by its URI’s.  We can get the resource from RESTful service in different formats like, HTML,XML,JSON,TEXT,PDF and in the Image formats as well, but in real time we mainly we will prefer JSON.  REST guidelines always talks about stateless communication between client and the Server.  Stateless means, every single request from client to server will be considered as a fresh request. Because of this reason REST always prefers to choose HTTP as it a stateless protocol.


RESTful used 4 main HTTP methods…

  • GET – Retrieve Data
  • POST– Create/Insert Data
  • PUT– Update Data
  • DELETE– Delete Data

Generally we will prefer RESTful Services in these scenarios…

  • If clients require caching, means if you have limited bandwidth
  • If you want every thing to be stateless [ I have already explained about stateless ]

But SOAP gives the output only in XML format.   Hope you are good now 🙂 by the way we are going to use Jersey to implement JAX-RS specifications.

​ ​​

You Might Also Like

  ::. About the Author .::

Java4s_Author
Sivateja Kandula - Java/J2EE Full Stack Developer
Founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog, Love Java and UI frameworks.
You can sign-up for the Email Newsletter for your daily dose of Java tutorials.

Comments

24 Responses to “What is Web Services, Web Services Introduction”
  1. sunil says:

    In all these frameworks which frame work is more popular?

  2. Kalpana says:

    Hi,

    can you please add an article describing difference between Restful web services and Restless Web Services ?

  3. sriram says:

    This web site is very good for beginners…

  4. sarika says:

    This web site is very good..

  5. prashant says:

    This web site is not very good… Its AWESOME..!!

  6. Sandeep says:

    We want SOAP Web service also please provide that also

  7. Vanisha Singh says:

    This not complete tutorial on web services, So please include about SOAP also.

  8. Pradeep T says:

    Hi Sivateja,

    thanks for providing all the information about java technologies. mainly i am new to Web Services and learning easily from this site with your help. so can you please mail me some important basic Web Services tutorials for information if possible.

    thanks.

  9. Brajesh Pandey says:

    No Doubt This is speechless site I mean like for beginner like a bless…

  10. Koteswara Rao says:

    Nice explanation…

    Can you explain about SOAP based web service also..?

  11. Name_UnderConstruction says:

    Hello Sir,
    Your way of explanation is very good. kindly keep on growing with lots of new content on various technology.

  12. mansoor says:

    Hi Sir,

    Excellent Info about webservices and REST.Need coding implemantion example for this it will improve
    our understadings some more.

  13. tanweer says:

    can you please upload the same for SOAP

  14. Venkatesh says:

    Hi Sir,

    Can u please upload the maven,ant and few front end technologies because ur website very useful for me.its a nice explanation.

  15. Dhana Shekhar says:

    Hi Siva,

    Thank you for the wonderful posts.
    How is the Rest service being able to provide Caching facility?

    "If clients require caching, means if you have limited bandwidth"

    I have confusion in the above line as you said that the Rest is stateless.

    How is the caching achieved in REST.

    Can you please explain.

    Thanks.

  16. Anila says:

    Please explain about SOAP Web services too.

  17. phani says:

    Nicely explained thanks

  18. cherry says:

    Please provide SOAP webservices explanation too

  19. Mr.Hung says:

    This web site is very nice..

  20. Kavya says:

    its very good website for beginers it an excelent

  21. Kritika says:

    Supeerbbb explanation……..
    please please upload more tutorials regarding spring AOP, JavaScript,AngularJS

  22. Dikensh kumar says:

    You are too good in explanation bro. Thanks

  23. sandip says:

    This website is very good

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
Most Recent Posts from Top Categories
Spring Boot Hibernate Spring
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2024 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.