Hi,

If I understand Dylan correctly, he wants to receive an integer on the
server side as an Integer and not an int? If this is the case, there really
doesn't have to be any change on the client side, but on the server side
you want to make sure that the schema type xsd:int is deserialized as an
Integer and not an int. To do this, you have to add a type mapping to the
service deployment descriptor on the server, in your case it would probably
be something like

<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
     xmlns:xsd="http://www.w3.org/1999/XMLSchema"; qname="xsd:int"
     javaType="java.lang.Integer"
     java2XMLClassName="IntObjectSerializer"
     xml2JavaClassName="IntObjectDeserializer"/>

where IntObjectSerializer obeys the SOAP serialization interface (has the
marshall method to convert an Integer to an xsd:int on the wire) and
IntObjectDeserializer has the corresponding unmarshall method.

Nirmal.


                                                                                       
            
                    Gordon Easton                                                      
            
                    <gordoneaston@       To:     [EMAIL PROTECTED]              
            
                    yahoo.com>           cc:                                           
            
                                         Subject:     Re: Integers, ints,and 
serialization?        
                    07/25/2001                                                         
            
                    09:29 AM                                                           
            
                    Please respond                                                     
            
                    to soap-user                                                       
            
                                                                                       
            
                                                                                       
            



Hi Dylan,
Isn't an Integer one of the object that is
automatically handled by SOAP?  I don't think you need
to do the mapping, from what I've read.

--- Dylan J Browne <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm a bit stumped by a problem I have.
>
> I am sending an Integer as one of a number of params
> to my RPC method.
>
> I am adding the serialization like this:
>
> smr.mapTypes (Constants.NS_URI_SOAP_ENC,new QName
> (serName, deSerName),
> null, null, new IntObjectDeserializer);
>
> and the param like this:
>
> Parameter anInt   = new Parameter("integer",
> Integer.class, integer,
> Constants.NS_URI_SOAP_ENC);
>
> But when it reaches my server, it thinks it is an
> int and I get the
> following error:
>
> [SOAPException: faultCode=SOAP-ENV:Server;
> msg=Exception while handling
> service
> request:
>
samples.devicemonitor.DeviceMonitor.takeTwoParams(java.lang.String,int)
>  -- no signature match]
>
> Obviously doing one or more things wrong... Where
> does my stupidity lie?
>
> Thanks v much in advance for any advice.
>
> D.


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/




Reply via email to