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 "Mark A. Richman" <ma...@telocity.com> on 2001/06/21 17:31:54 UTC

long Parameter won't compile

I get the following error when trying to use a long (not Long) as a
parameter to a Call:

params.addElement (new Parameter("time", long.class, time, null));

symbol  : constructor Parameter
(java.lang.String,java.lang.Class,long,<null>)
location: class org.apache.soap.rpc.Parameter
        params.addElement (new Parameter("time", long.class, time, null));
                           ^

The "time" parameter is of type long. It will compile fine with time as
String.

- Mark



RE: long Parameter won't compile

Posted by "Matthew J. Duftler" <du...@watson.ibm.com>.
Hi Mark,

You must pass primitive arguments in the same manner as you would when
making reflection-based invocations: use the wrapper types. So your code
should look like:

 params.addElement (new Parameter("time", long.class, new Long(time),
null));

Thanks,
-Matt

> -----Original Message-----
> From: Mark A. Richman [mailto:markrichman@telocity.com]
> Sent: Thursday, June 21, 2001 11:32 AM
> To: SOAP
> Subject: long Parameter won't compile
>
>
> I get the following error when trying to use a long (not Long) as a
> parameter to a Call:
>
> params.addElement (new Parameter("time", long.class, time, null));
>
> symbol  : constructor Parameter
> (java.lang.String,java.lang.Class,long,<null>)
> location: class org.apache.soap.rpc.Parameter
>         params.addElement (new Parameter("time", long.class, time, null));
>                            ^
>
> The "time" parameter is of type long. It will compile fine with time as
> String.
>
> - Mark
>
>


RE: long Parameter won't compile

Posted by "Matthew J. Duftler" <du...@watson.ibm.com>.
Hi Mark,

You must pass primitive arguments in the same manner as you would when
making reflection-based invocations: use the wrapper types. So your code
should look like:

 params.addElement (new Parameter("time", long.class, new Long(time),
null));

Thanks,
-Matt

> -----Original Message-----
> From: Mark A. Richman [mailto:markrichman@telocity.com]
> Sent: Thursday, June 21, 2001 11:32 AM
> To: SOAP
> Subject: long Parameter won't compile
>
>
> I get the following error when trying to use a long (not Long) as a
> parameter to a Call:
>
> params.addElement (new Parameter("time", long.class, time, null));
>
> symbol  : constructor Parameter
> (java.lang.String,java.lang.Class,long,<null>)
> location: class org.apache.soap.rpc.Parameter
>         params.addElement (new Parameter("time", long.class, time, null));
>                            ^
>
> The "time" parameter is of type long. It will compile fine with time as
> String.
>
> - Mark
>
>