java - How to retrieve the values from the service which is returning List<Object> using jax-ws -


i have service returns list, object varies depends on different scenario.

can suggest me jax-ws support behaviour or have alternative option.

since jax-ws use jaxb serializate objects, jaxb need know name of type marshall or unmarshall. in standalone environment can deal kind of things. however, when dealing list of objects, becomes more complicated.

moreover, each data type must defined in wsdl. service client must able convert response xml data type desired.

if wish return different lists of different type, simplest use wrapper response. e.g.

public class responsewrapper {     private list<audio> audios;     private list<video> videos;      // setters , getters }  @webservice public class mediastore {      @inject     audioservice audioservice;     @inject     videoservice videoservice;      @webmethod     public responsewrapper getcollections(string artistid) {         responsewrapper response = new responsewrapper();         response.setaudios(audioservice.getaudios(artistid));         response.setaudios(videoservice.getvideos(artistid));         return response;     } } 

another way work directly soap messages, avoid doing so.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -