[
https://issues.apache.org/jira/browse/AXIS2-3765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sven Blösl updated AXIS2-3765:
------------------------------
Description:
BeanUtil decodes the wrong node for byte[] which are part of a complex type
contained in a sequence due to a bug in
deserialize(Class beanClass,
OMElement beanElement,
ObjectSupplier objectSupplier,
String arrayLocalName) :
BeanUtil class lines 381-383 do not take byte arrays into account:
} else if (parameters.isArray()) {
partObj = deserialize(parameters,
(OMElement)parts.getParent(),
objectSupplier, prty.getName());
} ...
so that line 308 tries to decode the text of the parent node.
if ("byte".equals(arrayClassType.getName())) {
return
Base64.decode(beanElement.getFirstElement().getText());
} else {
The following addition to lines 381-383 performs the recursive call with the
correct node for byte arrays.
} else if (parameters.isArray()) {
if
("byte".equals(parameters.getComponentType().getName())) {
partObj = deserialize(parameters,
(OMElement) parts, objectSupplier, prty.getName());
} else {
partObj = deserialize(parameters,
(OMElement)parts.getParent(),
objectSupplier,
prty.getName());
}
} ...
Further Base64.decode(beanElement.getFirstElement().getText()) didnt worked
for me since the node is an OMText and not an OMElement,
but Base64.decode(((OMText) beanElement.getFirstOMChild()).getText()) worked.
I'll attach my WSDL which was generated from my POJOs.
was:
BeanUtil class lines 381-383 do not take byte arrays into account:
} else if (parameters.isArray()) {
partObj = deserialize(parameters,
(OMElement)parts.getParent(),
objectSupplier, prty.getName());
} ...
so that line 308 tries to decode the text of the parent node.
if ("byte".equals(arrayClassType.getName())) {
return
Base64.decode(beanElement.getFirstElement().getText());
} else {
The following replacement for line 381-383 performs the recursive call with the
correct node for byte arrays.
if
("byte".equals(parameters.getComponentType().getName())) {
partObj = deserialize(parameters,
(OMElement) parts, objectSupplier, prty.getName());
} else {
partObj = deserialize(parameters,
(OMElement)parts.getParent(),
objectSupplier,
prty.getName());
}
Further Base64.decode(beanElement.getFirstElement().getText()) doesnt worked
for me since the node is an OMText and not an OMElement,
but Base64.decode(((OMText) beanElement.getFirstOMChild()).getText()) worked.
I'll attach my WSDL which was generated from my POJOs.
Summary: BeanUtil.deserialize() tries to deserialize the wrong OMNode
for byte[] (was: BeanUtil.deserialize() tries to deserializable the wrong
OMNode for byte[])
corrected misspelling, clarified description
> BeanUtil.deserialize() tries to deserialize the wrong OMNode for byte[]
> -----------------------------------------------------------------------
>
> Key: AXIS2-3765
> URL: https://issues.apache.org/jira/browse/AXIS2-3765
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: adb
> Affects Versions: 1.3
> Environment: Axis2/Tomcat 6 Serverside; C#.net on client side
> Reporter: Sven Blösl
> Priority: Minor
> Attachments: CountAbos.wsdl
>
>
> BeanUtil decodes the wrong node for byte[] which are part of a complex type
> contained in a sequence due to a bug in
> deserialize(Class beanClass,
> OMElement beanElement,
> ObjectSupplier objectSupplier,
> String arrayLocalName) :
> BeanUtil class lines 381-383 do not take byte arrays into account:
> } else if (parameters.isArray()) {
> partObj = deserialize(parameters,
> (OMElement)parts.getParent(),
> objectSupplier, prty.getName());
> } ...
> so that line 308 tries to decode the text of the parent node.
> if ("byte".equals(arrayClassType.getName())) {
> return
> Base64.decode(beanElement.getFirstElement().getText());
> } else {
> The following addition to lines 381-383 performs the recursive call with the
> correct node for byte arrays.
> } else if (parameters.isArray()) {
> if
> ("byte".equals(parameters.getComponentType().getName())) {
> partObj = deserialize(parameters,
> (OMElement) parts, objectSupplier, prty.getName());
> } else {
> partObj = deserialize(parameters,
> (OMElement)parts.getParent(),
> objectSupplier,
> prty.getName());
> }
> } ...
> Further Base64.decode(beanElement.getFirstElement().getText()) didnt worked
> for me since the node is an OMText and not an OMElement,
> but Base64.decode(((OMText) beanElement.getFirstOMChild()).getText()) worked.
> I'll attach my WSDL which was generated from my POJOs.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]