Re: Java Webservices - newbie question.....
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
2. To create a web services, (I am thinking of the .net web services
that i have done - that once you deploy it with IIS, and you browse to
that service, if the function takes 2 parameter, there will be 2
textboxes waiting for you to put data to, then once you post - the xml
response will come back...), does java allow front end interface
automatically like that in .net? Or you have to code the JSP pages to
include those textboxes yourself, and do a manual post to the web
services address?
Web services are by definition something that is called by programs
not browsers.
..NET has this nice little test feature. I do not belive Axis
offers that service.
You do not do a manual post - you let Axis generate a stub
and call that.
3. Are there any book out there, explains how to use tomcat for
webservices? I have looked thru some of the java books that talks about
web services, they mainly explain what webservices are, what is
xml..etc... and of course, they did talk about the differenct type of
messaging format available. (JAX-RPC..etc..)
Axis comes with docs about how to use it.
4. In the java world - how do you use webservices? Is it the same way
that i am familiar with? Like, that we have a front end gui, that it
will call the web services, pass it a few param, and get the xml result
back, and parse it and display / store.. it? Or that is not the correct
way to consume the web services in java world?
Using web services in java and .NET is more or less the same.
You deploy your web service code. The container generates all
the extra stuff on the server side. For the client side you generate
a stub and call that.
Neither in Java or .NET you usuall parse the SOAP XML yourself.
5. In .net - as long as i have the .net framework sdk, and a IIS - i am
good to go. In java - what do i need in order to deploy a web
services?? I already have tomcat / jdk / wsdp / IDE - do i have enough
to create a simple ws? if so, can you show me a basic tutorial??
You need:
* JDK (to compile your code and run Tomcat)
* Tomcat (or another servlet container)
* Axis (either to deploy as a the axis web app or to grab pieces and
deploy as your own web app)
IDE is optional.
JWSDP is an alternative to Axis.
based on some reading, i understand that the ws on the service side,
needs an SEI implementing java.rmi.remote, and we need another class
implementing this SEI. But I would really want to see more example, or
downloads, where i can just download / view the whole thing all at
once... I googled "java web service", "jax-rpc example"..etc.. most of
the return links are from either java.sun.com, or ibm, or some other
vendor's web site, explaining the architecture... I really want to look
at the code, to get a better understand, what is the relationship
between each of these softwares (tomcat, apache http server, axis...)
You do not need to think about all that. You just write your web service
logic and deploy it.
The Axis guide do have examples.
Arne