Thank you for reporting this issue.
I fixed it in the trunk. Please have a look at with a nightly build.
On 6/28/07, Konstantinos Karadamoglou <[EMAIL PROTECTED]>
wrote:
Hello all,
I 've got a problem using the axis2/adb generated stubs when calling a
specific method of my targeted web-service. In details an exception occurs
when axis2 fails to unmarshal a array of xsd:decimal which contain
xsd:nill="true" values to an array of BigDecimal.
Here is the exception:
*java.lang.RuntimeException*: *
org.apache.axis2.databinding.utils.ConverterUtil$ObjectConversionException
*: *java.lang.ArrayStoreException*
at com.db.DBWebServiceStub.fromOM(*DBWebServiceStub.java:5629*)
at com.db.DBWebServiceStub.getHistoricNav(*DBWebServiceStub.java
:582*)
at com.db.DBWebServiceStubTest.testGetHistoricNav(*
DBWebServiceStubTest.java:66*)
By debugging the axis2 code I found out that the code fails in the
following method which tries using refletion to create a BigDecimal object
from its string constructor having null as a parameter. Here is the axis 2
code:
*public* *static* Object getObjectForClass(Class clazz, String value) {
//first see whether this class has a constructor that can
//take the string as an argument.
*boolean* continueFlag = *false*;
*try* {
Constructor stringConstructor =
clazz.getConstructor(*new*Class[]{String.
*class*});
*return* stringConstructor.newInstance(*new* Object[]{value});
} *catch* (NoSuchMethodException e) {
//oops - no such constructors - continue with the
//parse method
continueFlag = *true*;
}
...
Sould the code above code handle cases of null values?
Do you know how can I force adb to unmarshal the array of xsd:decimal
(containing a mix of null and not null values) into an BigDecimal array?
(the stub works whenever I get an array of only null values or only not null
values)
I use the apache axis2-1.2 distribution.
The wsdl definition of the call is the following:
<xsd:complexType name="*ArrayOfDecimal*">
*-*<http://localhost:52979/wsexplorer//wsdl/forms/WSDLDetailsSourceView.jsp#>
<xsd:sequence>
* * <xsd:element maxOccurs="*unbounded*" minOccurs="*0*"
name="*decimal*"nillable
="*true*" type="*xsd:decimal*" />
* * </xsd:sequence>
* * </xsd:complexType>
*-*<http://localhost:52979/wsexplorer//wsdl/forms/WSDLDetailsSourceView.jsp#>
<xsd:element name="*getHistoricNavResponse*">
*-*<http://localhost:52979/wsexplorer//wsdl/forms/WSDLDetailsSourceView.jsp#>
<xsd:complexType>
*-*<http://localhost:52979/wsexplorer//wsdl/forms/WSDLDetailsSourceView.jsp#>
<xsd:sequence>
* * <xsd:element maxOccurs="*1*" minOccurs="*1*" name="*out*" nillable="*
true*" type="*tns:ArrayOfDecimal*" />
* * </xsd:sequence>
* * </xsd:complexType>
* * </xsd:element>
An example soap response which triggers the exception is included below:
<soap:Envelope xmlns:soap="*http://schemas.xmlsoap.org/soap/envelope/*"xmlns:xsd
="*http://www.w3.org/2001/XMLSchema*" xmlns:xsi="*
http://www.w3.org/2001/XMLSchema-instance*">
*-*<http://localhost:52979/wsexplorer/wsdl/soap_envelope_xml.jsp?soapEnvelopeType=1#>
<soap:Body>
*-*<http://localhost:52979/wsexplorer/wsdl/soap_envelope_xml.jsp?soapEnvelopeType=1#>
<getHistoricNavResponse xmlns="*http://www.db.com*">
*-*<http://localhost:52979/wsexplorer/wsdl/soap_envelope_xml.jsp?soapEnvelopeType=1#>
<out>
* * <decimal xsi:nil="*true*" />
* * <decimal xsi:nil="*true*" />
<decimal>*111.38*</decimal>
* * <decimal>*111.38*</decimal>
* * <decimal>*111.38*</decimal>
* * <decimal>*111.54*</decimal>
* * </out>
* * </getHistoricNavResponse>
* * </soap:Body>
* * </soap:
Thank you in advance,
Konstantinos Karadamoglou
Rates eCommerce Autobahn FI Team
Investment Banking IT
Deutsche Bank London
Tel: +44 20 754 76349
---
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
--
Amila Suriarachchi,
WSO2 Inc.