aspose file tools*
The moose likes Web Services and the fly likes Clarification about Eclipse 3.4, Axis 2 and Tomcat 5.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Clarification about Eclipse 3.4, Axis 2 and Tomcat 5.5 " Watch "Clarification about Eclipse 3.4, Axis 2 and Tomcat 5.5 " New topic
Author

Clarification about Eclipse 3.4, Axis 2 and Tomcat 5.5

Christian Nicoll
Ranch Hand

Joined: Mar 09, 2008
Posts: 106
Hello Ranchers,

I've read about major webservice concepts and protocols (SOAP, WSDL) and i' ve build also some first webservices in eclipse with Axis 1 and 2. I 've had installed a Tomcat Application Server and to run webservices I've installed Apache Axis 2.

Eclipse supports the top-down and the botton-up processes to create webservices; there exists several wizard. If I start from a POJO and want to express this class as an webservice, then throught the specific wizard my webservice is created and deployed on Tomcat.

I've locked in my workspace to find the generated wsdl-file, but this file exists only on the server, and I've not found any local copy. Is this "works as designed"?

After the automatic creation of the specific webservice, my POJO looks still the same, there a no additional annotations. I've only found new files under the WEB-INF\services folder. Is this Axis specific, or exists there an specification ?

While searching for webservice-examples I've found also this snippet


I read that this snippet is JAX-WS, is this correct? How can I recognize it? All the examples which I used before were all simple POJO's or classes which I've created from an existing WSDL? Were they so JAX-RPC? This point is really unclear for me.

When I use an WSDL-File to create the specific Java Classes, then there are a lot of classes generated, like xyzCallbackHandler, xyzMessageRecieverInOut, xyzSkeleton, xyzSkeletonInterface, xyzStub? I don't 've read anything about them, and I'm asking myself "Does I really need them - I hope not ".

For the above snippet (MyWebService.java) I've found a another java-class which should be able to publish this Webserice:


The code which is commented is just another way to publish the service, both approaches don't work, or I'm not able to configure them correctly for my environment. If I execute the above code then I always get an (no 10) BindException, and no webserice is published on my server.



Does someone has an idea to solve this problem? If this would work, then I think that I don't need to deploy another EAR-file for this specific webservice. Is this assumption correct?

Looking for every answer and every comment.


SCJP 5, SCJD 5, SCWCD 5, SCBCD 5, SCJDWS 5
My SCBCD-Notes - My Hello World Webservice
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Christian Nicoll wrote:I've locked in my workspace to find the generated wsdl-file, but this file exists only on the server, and I've not found any local copy. Is this "works as designed"?
Yes. The web service stack can defer generation of the WSDL to deployment time.

After the automatic creation of the specific webservice, my POJO looks still the same, there a no additional annotations.
The annotations is the way you communicate your requirements to the web service stack in the same way as the annotations on EJBs or the web.xml deployment descriptor for servlets etc. In the days of JAX-RPC, it used to be an XML file and with JAX-WS you can still use XML deployment descriptors, either on their own or to override annotations.

I've only found new files under the WEB-INF\services folder. Is this Axis specific, or exists there an specification ?
Axis specific.

I read that this snippet is JAX-WS, is this correct? How can I recognize it?
The endpoint implementation class uses annotations. JAX-RPC does not use annotations but XML deployment descriptors, as before.

When I use an WSDL-File to create the specific Java Classes, then there are a lot of classes generated, like xyzCallbackHandler, xyzMessageRecieverInOut, xyzSkeleton, xyzSkeletonInterface, xyzStub? I don't 've read anything about them, and I'm asking myself "Does I really need them - I hope not ".

Yes you need them. With JAX-WS, the generated artifacts typically include JAXB bean classes to which XML data in requests and responses are bound, proxy and service classes which are used when sending requests to the service.

For the above snippet (MyWebService.java) I've found a another java-class which should be able to publish this Webserice:

The Endpoint class allows you to publish a service WITHOUT using a server, that is, the service will NOT be published in your server but in a standalone fashion.




You already have a server running that uses port 8080 and you try to start another server that also want to use port 8080.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Christian Nicoll
Ranch Hand

Joined: Mar 09, 2008
Posts: 106
Hello Ivan,

I want to thank you for your fast and well-founded answer. Further I find it quite incredible what you do for this Ranch, thanks a lot.

I tried to publish the Webservice with the Endpoint without an started server, but it receive several exceptions. I will investigate this problem first on my own, perhaps if I don't find the reason for those exceptions I'll then look for some help here.

Best regards,
Christian
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Check this article - dead-simple to use the Endpoint class! :-)
http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/

Further I find it quite incredible what you do for this Ranch, thanks a lot.

The pleasure is all mine - it is fun and interesting. I have learned a lot and constantly become reminded that there is always room for improvement.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Clarification about Eclipse 3.4, Axis 2 and Tomcat 5.5
 
Similar Threads
values changed, math didnt.
Developing Java 6 Webservice with Tomcat-project
Help making my BMI calculator more complex?
Stored Prodedure
Service for Asynchronous Client calls (polling, callback)