xml - JAX-WS client-side Java Soap send a Jav List of the client to the server (lack of generation in list.add JAXB) -


i have soap service sending following values:

@xmlrootelement(name = "person") @xmltype(proporder = {"id","name","address", "telephones", "telephone2", "durations", "langage"}) @xmlaccessortype(xmlaccesstype.field) public class person {      @xmlelement(required=true)     public uuid id;     //public list<uuid> listid;     private string name;     private string address;      @xmljavatypeadapter(durationadapter.class)     @xmlelement(name="duration")     private java.time.duration durations;      @xmlelementwrapper(name="telephones", nillable=true)     @xmlelement(name="telephone", required=true, type=telephone.class)     public list<telephone> telephones;       private telephone telephone2;     private langage langage;  //getter setter 

example xml : s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <ns2:getpersonsresponse xmlns:ns2="http://soa.jaxwslabs.notebookwebserviceexercice6"> <return> <name>mickael baron</name> <address>migne-auxances</address> <telephones> <telephone> <codecountry>+1</codecountry> <coderegional>514</coderegional> <number>571-1289</number> </telephone> <telephone> <codecountry>+213</codecountry> <coderegional>514</coderegional> <number>999-2609</number> </telephone> <telephone> <codecountry>+33</codecountry> <coderegional>489</coderegional> <number>777-8888</number> </telephone> </telephones> <duration>pt2s</duration> <langage>java</langage> </return> ....

in code want add phones (list ) has person object, newperson.settelephones (.....); takes set jaxbelement ??? not voice how setter list ?

more information : in jax-ws customer when pojo class generated (with wsdl definition of server service) have definition of person class in form:

public class person {      @xmlelement(required = true)     protected string id;     protected string name;     protected string address;  /* ******* */     @xmlelementref(name = "telephones", type = jaxbelement.class)     protected jaxbelement<person.telephones> telephones; /* ******* */      protected telephone telephone2;     protected string duration;     protected langage langage;  ....      /**      * gets value of telephones property.      *       * @return      *     possible object      *     {@link jaxbelement }{@code <}{@link person.telephones }{@code >}      *           */     public jaxbelement<person.telephones> gettelephones() {         return telephones;     }      /**      * sets value of telephones property.      *       * @param value      *     allowed object      *     {@link jaxbelement }{@code <}{@link person.telephones }{@code >}      *           */     public void settelephones(jaxbelement<person.telephones> value) {         this.telephones = value;     }  ... //setter getter 

it not therefore allow me @ do: telephone = new telephone(); telephone.setcodecountry("+1"); telephone.setcoderegional("514"); telephone.setnumber("989-2789"); telephones.add(telephone);

the objects not same pojo dimension jax-ws server. bit beyond generation problems of list ?? (automatically generated jaxb think causes problems)


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -