You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Kay* <ka...@gmail.com> on 2007/03/07 18:12:19 UTC

Re: setParam0(OMElement param) or xs:any

I tried to use BeanUtil's method, but I had an error:

Exception in thread "main" java.lang.IllegalArgumentException: null rcl
        at org.codehaus.jam.internal.reflect.ReflectClassBuilder.<init>(
ReflectClassBuilder.java:47)
        at org.codehaus.jam.provider.JamServiceFactoryImpl.createBuilder(
JamServiceFactoryImpl.java:173)
        at org.codehaus.jam.provider.JamServiceFactoryImpl.createClassLoader
(JamServiceFactoryImpl.java:137)
        at org.codehaus.jam.provider.JamServiceFactoryImpl.createService(
JamServiceFactoryImpl.java:78)
        at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(
BeanUtil.java:67)
        at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(
BeanUtil.java:225)
        at org.apache.ws.axis2.Client.main(Client.java:61)

The code is this:
...
OMElement[] param1=new OMElement[6];
    Integer [] ve=new Integer[6];
    ve[0]=(new Integer(12));
    ve[1]=(new Integer(23));
    ve[2]=(new Integer(34));
    ve[3]=(new Integer(45));
    ve[4]=(new Integer(56));
    ve[5]=(new Integer(67));

    for(int i=0;i<6;i++){
        XMLStreamReader reader = BeanUtil.getPullParser(ve[i]);
        StreamWrapper parser = new StreamWrapper(reader);
        StAXOMBuilder stAXMOMBuilder =
OMXMLBuilderFactory.createStAXOMBuilder (OMAbstractFactory.getOMFactory
(),parser);
        param1[i] = stAXMOMBuilder.getDocumentElement();
    }
    req2.setParam1(param1);

...
I suppose that the error is that, if I do

        Integer a = new Integer(55);
        ClassLoader cl = a.getClass().getClassLoader();

cl is null, and I don't know why!

Can you help me, please?

2007/2/28, Kay* <ka...@gmail.com>:
>
> Thank you for your answer! I suppose that BeanUtil's method goes only
> with javabean obj, but I'll try to apply to my project ! (sorry for my
> English!!!!)
> Thank you, thank you very much!!!!
>
> Kay*
>
> 2007/2/28, Nilesh Ghorpade <ni...@yahoo.com>:
> >
> > Hi,
> >
> > There is a utility tool in the AXIS 2 API's namely the BeanUtil I
> believe.
> > This class has some static methods which would enable you to convert
> from an
> > Object to an OMElement and vice versa.
> >
> > Hope that helps.
> >
> > Regards
> >
> > Nilesh
> >
> >
> > ----- Original Message ----
> > From: Kay* <ka...@gmail.com>
> > To: axis-user@ws.apache.org
> > Sent: Wednesday, February 28, 2007 7:27:53 PM
> > Subject: Re: setParam0(OMElement param) or xs:any
> >
> >
> > I need to pass a variable number of different objs...
> > I also tried to pass a Vector of Integer (for an example) but axis2
> > doesn't know how resolve it and it gives me a xs:any ...
> > I tried also to pass one my class, called Vettore (with an array of
> > Object or a Vector) but when I generate the stub, it contains an its
> > Vettore, different from mine...
> > I can't explain better...
> > Thank you for your attention!
> >
> > Kay*
> >
> > 2007/2/28, Deepal Jayasinghe <de...@opensource.lk>:
> > > Hi ;
> > >
> > > I am talking about smt like below;
> > > public Address[] compute(Man []  data){
> > >      //...
> > >  }
> > >
> > > Do not use just Object ,use the actual type you want to use.
> > >
> > > Thanks
> > > Deepal
> > >
> > > Kay* wrote:
> > >
> > > > Thank you for your answer, but I don't understand .... can you
> please
> > > > do an example?Do you mean that I have to change parameters ?
> > > > Thank you very very much!!!
> > > >
> > > > Kay*
> > > >
> > > > 2007/2/27, Deepal Jayasinghe < deepal@opensource.lk
> > > > <ma...@opensource.lk>>:
> > > >
> > > >     Hi ;
> > > >
> > > >     When you have a method which take Object then there is no way to
> > find
> > > >     out the type of that object. That is why it generates WSDL with
> > > >     xsd:any.
> > > >     To solve that U need to write the method to take the method with
> > > >     correct
> > > >     Object type (String [] or what ever).
> > > >
> > > >     Thanks
> > > >     Deepal
> > > >
> > > >     Kay* wrote:
> > > >
> > > >     > Hello! (Sorry for my bad English...)
> > > >     > My problem is that my service is like this:
> > > >     >
> > > >     >
> > > >     > public Object[] compute(Object[]  data){
> > > >     >      //...
> > > >     > }
> > > >     >
> > > >     > and MyServiceStub.Compute has
> > > >     setParam0(org.apache.axiom.om.OMElement
> > > >     > [] param) and get_return returns an OMElement[]...
> > > >     > I don't know how to create an OMElement within Object[] ...and
> > > >     viceversa.
> > > >     >
> > > >     > Please, can you help me ?
> > > >     >
> > > >     > Thank you very much!!!
> > > >     >
> > > >     > Kay*
> > > >
> > > >
> > > >     --
> > > >     Thanks,
> > > >     Deepal
> > > >
> > ................................................................
> > > >     "The highest tower is built one brick at a time"
> > > >
> > > >
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > >     To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > >     <ma...@ws.apache.org>
> > > >     For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >     <ma...@ws.apache.org>
> > > >
> > > >
> > > >
> > > >
> > >
> > > --
> > > Thanks,
> > > Deepal
> > >
> > ................................................................
> > > "The highest tower is built one brick at a time"
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >  ________________________________
> > Looking for earth-friendly autos?
> >  Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
>