• 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

Clarification about Eclipse 3.4, Axis 2 and Tomcat 5.5

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Christian Nicoll
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
reply
    Bookmark Topic Watch Topic
  • New Topic