• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Webservice Mapping

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Dom
 
Greenhorn
Posts: 16
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 "http://axis.apache.org/axis2/java/core/docs/quickstartguide.html" . 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic