1 Reply Latest reply on Jul 5, 2007 6:35 AM by Chris Hembrow

    JBoss 4.2.0 web service not exposing getters

    Chris Hembrow Newbie

      Hi,

      I have what I hope is a fairly simple problem, and I suspect I am just missing something obvious. I have a web service with a method which returns a POJO containing Strings, longs and booleans. I can access the variables directly if I set @XmlAccessorType(XmlAccessType.FIELD), but I can't get the service to expose the getters. Is this possible, as I want some logic in the getters.

      Web Service

      @Stateless
      @WebContext(contextRoot="/web-services", secureWSDLAccess=false)
      @WebService(name="MobileUpdate", serviceName = "MobileUpdate")
      @SOAPBinding(style = SOAPBinding.Style.RPC)
      public class MobileUpdateService {
       @WebMethod
       public MobileConfigResponse getConfig( String msisdn ) {
       return new MobileConfigAction().act( msisdn );
       }
      }
      


      Returned POJOs
      @XmlAccessorType(XmlAccessType.FIELD)
      public class MobileConfigResponse {
      
       protected String[] errors;
       protected String config;
       protected long id;
      
       MobileConfigResponse() {}
      
       public MobileConfigResponse( String[] _errors, String _config, long _id ) {
       errors = _errors;
       config = _config;
       id = _id;
       }
      
       public String[] getErrors){
       return errors;
       }
      
       public boolean isError() {
       return errors != null && errors.length > 0
       }
      
       public String getConfig() {
       return config;
       }
      
       public long getId() {
       return id;
       }
      
      }