views:

25

answers:

1

I created a jaxws webservice, but it returns only some of the attributes of my objects in the response xml.

E.g.

public class MyObject {
   private String attribute1;
   private String attribute2;

   //getter and setter
}

But the returned XML only contains

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
   <soap:Body>
      <ns2:mynamespaceResponse xmlns:ns2="mynamespace">
         <myObject>
            <attribute1>stringcontent</attribute1>
         </myObject>
             ....
+1  A: 

Attributes which are null are not shown in the XML. In the example, attribute 2 is null, and therefore it's not shown.

Andreas