Get all updates of Java4s
Follow Us: Email Newsletter

What is Web Services, Web Services Introduction

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 Author ♦

Java4s_Author
sivateja@java4s.com
Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.

Comments

13 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

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful Links Current & UpComing Tutorials
Upcoming
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

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