You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by "Jung, Eric (Contractor)" <ej...@russellmellon.com> on 2002/11/06 19:17:41 UTC

Arrays of Hashtables and Vectors

I'm trying to call an RPC method on my Apache SOAP server which accepts a
single parameter: an array of Hashtables.
I read http://www-106.ibm.com/developerworks/library/ws-soapmap1 and that
helped somewhat, but I still have a problem. Here's my client code:

  Hashtable[] schedules = new Hashtable[] { Utils.makeOneSchedule() };
  Vector params = new Vector();
  params.addElement(new Parameter("schedules", Hashtable.class,
                                  schedules, null));
  call.setParams(params);
  resp = call.invoke(new URL(url), ""); //call it

And the error I get:

Caught SOAPException (SOAP-ENV:Client): Tried to pass a 'class
[Ljava.util.Hashtable;' to HashtableSerializer

This happens, of course, because I use Hashtable.class in addElement().
But how do I specify the 2nd parameter of the Parameter object as an array
of Hashtables??

TYIA,

Eric H. Jung
Russell/Mellon Analytical Services
1-617-382-1373
Everett, MA, USA




Re: Arrays of Hashtables and Vectors

Posted by Scott Nichol <sn...@scottnichol.com>.
Try Hashtable[].class or schedules.getClass().

Scott Nichol

----- Original Message -----
From: "Jung, Eric (Contractor)" <ej...@russellmellon.com>
To: <so...@xml.apache.org>
Sent: Wednesday, November 06, 2002 1:17 PM
Subject: Arrays of Hashtables and Vectors


> I'm trying to call an RPC method on my Apache SOAP server which
accepts a
> single parameter: an array of Hashtables.
> I read http://www-106.ibm.com/developerworks/library/ws-soapmap1 and
that
> helped somewhat, but I still have a problem. Here's my client code:
>
>   Hashtable[] schedules = new Hashtable[] { Utils.makeOneSchedule() };
>   Vector params = new Vector();
>   params.addElement(new Parameter("schedules", Hashtable.class,
>                                   schedules, null));
>   call.setParams(params);
>   resp = call.invoke(new URL(url), ""); //call it
>
> And the error I get:
>
> Caught SOAPException (SOAP-ENV:Client): Tried to pass a 'class
> [Ljava.util.Hashtable;' to HashtableSerializer
>
> This happens, of course, because I use Hashtable.class in
addElement().
> But how do I specify the 2nd parameter of the Parameter object as an
array
> of Hashtables??
>
> TYIA,
>
> Eric H. Jung
> Russell/Mellon Analytical Services
> 1-617-382-1373
> Everett, MA, USA
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Arrays of Hashtables and Vectors

Posted by Scott Nichol <sn...@scottnichol.com>.
Try Hashtable[].class or schedules.getClass().

Scott Nichol

----- Original Message -----
From: "Jung, Eric (Contractor)" <ej...@russellmellon.com>
To: <so...@xml.apache.org>
Sent: Wednesday, November 06, 2002 1:17 PM
Subject: Arrays of Hashtables and Vectors


> I'm trying to call an RPC method on my Apache SOAP server which
accepts a
> single parameter: an array of Hashtables.
> I read http://www-106.ibm.com/developerworks/library/ws-soapmap1 and
that
> helped somewhat, but I still have a problem. Here's my client code:
>
>   Hashtable[] schedules = new Hashtable[] { Utils.makeOneSchedule() };
>   Vector params = new Vector();
>   params.addElement(new Parameter("schedules", Hashtable.class,
>                                   schedules, null));
>   call.setParams(params);
>   resp = call.invoke(new URL(url), ""); //call it
>
> And the error I get:
>
> Caught SOAPException (SOAP-ENV:Client): Tried to pass a 'class
> [Ljava.util.Hashtable;' to HashtableSerializer
>
> This happens, of course, because I use Hashtable.class in
addElement().
> But how do I specify the 2nd parameter of the Parameter object as an
array
> of Hashtables??
>
> TYIA,
>
> Eric H. Jung
> Russell/Mellon Analytical Services
> 1-617-382-1373
> Everett, MA, USA
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>