You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by "Srikar.S.S" <sr...@yahoo.com> on 2001/04/06 09:28:54 UTC

problem with array data type...

Hi,
I am trying to return an ARRAY of Integers from the SOAP server, but get
the following exceptions:

I get this exception when nothing is mapped in the SOAPMapping registry.

SOAPException= SOAP-ENV:Client, java.lang.NumberFormatException:


Later I tried using the ArraySerializer:
On the server side I performed the following mapping:
*********************************
TypeMapping encodingStyle=http://schemas.xmlsoap.org/soap/encoding/,
elementType=urn:xml-soap:array,
javaType=Integer,
java2XMLClassName=org.apache.soap.encoding.soapenc.ArraySerializer,
xml2JavaClassName=org.apache.soap.encoding.soapenc.ArraySerializer]
Default Mapping Registry Class
************************************


Client code looks as folllows:
********************************
.......................
call.setEncodingStyleURI( Constants.NS_URI_SOAP_ENC );
SOAPMappingRegistry smr = new SOAPMappingRegistry();
ArraySerializer arrSer = new ArraySerializer();

  // Map the types.
smr.mapTypes(Constants.NS_URI_SOAP_ENC,new QName("urn:xml-soap",
"array"),Integer.class, arrSer, arrSer);
call.setSOAPMappingRegistry(smr);
......................
************************************
Then I get the following exception:

Fault= SOAP-ENV:Client, deployment error in SOAP service
'urn:array:PriceList':
class name 'Integer' could not be resolved: Integer


I had read the prevoius postings and came to know that some had success
straight forward without the mappings.
Can any one point where am I going wrong??
I am not passing any parameter from the client side...its only a array
returned from the SOAP server.

thanks in advance,
srikar



Re: problem with array data type...

Posted by "Srikar.S.S" <sr...@yahoo.com>.
Hi,
Got rid of the problem.
I had not initialized all the members of the Integer array, some of the
fields were null.
This caused the problem while deserializing....as a result "Number
format exception".
It works fine straight forward, without any map types.

thanx,
srikar



"Srikar.S.S" wrote:

> Hi,
> I am trying to return an ARRAY of Integers from the SOAP server, but
> get the following exceptions:
>
> I get this exception when nothing is mapped in the SOAPMapping
> registry.
> SOAPException= SOAP-ENV:Client, java.lang.NumberFormatException:
>
>
> Later I tried using the ArraySerializer:
> On the server side I performed the following mapping:
> *********************************
> TypeMapping encodingStyle=http://schemas.xmlsoap.org/soap/encoding/,
> elementType=urn:xml-soap:array,
> javaType=Integer,
> java2XMLClassName=org.apache.soap.encoding.soapenc.ArraySerializer,
> xml2JavaClassName=org.apache.soap.encoding.soapenc.ArraySerializer]
> Default Mapping Registry Class
> ************************************
>
>
> Client code looks as folllows:
> ********************************
> .......................
> call.setEncodingStyleURI( Constants.NS_URI_SOAP_ENC );
> SOAPMappingRegistry smr = new SOAPMappingRegistry();
> ArraySerializer arrSer = new ArraySerializer();
>
>   // Map the types.
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,new QName("urn:xml-soap",
> "array"),Integer.class, arrSer, arrSer);
> call.setSOAPMappingRegistry(smr);
> ......................
> ************************************
> Then I get the following exception:
>
> Fault= SOAP-ENV:Client, deployment error in SOAP service
> 'urn:array:PriceList':
> class name 'Integer' could not be resolved: Integer
>
>
> I had read the prevoius postings and came to know that some had
> success straight forward without the mappings.
> Can any one point where am I going wrong??
> I am not passing any parameter from the client side...its only a array
> returned from the SOAP server.
>
> thanks in advance,
> srikar
>
>

Re: problem with array data type...

Posted by "Srikar.S.S" <sr...@yahoo.com>.
Hi,
Got rid of the problem.
I had not initialized all the members of the Integer array, some of the
fields were null.
This caused the problem while deserializing....as a result "Number
format exception".
It works fine straight forward, without any map types.

thanx,
srikar



"Srikar.S.S" wrote:

> Hi,
> I am trying to return an ARRAY of Integers from the SOAP server, but
> get the following exceptions:
>
> I get this exception when nothing is mapped in the SOAPMapping
> registry.
> SOAPException= SOAP-ENV:Client, java.lang.NumberFormatException:
>
>
> Later I tried using the ArraySerializer:
> On the server side I performed the following mapping:
> *********************************
> TypeMapping encodingStyle=http://schemas.xmlsoap.org/soap/encoding/,
> elementType=urn:xml-soap:array,
> javaType=Integer,
> java2XMLClassName=org.apache.soap.encoding.soapenc.ArraySerializer,
> xml2JavaClassName=org.apache.soap.encoding.soapenc.ArraySerializer]
> Default Mapping Registry Class
> ************************************
>
>
> Client code looks as folllows:
> ********************************
> .......................
> call.setEncodingStyleURI( Constants.NS_URI_SOAP_ENC );
> SOAPMappingRegistry smr = new SOAPMappingRegistry();
> ArraySerializer arrSer = new ArraySerializer();
>
>   // Map the types.
> smr.mapTypes(Constants.NS_URI_SOAP_ENC,new QName("urn:xml-soap",
> "array"),Integer.class, arrSer, arrSer);
> call.setSOAPMappingRegistry(smr);
> ......................
> ************************************
> Then I get the following exception:
>
> Fault= SOAP-ENV:Client, deployment error in SOAP service
> 'urn:array:PriceList':
> class name 'Integer' could not be resolved: Integer
>
>
> I had read the prevoius postings and came to know that some had
> success straight forward without the mappings.
> Can any one point where am I going wrong??
> I am not passing any parameter from the client side...its only a array
> returned from the SOAP server.
>
> thanks in advance,
> srikar
>
>