2010-04-27 66 views
1

我创建了一个jaxws webservice,但它仅返回响应xml中的对象的一些属性。为什么只有我的一些属性显示在jaxws的响应xml中?

E.g.

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

    //getter and setter 
} 

,但返回的XML只包含

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
     <ns2:mynamespaceResponse xmlns:ns2="mynamespace"> 
     <myObject> 
      <attribute1>stringcontent</attribute1> 
     </myObject> 
      .... 

回答

1

属性,这些属性是空的XML不显示。 在该示例中,属性2为空,因此不会显示。

相关问题