• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Beginning Web Services

 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am very new to Web Services, please my questions may be silly. So far I have programmed only in J2SE and never in J2EE. I have a project that I'm gonna do in which I have to use Web Services.

There are a few services published and I have the WSDL documents of them. Now I must access these web services (I have to write a client to these published web services).

And in the other part of my project I have to write a few Web Services on my own and publish it for others to use. I am the only developer in my project and I have to make my own decisions in whatever I do. Here are my questions:-

1) How much time it may take to learn and write a Web Service client?
(This part of the project I must do quickly)
2) To publish my own web services, do I require a Container?
(I'll prefer it without a container if there is a choice, because I may have to manage the deployment of the container (like DD, Security) and I have not worked on this ever before and I am the only one in the project)
3) How much time it may take for someone like me to gain good knowledge that I can write and publish my own Web Services?
4) Any good books on Web Services in Java that you would recommend?

Thanks a lot,
Srikanth
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1) How much time it may take to learn and write a Web Service client?


Given the WSDL, it takes very little time to create a working client, since most WS engine come with tools that will generate the necessary Java classes for you (e.g., Axis comes with a tool called 'wsdl2java'). You won't have learned much by using the tool, but you'll have a working client.

2) To publish my own web services, do I require a Container?


Yes, but popular implementations like Axis come in the shape of a web application, which can be deployed in any servlet engine (or even as part of an existing web app).

3) How much time it may take for someone like me to gain good knowledge that I can write and publish my own Web Services?


Again, you can be up and running with publishing WS very quickly; the process isn't difficult. There'll be a number of things you need to learn eventually, though, and those will come only with experience.

4) Any good books on Web Services in Java that you would recommend?


The WebServicesLinks page lists a number of books. The last in the list (SOA - Using Java Web Services) was just discussed in this forum last week with the author answering questions.

You may also want to peruse the WebServicesFaq, which contains links to a number of introductory articles and other relevant material.
[ June 11, 2007: Message edited by: Ulf Dittmer ]
 
Srikanth Raghavan
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf.

Which version of Apache Axis is recommended to use? I see a lot of books written for the previous versions of Axis? Should I download Axis 1.2 or Axis 2?

-- Srikanth
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have no legacy code, then you should use Axis2. It implements the JAX-WS API instead of the obsolete JAX-RPC, amongst other benefits.
 
Srikanth Raghavan
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ulf!

Installing Axis2 within tomcat 5 but having some problems. Troubleshooting it... Trying to get it up...

Thanks
-- Srikanth
 
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does this means that a pojo/ejb can be created from a WSDL which acts a webservice ?


Given the WSDL, it takes very little time to create a working client, since most WS engine come with tools that will generate the necessary Java classes for you (e.g., Axis comes with a tool called 'wsdl2java'). You won't have learned much by using the tool, but you'll have a working client.


[ June 11, 2007: Message edited by: Raghav Mathur ]
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Raghav Mathur:
Does this means that a pojo/ejb can be created from a WSDL which acts a webservice ?



  • POJO - Plain Old Java Object. As most of the code generated by the WSDL2Java tool depends heavily on the underlying libraries of the web services framework/SOAP Stack - so most of these objects do not classify as POJOS.
  • EJB - I'm not aware that there are tools that create EJBs from WSDLs - also I would question their overall utility if they did exist. Some container vendors will let you expose an SLSB as a web service - that is part of the J2EE specification. However not every SLSB is a good candidate for being exposed as a web service (the minority would be).

  • However the tool can generate an object-based interface (in the broader sense) for you. However you need to understand that the WSDL describes the request messages that the web service accepts and the response messages that the web service replies with. The messages are purely a "data layout". Objects have behavior in addition to their state (data). There is no description of "behavior" in the WSDL. Also a web service isn't a remote object that provides remote/distributed "object behavior" for you - a good web service is an entire service application that can encapsulate entire business processes. The object representation of the data that is exchanged between the client and the service will often be different on both sides - this is why document oriented web services usually have a separate binding layer that lets you declaratively or programmatically configure how your objects are marshalled to the outgoing XML documents and how incoming XML documents are unmarshalled to your objects.
     
    Raghav Mathur
    Ranch Hand
    Posts: 641
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Peer -

    When and how does the WSDL come into picture. I understand that there are tools available to transform the contract into client object like xmlbeans as ulf mentioned.

    What other purpose the WSDL have?
    How does a web service and client abide by the contract/wsdl?
    What if we do not have a wsdl in place?
     
    Ulf Dittmer
    Rancher
    Posts: 43081
    77
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Raghav Mathur:
    When and how does the WSDL come into picture. I understand that there are tools available to transform the contract into client object like xmlbeans as ulf mentioned.

    What other purpose the WSDL have?
    How does a web service and client abide by the contract/wsdl?
    What if we do not have a wsdl in place?



    XMLBeans does something completely different than the tools I mentioned (which was Axis' wsdl2java and similar tools).

    A WS naturally conforms to the WSDL it exposes. A client conforms to the WSDL by using it to access the WS (or to generate the classes accessing the WS).

    A WSDL description is not necessary to use a WS, but quite helpful.
     
    Peer Reynders
    Bartender
    Posts: 2968
    6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Raghav Mathur:
    When and how does the WSDL come into picture.


    The WSDL (Web Services Description Language) file describes the messaging interface (interface in the general sense) of the web service. It is an interface description.

    I understand that there are tools available to transform the contract into client object


    A tool like WSDL2Java creates an object-based representation, an API if you will, of the messaging interface described in the WSDL.

    What other purpose the WSDL have?


    What other purpose does it need? Its an interface description which can also bind the defined endpoints to URLs.

    How does a web service and client abide by the contract/wsdl?


    Not really sure what you are asking here. The web service will only serve requests that comply with the indicated message definitions in the associated WSDL.

    What if we do not have a wsdl in place?


    Then you must take an alternate route for communicating the web services interface. In that case WSDL2Java tools cannot help you unless you create a WSDL from the information that you have. However if the Web Service cannot be described in WSDL you'll most likely end up writing all the code for creating requests and parsing responses yourself.
     
    Ranch Hand
    Posts: 508
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Ulf Dittmer:
    If you have no legacy code, then you should use Axis2. It implements the JAX-WS API instead of the obsolete JAX-RPC, amongst other benefits.



    The article "Introducing Axis 2, the Next Generation of the Apache Web Service Stack" located at
    http://www.developer.com/services/article.php/3525481
    says on page 2 "Axis gained its current stable state over a long period of time. It will take time until Axis 2 enjoy the same."

    The author makes it sound like Axis 2 is not stable yet. However, the author also only seems to raise the flag of caution in the context of migration.

    Now looking at http://ws.apache.org/axis2/download.cgi we see 2 years of releases have happened.

    Is it soup yet? Is it stable or not?
     
    Ulf Dittmer
    Rancher
    Posts: 43081
    77
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    The author makes it sound like Axis 2 is not stable yet.


    The article doesn't have a date on it, but anything "introducing axis2" would have to be a couple of years old. I'd say that by now, yes, Axis 2 is stable, and its built-in support for JAX-WS and WS-Security make it much to be preferred over Axis 1. Can't speak about performance, but that, too, is supposed to be improved.
     
    Michael Finney
    Ranch Hand
    Posts: 508
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks!
     
    And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic