Forum Stats

  • 3,837,103 Users
  • 2,262,226 Discussions
  • 7,900,204 Comments

Discussions

add XML attribute

user1254328
user1254328 Member Posts: 856 Bronze Badge
edited Sep 25, 2017 10:30PM in Java Technology & XML

Hello,

we want to be able to add a type attribute as follows.

<soapenv:Envelope  xmlns:soapenv=    ...........................

  <soapenv:Header/>

<soapenv:Body>

   ................

.............

          <planNumberId  type="TIN">34343434</planNumberId>

.........

.........

</soapenv:Body>

</soapenv:Envelope>

we already have class that is good as follows ( ONLY how we make new addition type="TIN"  ?? . Easier way not to have additional class......). remember type is optional.

public class MyRecord {

     @XmlElement(required= true)

      private Integer  planNumberId;

     public void PlanNumberId(Integer  planNumberId) {

  this. planNumberId = planNumberId;

}

public Integer get PlanNumberId()   {

return  planNumberId;

}

Answers

This discussion has been closed.