File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Webservice Mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservice Mapping" Watch "Webservice Mapping" New topic

Webservice Mapping

Dominik Müller
Ranch Hand

Joined: Apr 28, 2009
Posts: 36
Hi There,

i am very new to webservice stuff and i have a question about the java data mapping of called webservices.
The situation is: i have a wsdl file which i imported in to eclipse and generate all artifacts which seems necessary, invoking the webservice works fine, no problem.

Based on the wsdl file eclipse generates the webservice data structure of course, which isn't very suitable for the client i think.
So i have on the one side the webservice, with the generated data structures, which get filled if i call the webservice. On the other side i have my hand written objects.

What is the best practice to map incoming webservice structures to a custome data structure? I expected something like in JPA (Annotation Based Mapping), or do you write some glue code to map the two structures "by hand"?

Thanks a lot
Naren Mane

Joined: Mar 02, 2011
Posts: 16

Hi Dominik,

You can use Apache Axis2 to generate java classes(stubs) from a wsdl. This would be very simple and easy to understand if you're thinking of writing a client. Axis2 contains a tool called WSDL2JAVA which creates wsdl-mapped java classes (i.e. Stub).
Using this stub you can simply invoke service you want and then whatever response you get for that request, you can map that to bean you created.

Also this WSDL2JAVA tools provides various data binding option. Just visit "" . It will give you basic idea of using wsdl2java tool and some more info.It contains very useful info.

In my opinion this is very simple and easiest approach if you have a wsdl ready.
I agree. Here's the link:
subject: Webservice Mapping
It's not a secret anymore!