Is logical, in the method: (see my comments)

 public MyItem getItem(){
   MyItem i = new MyItem(); //You have built an Item with an empty "message"
atributte.
 
   return i;
}

You are not setting any value to the MyItem object. You have forgotten to
set a value. Just add the i.set("value") line:

public MyItem getItem(){
   MyItem i = new MyItem(); //You have built an Item with an empty "message"
atributte.
i.set("value");
 
   return i;
}

And the you will get in your client the "value" String. Ok?


-----Mensaje original-----
De: dpeinador [mailto:[email protected]] 
Enviado el: viernes, 23 de octubre de 2009 14:11
Para: [email protected]
Asunto: Axis2 Problem


Hello all, 

I am having a problem with Axis2. I have done some tests and I can not
advance. All the inner attributes of the objects I receive are null.

In the server side I have a simple class:

public class MyItem implements Serializable {
        private static final long serialVersionUID = 1L;
        
        String message;
        
        public ListItemArray() {
                message = "Test";
        }
        
        public String getMsg() {
                return message;
        }
        public void setMsg(String message) {
                this.message = message;
        }
}

And a method:

public MyItem getItem(){
   MyItem i = new MyItem();
   return i;
}

In the client size I have an stub like:

   WSStub customer = null;
   WSStub.GetItemResponse response = null;
                 
   try {
        // creamos el soporte y la peticion
        customer = new WSStub (sEndPoint);

        // invocamos al web service
        try {
                response = customer.getItem();
        } catch (Exception e) {
                e.printStackTrace();
        }

   MyItem i = response.get_return();

And inside the MyItem object, the message field is null. I have tried to
return a String and it is ok.

Can anyone help me?
-- 
View this message in context:
http://www.nabble.com/Axis2-Problem-tp26025185p26025185.html
Sent from the Axis - User mailing list archive at Nabble.com.


Reply via email to