• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

return an List with Objects

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I would like to build a Web Service, which returns a List with Objects. The operation of the Web Service looks like that:

The class Flight fullfills the java bean spezification:

I've testet the Web Service with Axis 2.0. I've inserted the beanMapping into the deployment descriptor (wsdd):

But the generated WSDL-File isn't correct. The datatype "Flight" is missing, the Array only contains Elements of the datatype "anyType":

Can anyone help me? If the return value is an flight-object, the WSDL-file is correct. The problem occurs only with the ArrayList. Thanks.
Bye,
Nick
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please review the JavaRanch Official policy on registered names.

If you search of this forum for "ArrayList", you will find many threads that are related to your problem.

In Summary:
  • A non-Generic ArrayList contains "Object"s which happen to be "Flight"s in your particular case. Java2WSDL quite correctly maps the "Object" datatype as "xsd:anyType" which is the XML Schema equivalent of a Java "Object".
  • WSDL has no idea what a Java ArrayList is. However Java2WSDL can convert an Array to WSDL. And if you use an Array of Flights instead of an Array of Objects you may start to see your Flights in the WSDL.
  • If you need that much fine control over your WSDL then you may want to consider designing the WSDL first and then use WSDL2Java to generate the clients stubs and the server skeleton.


  • [ February 22, 2006: Message edited by: Peer Reynders ]
     
    Nick Baerhalter
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks, I'm using an array now .
     
    and POOF! You're gone! But look, this tiny ad is still here:
    Free, earth friendly heat - from the CodeRanch trailboss
    https://www.kickstarter.com/projects/paulwheaton/free-heat
    reply
      Bookmark Topic Watch Topic
    • New Topic