The link shows an example with two String parameters:

    // Set up parameters
    Vector params = new Vector( );
    params.addElement(new Parameter("title", String.class, title, null));
    params.addElement(new Parameter("artist", String.class, artist, null));
    call.setParams(params);

Suppose that instead the first parameter is "titles", a Vector of titles by the 
artist.  Then we would have something like

    // Set up parameters
    Vector params = new Vector( );
    Vector titles = new Vector();
    titles.addElement("Title 1");
    titles.addElement("Title 2");
    params.addElement(new Parameter("titles", Vector.class, titles, null));
    params.addElement(new Parameter("artist", String.class, artist, null));
    call.setParams(params);

For RPC calls like this, params is always an array of Parameter.  Each parameter 
wrapped in a Parameter is itself the data type of the parameter you want to pass.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.

----- Original Message ----- 
From: "trebor iksrazal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 10, 2003 10:00 AM
Subject: Re: IllegalArgumentException problems with Vector


> Thanks for the replies. 
> 
> I'm confused by your statement. Reading the O'reilly
> book "Soap and XML", and also the link below,
> advocates the use of Parameter with Vector. You
> probably have a good reason - I'm probably mixing
> something up. 
> 
> http://www.onjava.com/pub/a/onjava/excerpt/java_xml_2_ch2/index.html?page=6
> 
> I'm also confused about registrating Parameter, or
> literal type String, as you suggest. Putting String
> into the Vector gives me this error: 
> 
> targetException=java.lang.IllegalArgumentException: No
> Serializer found to serialize a 'java.lang.String'
> using encoding style 'null'.]
> 
> Isn't Parameter and String "predefined and registered
> into the SOAPMappingRegistry " ? 
> 
> I'm sure I'm close to fixing my problem. I'm trying to
> add String and Parameter to smr.mapType() now. 
> 
> Thanks a bunch, 
> iksrazal
> 
> --- Scott Nichol <[EMAIL PROTECTED]> wrote:
> > Generally, you do not want to use the Parameter type
> > for your parameters.  You instead use types that are
> > native to your program.  This includes the simple
> > Java types like String, int, etc., some common Java
> > library types, such as Vector, types you define, and
> > arrays of all these things.  I cannot think of a
> > case where it is desirable to use the Apache
> > Parameter type as a parameter.
> > 
> > Scott Nichol
> > 
> > Do not send e-mail directly to this e-mail address,
> > because it is filtered to accept only mail from
> > specific mail lists.
> > 
> > ----- Original Message ----- 
> > From: "trebor iksrazal" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, September 10, 2003 8:44 AM
> > Subject: IllegalArgumentException problems with
> > Vector
> > 
> > 
> > > I have apache SOAP client and servers working just
> > > fine with simple java types String, Object and
> > int. I
> > > can also return Vector from the server to the
> > client. 
> > > 
> > > I`m having problems, however, sending a Vector
> > from
> > > the client to the server. I tried placing String
> > and
> > > Parameter objects in the Vector, but get the
> > following
> > > error (with respect to Parameter): 
> > > 
> > > SOAPException: faultCode=SOAP-ENV:Client; msg=No
> > > Serializer found to serialize a
> > > 'org.apache.soap.rpc.Parameter' using encoding
> > style
> > > 'null'.;
> > >
> > targetException=java.lang.IllegalArgumentException:
> > No
> > > Serializer found to serialize a
> > > 'org.apache.soap.rpc.Parameter' using encoding
> > style
> > > 'null'.]
> > > 
> > > Indeed, I (tried to) set the encoding to various
> > > apache constants during the java call. 
> > > 
> > > Please help, 
> > > iksrazal
> > > 
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! SiteBuilder - Free, easy-to-use web site
> > design software
> > > http://sitebuilder.yahoo.com
> > > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>

Reply via email to