• Post Reply Bookmark Topic Watch Topic
  • New Topic

return an List with Objects

 
Nick Baerhalter
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • 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
    • Quote
    • Report post to moderator
    Thanks, I'm using an array now .
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!