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 Brian Shields <bg...@yahoo.com> on 2002/10/30 15:25:46 UTC

Parameters??

Hi all,
A parameter is made up of 4 elements...the name of the variable as a string, the class type of the variable, the variable itself and "constants,NS_URI_SOAP_ENC.

this is fine when working with objects, what happens if i want to pass an int or boolean. i could pass an Integer class or Boolean class, but that will throw errors from the service class!!

Any ideas,
Brian.



---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

Re: Parameters??

Posted by Scott Nichol <sn...@scottnichol.com>.
For an int, specify the Class as int.class and the value as new
Integer(xxx).

Also, it so happens that if you specify the Class as Integer.class,
everything will still work for you, because this is deserialized as an
int on the server.  The problem arises if your service method has one
parameter that is one of the wrapper types (e.g. Integer) and another
parameter that is the corresponding primitive type.  The wrapper and
primitive will be serialized with the same XML schema type, so there is
no way to have them deserialized as different Java types.

Scott Nichol

----- Original Message -----
From: "Brian Shields" <bg...@yahoo.com>
To: <so...@xml.apache.org>
Sent: Wednesday, October 30, 2002 9:25 AM
Subject: Parameters??


>
> Hi all,
> A parameter is made up of 4 elements...the name of the variable as a
string, the class type of the variable, the variable itself and
"constants,NS_URI_SOAP_ENC.
>
> this is fine when working with objects, what happens if i want to pass
an int or boolean. i could pass an Integer class or Boolean class, but
that will throw errors from the service class!!
>
> Any ideas,
> Brian.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site


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


Re: Parameters??

Posted by Scott Nichol <sn...@scottnichol.com>.
For an int, specify the Class as int.class and the value as new
Integer(xxx).

Also, it so happens that if you specify the Class as Integer.class,
everything will still work for you, because this is deserialized as an
int on the server.  The problem arises if your service method has one
parameter that is one of the wrapper types (e.g. Integer) and another
parameter that is the corresponding primitive type.  The wrapper and
primitive will be serialized with the same XML schema type, so there is
no way to have them deserialized as different Java types.

Scott Nichol

----- Original Message -----
From: "Brian Shields" <bg...@yahoo.com>
To: <so...@xml.apache.org>
Sent: Wednesday, October 30, 2002 9:25 AM
Subject: Parameters??


>
> Hi all,
> A parameter is made up of 4 elements...the name of the variable as a
string, the class type of the variable, the variable itself and
"constants,NS_URI_SOAP_ENC.
>
> this is fine when working with objects, what happens if i want to pass
an int or boolean. i could pass an Integer class or Boolean class, but
that will throw errors from the service class!!
>
> Any ideas,
> Brian.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site