axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepal Jayasinghe <dee...@opensource.lk>
Subject Re: returned object constructor issue
Date Thu, 19 Jul 2007 16:13:11 GMT
Hi albert ,
For a Java bean it is required to have the default constructor, it is ok
to overload but do not remove the default constructor.

Thanks
Deepal
>  Hi again !! :
>
>  I finally do it work!!. I've find what was the problem reported in
> my last post, but i don't know if there is a bug in Axis 2 or if that
> is the expected behaviour, so I post again to explain it and with hope
> that my experience could be helpful for any newbie who has to face the
> same problem.
>
>  I've a very simple test POJO web service returning a class named
> External :
>
> package org.testing.data;
>
> public class External {
>
>     private String exMessage = null;
>     private boolean error = false;   
>                private Internal internal = null;
>
>     public External(String exMessage, boolean error, Internal internal) {
>         this.exMessage = exMessage;
>         this.error = error;
>         this.internal = internal;
>     }
>     
>  // getters and setters...
>     
> }
>
> package org.testing.data;
>
> public class Internal {
>
>     private String internal = null;
>
>     public Internal(String internal) {
>         this.internal = internal;
>     }
>
>  // getters and setters...
>     
> }
>
>
>  That way it doesn't work and my RPC client fails, returning an
> AxisFault caused by a java.lang.InstantiationException. But If I
> change those classes removing the constructors :
>
> package org.testing.data;
>
> public class External {
>
>     private String exMessage;
>     private boolean error;   
>                private Internal internal;
>
>  // getters and setters
>     
> }
>
> public class Internal {
>
>     private String internal;
>
>  // getters and setters...
>     
> }
>
> then... it works FINE!!!!!!!!!!!!!!!!!!!!!!!, and that is vey strange
> for me!!!!!!!. Is that the expected behaviour? can't I have my own
> constructor in the returned objects? (If I can't, I'll need many lines
> of code to do what I could have done with one line of code). does it
> exist any way to avoid that and have my own constructors?.
>
>  Thanks in advance. Regards :
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message