Maybe I should look up the definition of "comprehensive".  This is a
more comprehensive explanation:

To pass a primitive (ie. a SOAP type as defined in
http://schemas.xmlsoap.org/soap/encoding/) which will be understood by
all SOAP implementations it's advisable to the primitive type with
the wrapper object (as demonstrated before):

 new Parameter("forceAdd", boolean.class, new Boolean(false), null);

And to pass a wrapper object (which assumes the SOAP service knows what
the wrapper object is; ie. Java implementation or similar) you'll have to
add the wrapper class to the SOAPMappingRegistry:

 SOAPMappingRegistry smr;
 BeanSerializer beanSer;
 smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(SERVICE_NS, "Boolean"),
              Boolean.class, beanSer, beanSer);

 new Parameter("forceAdd", Boolean.class, new Boolean(false), null);

Now you can send wrapper objects and primitives.  The service must have a
deserializer registered (BeanSerializer is fine for Apache SOAP) and
given the same QName as in the client.

Hope that's more help,
Andy.


> -----Original Message-----
> From: Chad La Joie [mailto:[EMAIL PROTECTED]]
> Sent: 01 October 2001 13:20
> To: [EMAIL PROTECTED]
> Subject: Passing primitive in RPC calls
> 
> 
> I've looked through the archives and noticed a lot of people 
> asking about 
> how you pass primitive data types in RPC calls, yet I haven't 
> seen any 
> comprehensive answers.  So let me ask the question in a different way.
> 
> I want to pass a primitive in an RPC call.  I understand that 
> I can wrap it 
> in it's java.lang equivalent, however, how does the service know to 
> deserialize that back into a primitive as opposed to the 
> wrapper class for 
> my method?
> 
> Here is an example.  I have the following method exposed for 
> use by SOAP
> 
> addChannel(ChannelMetadata metadata, boolean forceAdd)
> 
> and I create an RPC Parameter as follows
> 
> new Parameter("forceAdd", Boolean.class, new Boolean(false), null);
> 
> Now does the SOAP server use reflection to determine I need a 
> boolean and 
> hence pass a boolean primitive to the above method, or is it going to 
> blindly pass a Boolean?  If it does pass a Boolean, how can I 
> get it to 
> pass a boolean?
> 
> Chad La Joie                    "It is true that you never know what
> Middleware Services              you have until it is gone, 
> but it is also
> IS&C - Virginia Tech             true that you never know what you've
>                                   been missing until it arrives."
> 

Reply via email to