开发者

Why are only some of my attributes shown in the response xml of jaxws?

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/">
   <soap:Body>
      <ns2:mynamespaceResponse xmlns:ns2="myn开发者_JAVA技巧amespace">
         <myObject>
            <attribute1>stringcontent</attribute1>
         </myObject>
             ....


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜