Web Service Introduction Tutorial

Web service is a system that enables applications to communicate with an API. Web service helps to expose business logic through an API interface where different systems communicate over network. At higher level there are two parties involved, party providing the service is web service provider and the one utilizing it is web service consumer. In a previous hello world tutorial for web service we discussed about creating a service based on soap using Netbeans. This micro tutorial will help understand some important jargon related to web services. In near future we will see tutorials based on Eclipse to create web services.

Web Service

Generally,

Components of a Web Service

This is to highlight some of the important jargons related to web services.

wsdl

Web Services Description Language (WSDL) is used to describe a web service in an XML file. It covers all the aspects of a web service like what is the message format, communication protocol, endpoint, security etc. This is a standard provided by W3C consortium and widely accepted for web services description.

A wsdl xml file for a web service is generally expected to be published publicly so that parties seeking to utilize its services can understand the nature of service and consume it accordingly.

Types

Types is an important element in WSDL. It is used to describe the message attributes and respective types. XSD is the preferred format to describe the types. Type definition can be given in a separate XSD file and imported in WSDL.

<definitions .... >
    <types>
        <xsd:schema .... />*
    </types>
</definitions>

UDDI

Universal Description, Discovery and Integration (UDDI) is a directory service. Web services can register with a UDDI and make themselves available through it for discovery. It is like a marriage broker :-) People ready to get married will describe themselves in a standard format (WSDL) and register with this directory. People seeking pair will approach this directory and discover based on the information provided and approach.

Stub and Skeleton

Stub and skeleton are counterparts in a web service setup. Skeleton belongs to service provider side and stub belongs to receiver side. At lower level stub and skeleton communicate with each other. From client side the business objects communicates with stub objects and stub takes the responsibility form the message and invoke the web service. Once the invoking is done, at service provider side, skeleton is the parallel object for stub and it receives the request message and understands it and passes on the information to service side business objects.

Endpoint

An endpoint is a particular network location with associated protocol which includes message format mapping using which we can access that instance of web service. This is described in WSDL file. Consider this as a handle using which we will access the web service.

Binding

Associating an interface with a protocol and message format is binding. It is used in endpoint definition. Binding is described in WSDL.

Operation

A single logical grouping of a meaningful action which comprises a request and response is an operation. Group of operations forms a web service.

SOAP

Simple Object Access Protocol is a XML based specification for web services message format and communication over network. That is it helps to describe the transport method and message format in a web service.

Message

Data that is used to communicate to and fro with a web service is a message. It is a standalone entity which comprises of complete information for a request or a response.

Web Service Design

As given in diagram a web service has logic and an interface. Logic is the actual service provided and interface is used to communicate with the web service. Interface definition is given in WSDL. There are two approaches in implementing a web service and they are bottom-up and top-down.

Bottom Up Approach

Bottom up approach is where we first define the logic of a web service and then using that we will build the interface. Service code is written first and then the WSDL is created using the service code. There are tools available to generate the wsdl file automatically based on it.

Top Down Approach

Top down is the reverse of bottom up approach. First the service definition is written up. WSDL is created first. The complete service definition, message format, transport protocol, security and everything is described in WSDL. Then service is written after the WSDL. Using that wsdl the skeleton code is generated automatically and after that the service code is filled up.

This Web Service tutorial was added on 06/10/2012.

Comments on "Web Service Introduction Tutorial" Tutorial:

  1. Waseem says:

    loved it

  2. Geetha says:

    Simple and best. Only you can do it. Thanks Joe.

  3. Bhushan says:

    :)

  4. SUNIL KUMAR says:

    Awesome post :)

  5. Anonymous says:

    Great article joe. need continuous tutorials on webservices.

  6. Anonymous says:

    Great article joe. need continuous tutorials on web services.

  7. Ram says:

    Thanks Joe for shared such informative topics.. Could you plz hello world app of web services using eclipse.

  8. Akash says:

    Good Morning Sir, Myself Akash Goswami, I am graduate fresher and i usually do web development..Sir, I have a question that suppose i have a web application and i want that web application, that it should communicate with other web application.For Eg: i have a post sending text box in my web application and i want that whenever i click on a post button then that post should be posted on my facebook wall. Sir kindly help me out. Thank You

  9. subrat says:

    Nice one!!!

  10. vikas says:

    You rock. Please come up with eclipse webservice.

  11. LEO says:

    example given for UDDI was excellent..

  12. Bhushan says:

    Nice theory but Can you give example wise demo like sample WSDL and then corelate Java file with WSDL to state what is in WSDL that is converted to JAVA

  13. Ashish says:

    Pls provide a example of wsdl with eclipse

  14. Hari Kumar says:

    Joe,
    Your tutorial is great and inspiration for the people learning about web services. Could you please tell us the best books to learn web services and for completion of Web Services developer exam ?

  15. Syed says:

    Nice article on webservice..

  16. Giri Kanchukota says:

    Thanks,
    I liked it very much.
    Please provide continuous tutorials on webservices

  17. Sheela says:

    nice post..waiting for practical implementation..!!

  18. Ragupathirajan says:

    Please consider this as separate chapter and provide continuous tutorials on webservices step by step, so that any one can follow.

    Thanks
    Ragu

  19. Anonymous says:

    niclemy explained

  20. Bhushan says:

    nice !!!!!!!!!!11
    Waiting for web-services with eclipse !!!!!!!1

  21. Anonymous says:

    Nice artical Joe. its better to have a good example to create stup and skeleton.
    By Mathi on 10th Oct 2012.

  22. Mathi says:

    Nice artical Joe. its better to have a good example to create stup and skeleton.

  23. saidulu says:

    Very Good Tutorial Sir, I am new to webservices, so please explain using sample examples..
    Thank you

  24. amit singh says:

    Joe ,simply impressed by your tutorial

  25. phani says:

    Hi Joe,

    Your articles are so nice and easy to understand the basic concepts.
    Could you please post a article on Application servers and web servers how they work

  26. Prashant says:

    Thank you very much Joe. Your tutorials are as simple as java. Well explained!

  27. Roop Vijay Singh says:

    well explained.

  28. sravani says:

    Nice article.Please provide the examples…

  29. Justin Ji says:

    Thank you Joe. your tutorials are very nice. And they’re helpful for me. I’m going to have an interview with Wipro in Korea. Wish me luck. I’m so happy that I found your web site. Thank you again.

  30. Anonymous says:

    could u please send me the whole web service tutorial

  31. madhu says:

    could u please send me the whole web service tutorial

  32. Akhil says:

    Hi Joe,
    Your articles are simple and easy to understand.Can u explain how to generate stub and skeleton.

  33. aesha says:

    I am big fan of this website. I prepare all my Java and related stuff for any interviews through this site. This is like single source which I go through and finish up my java revision in less time. Keep it up Joe , you do awesome work !!!!!!

  34. Sunil Gupta says:

    explanation of the topics are flawless and simple….

  35. Srinivsa says:

    its good to understand web services. You did really nice job.

  36. faizan says:

    very good !!!!!!

  37. REST vs SOAP says:

    […] SOAP based web services can be implemented in RESTful style. REST is a concept that does not tie with any […]

  38. Atiq@ says:

    Hey joe,

    Can u please tell the process to develop a simple webservice using java source code 1.4…?Thanks in advance…

  39. […] I have been writing introductory tutorials about web services in Java. We saw about SOAP based hello world web services and how to create them using Eclipse and […]

  40. Anonymous says:

    Nice one. Thanks.

    Could you please share the scenario when will we go for Top-Down and when will we go for Bottom-Up approach.

  41. Amit says:

    Hi Joe,

    Could you please park this post as well as the one related to Axis under a new category named Web Services. It’ll be really helpful for readers to find related stuff.

  42. Joe says:

    Sure Amit. Thanks for the suggestion. Will do it.

  43. Joe says:

    Sure Giri. Will write on it more.

  44. Divya says:

    Thanks for the wonderful tutorial.. Please keep us updating about more on web services.

  45. Lakshmi says:

    Excellent Joe, thanks for the wonderful stuff.

  46. Tuhin says:

    I’m a regular visitor of Joe’s blog as I’m his great fan. So when I decided to learn Web Service I just searched here and got the solution in Joe’s way. Joe…you simply rocks…

  47. Joe says:

    Welcome Tuhin. You will get lot more on web services soon.

  48. Anonymous says:

    Just awesome explaination

  49. Avinash says:

    Hi Joe,
    What I understood from this article is that Stub would actually convert the client object to XML format which would then be read by Skeleton and then converted to suitable object as needed by the external system. And the reverse procedure happens while obtaining the response. Is this correct?

  50. vishal says:

    The article is really nice and very easy to understand

  51. john says:

    thank you so much.this article is very help full and every one can easily understandable

  52. Aditya says:

    I am fan of your tutorial.. Thanks a lot. Please update time to time.

  53. RajaNaresh says:

    Joe articles are always like a jolly articles … Love to Read , Like to learn

  54. Anonymous says:

    Content is superb!!!

  55. Anonymous says:

    Nice .. Can be elaborate using simple examples..

  56. Vedprakash says:

    Thank you very much the blog. it’s a very helpful and easy to understand.

  57. Anonymous says:

    Hint: Google about Facebook APIs.

  58. Naresh says:

    Hi,

    Could you provide different types of wsdls and their differences.

    Thanks,
    Naresh

  59. shahid says:

    very nice tutorial on web services really apreciatable

  60. sumit kumar says:

    good one sir..keep continue ..

  61. Raja Raja says:

    Nice Tutorial. want to learn more on web service and over all all the frameworks. (Like Spring, Struts..)

  62. Raja says:

    How to subscripe your bolg? (javapapers.com)

  63. Dilip says:

    Awesome Joe.. Loved it.
    Thanks alot for such a lovely tutorial :)

  64. bramhisoft says:

    Its looking simple 2 learn & Understand.. But if u give implementations for those topics through source code,then it’ll helpful for the people to get complete development knowledge… I hope u will

  65. joe says:

    good

  66. chintan says:

    very simple Joe! Love it .

  67. N P Nagendra Rao says:

    I followed your lot of concepts. Excellent description is given with simple and easily understandable. Thanks

  68. Anonymous says:

    sir, could u plz changer ur photo.

  69. Madhuri says:

    UDDI,Stub and Skeleton,Bottom Up Approach,Top Down Approach explanation are very nice..

  70. sukirti says:

    Good One :)

  71. Anonymous says:

    simple language.. and gr8 stuff…
    gr8 wrk.. keep it up

  72. Anonymous says:

    Gr8 work…

  73. Pasha says:

    I am begginer in java advance technology. can you please show how this can be performed using eclipse IDE.

  74. Lalita says:

    Can you please provide example based on this tutorial ….

  75. Hemant says:

    Simple and informative.

  76. shravani says:

    great tutorial

  77. Gunjesh Kumar says:

    This is the first time I have visited your website. I must say, it looks really beautiful. Very well designed.
    If you can include a few examples on web services here, it will be very good for the beginners.

  78. Ahmedou says:

    waw awesome explaination thanks

  79. Anonymous says:

    After my 9 years of IT experience I have oncluded that “Noting More Than Joe”

    I want to be in touch Joe.

  80. Anonymous says:

    Nothing More Than Joe’s Site

    Regards
    Ranjan

  81. Anonymous says:

    excellent

  82. Sagar mali says:

    good explanation..

  83. […] and bottom-up approach. To know about these approaches and in general about web service refer my introduction to web service tutorial posted earlier. We will be using bottom-up development approach in this […]

  84. Radhika says:

    Joe ,simply superb

  85. Kotesh Bhupathi says:

    Hi joe ..Nice explanation on web service with layman terms and currently i am working in big mnc and my app is very much rely on webservices can u please elaborate top down and bottom up with a good example.

    Thanks
    Kotesh

  86. jp says:

    Good one for introduction. If you can give more details on different types of web services, it will be more useful.

    thanks for this article.

  87. venky says:

    At higher level there are two parties involved, party providing the service is web service provider and the one utilizing it is web service consumer, can i have example for this?

    currently i got a project based on webservices , which has two parties involved as you said in this blog , thanks in advance

  88. realcoment says:

    is that all above the real user ?

    anyway thanks for the tutorial.. it’s nice :D

  89. yashwant says:

    Hey Joe !! Great Job yaar !! It really helps

  90. Raghavender Reddy says:

    Required with Example on webservice with Struts application how intract.

  91. Anonymous says:

    ssdsadsads

  92. sameer says:

    Very Good ….

  93. kanhu bhol says:

    Mr. Joe

    you did the best work . its a simple and very good tutorial

  94. elahe says:

    thank u joe.that is very simple and usefull tutorial.thanks

  95. Sathya says:

    Though myself experienced resource in support projects. Have keen interest in learning Java technologies. Would you find some time to explain the below components in detail created as part of this Web service creation. This will help to understand in deeper level in this regard.

    AnimalTypeServiceProxy
    AnimalTypeServiceService
    AnimalTypeServiceServiceLocator
    AnimalTypeServiceSoapBindingStub

  96. Anonymous says:

    +9

  97. fawad khaliq says:

    so nice article.. i am excited and gonna read all of the next and previous articles..

  98. Anonymous says:

    joe sir pls explain execution flow of webservice

  99. phani says:

    joe sir pls explain execution flow of webservice

  100. jayasiri says:

    Thanks for the very helpful tutorial on Web Services.

  101. sureshkumar says:

    this tutorial is very useful to understand the webservice and its functionality for the java beginners

  102. Sourabh says:

    Nice one really useful for beginners to give a brief idea on working of web service

  103. Renu says:

    thankz joe..im new to webservice d im vry confusing abt tat nw i clear abt this concept really thankz

  104. Vikas says:

    Very Neat

  105. Manuel says:

    Hi Joe,

    It will be great if you explain the above context with a sample syntax

  106. rahul dixit says:

    thanxx…………….

  107. Umapathy Ravichandiran says:

    i think of a web service in UDDI is like a service ad in yellow pages rather than marriage broker stuff…

  108. Krishna says:

    I loved the way you explain and the way in which u have set up the website.

    Can you please write a tutorial on how you set up your website, will help others as well

  109. Smith says:

    Thanks a lot for this contribution! It’s been very useful for me. Everything is very open and represents very clear explanation of issues.

  110. Sony says:

    Nice article..

  111. Anonymous says:

    Very Good Tutorial Thanks

  112. Shankar says:

    Its very use full and Great!!!!!!

  113. MrPink says:

    Thank you soo much!. It is simple but really helpful for begginers like me. :)

  114. Anonymous says:

    good

  115. Anonymous says:

    thanks joe

  116. Vaibhav Kumar says:

    Nice post… Explained everything in simple words.

  117. Mohammad Najar says:

    I just wanted to thank you for taking the effort in putting these essential tutorials together. Very clean, clear, and simple. Please put on more tutorials. My suggestion would be Apache CXF for web services. Thank you

  118. shahrad says:

    very usefull; :-)

Comments are closed for this "Web Service Introduction Tutorial" tutorial.