You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-user@portals.apache.org by Alexis BERNARD <al...@ds-fr.com> on 2004/02/06 15:59:54 UTC

wsrp methods

Hi all,

I 'm using the wsrp methods (generated by axis), like for instance
ServiceDescription.setOfferedPortlets or MarkupType.setMode etc. First, I
tried to use these methods as follow :
serviceDescription.setOfferedPortlets(i, portletDescription);
But it throw a null exception whereas when I use the following call, it's
working well :
serviceDescription.setOfferedPortlets(descriptions); //descriptions is a
ServiceDescription array.

Is it normal or did you ever obsrved this problem? Must I make a kind of
initialization to use the first method?

Thank's
Alexis



Re: wsrp methods

Posted by Richard Jacob <ja...@apache.org>.
Alexis BERNARD wrote:

>Hi all,
>
>I 'm using the wsrp methods (generated by axis), like for instance
>ServiceDescription.setOfferedPortlets or MarkupType.setMode etc. First, I
>tried to use these methods as follow :
>serviceDescription.setOfferedPortlets(i, portletDescription);
>But it throw a null exception whereas when I use the following call, it's
>working well :
>serviceDescription.setOfferedPortlets(descriptions); //descriptions is a
>ServiceDescription array.
>
>Is it normal or did you ever obsrved this problem? Must I make a kind of
>initialization to use the first method?
>
>Thank's
>Alexis
>
>
>
>  
>
well, the generated classes are not very safe here.
Looking into the source of MarkupType for instance I see that the 
String[] modes is not initialized.
Therefor you get the NPE.
The generated method seems to be a "modifier" method to me which allow 
modifications to an already passed array.
But I agree that this is not very clean and safe.
Perhaps you want to post this problem to the axis ML.

cu
Richard