• 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

Creating a web service with Axis2 and wsdl2java / java2wsdl

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Axis2 comes with 2 handy tools: wsdl2java and its counterpart java2wsdl. The latter will take in an interface and generate the wsdl based on that. The former takes in the wsdl and generates the service aar file.

This is where I get lost. I can easily use both tools and they have the expected outcome. However, my application relies on libraries (the hibernate ones - some 10+ jars) and I believe these libraries need to be included in the service's aar?

So how do you do that? I saw the Eclipse Service Archiver but you can only add a lib one at a time. I'd really appreciate adding the libs through the wsdl2java call. Do I need to edit the newly generated build.xml's jar.server target?

Thanks,
David.
 
David Brossard
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems I wasn't clear but maybe it's due to my lack of understanding of how Axis2 works.

In the axis1 world, one would have a jar for the application one would expose as a web service. In that jar (or outside provided it was in the axis web-inf lib folder) there would also be the other libs needed (e.g. hibernate). All this at <u>serverside</u>.

Of course the client doesn't know about that and the web service client is a thin one sending out basic soap requests.

My assumption in Axis2 is that the aar I would expose in my Axis2 engine in Tomcat (for instance) would contain all the libs needed by the application exposed. Is this wrong?
 
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 David Brossard:
I'd really appreciate adding the libs through the wsdl2java call.


What confuses me is that you expect wsdl2java to have this capability. It clearly is only a code generator. And there is nothing in the WSDL or in the possible options that would tell it that you need the external jars (it doesn't need them to do its job anyway). It's clearly the responsibility of Service Archive Generator Wizard to add those libraries.

If you don't want to use the plugin then you can do it the old fashioned way as described in Packaging; create the entire directory structure, use wsdl2java to generate the java files, compile your source code and the generated code into the directories, copy all the necessary class and jar files (including the hibernate ones) into the directories, and then use the jar command, e.g.:

All of this should be easily accomplished with the appropriate ant tasks.
[ November 06, 2006: Message edited by: Peer Reynders ]
reply
    Bookmark Topic Watch Topic
  • New Topic