Re: Java Webservices - newbie question.....
yekasi@gmail.com wrote:
Arne Vajh?j wrote:
yekasi@gmail.com wrote:
1. I am confused that how come tomcat itself is already a webserver,
why would people use it on top of apache http server, which is another
web server?
Apache HTTPD in front of Tomcat is not needed but sometimes
preferred.
Examples of reasons:
- serving non JSP content like PHP
- load balancing over multiple Tomcat
- usage of hardware SSL accelerator
What are come reasons that you will need multiple of Tomcat? Doesnt
tomcat allow you to deploy multiple servlet / applications?
Load balancing over Tomcat's running on multiple physical boxes
to achieve redundancy and horizontal scalability.
Say, i developed a few web services, which are some basic arithmetic
addition / subtraction / mul / div..etc.. Say another developer wants
to call my ws, but he would like to see what is available for him to
use... I used to just give the other developer the link to the ws, and
he will see all methods available via the "browser test page". In java
world, what do you do when situations like that happen if the developer
wants to see it first, before any coding on his end??
Tell him to generate a stub and look at the code.
Or read the WSDL if he is hardcore.
Am I right on this - that java ws must be deployed in a servlet
container? So, does that mean, java ws is a servlet itself?
A web service need a permanent running server accepting HTTP requests.
I am not aware of any Java web service toolkit that does not
use a servlet.
No your web service is not a servlet. There are an Axis servlet
that dispatches to your web services.
> I followed
some tutorial in netbeans IDE 5.0 - which is to create a web services
and deploy it as servlet, but his example was using a sun app server. I
followed everything, except that I am using tomcat instead of sun app
server... when I try to run the ws - it complained that my class is not
a servlet. But in the code, there was nothing about inheriting anything
servlet class, it just implements the SEI, and java.rmi.remote... So
the webapp would not start..
Follow the Axis guide. Start with .jws file and go on to deploying
with .wsdd files.
A few more questions...
1. apache soap - based on some reading, it is also some package that
allow you to develop ws. Is that just the same thing as an alternative
from using JWSDP, Axis...?
Apache SOAP is Axis version 0. Or Axis has replaced Apache SOAP.
2. WSDL - let say i am NOT using axis (i know axis comes with java2wsdl
and vice versa), are you suppose to write the wsdl yourself? Or the
container / IDE is capable generating that as well? If so, which one
will do it, and how do you generate the wsdl?
I use Axis to generate WSDL. The .NET runtime generate the WSDL.
I would not use a web service toolkit that does not generate the WSDL.
(and you do not use java2wsdl with Axis - you let the Axis runtime
generate it)
Arne