Error decoding base64Binary
---------------------------
Key: AXIOM-380
URL: https://issues.apache.org/jira/browse/AXIOM-380
Project: Axiom
Issue Type: Bug
Affects Versions: 1.2.11
Environment: Axis2 1.6.0, Windows 7
Reporter: Dimitar Gospodinov
Recently I upgraded from Axis2 1.4.1 to Axis2 1.6.0.
I have a web service with operation Test. One of the Test parameters is of type
base64Binary.
After upgrading to 1.6.0 Test stopped working - my code did not even get
called. Some investigation revealed that the problem is with the base64 data.
An error is generated with the following message:
javax.xml.stream.XMLStreamException: Error during base64 decoding
Digging a bit more revealed that the root cause is:
java.io.IOException: Invalid base64 char '\n'
at
org.apache.axiom.util.base64.AbstractBase64DecodingWriter.decode(AbstractBase64DecodingWriter.java:80)
at
org.apache.axiom.util.base64.AbstractBase64DecodingWriter.decode(AbstractBase64DecodingWriter.java:91)
at
org.apache.axiom.util.base64.AbstractBase64DecodingWriter.write(AbstractBase64DecodingWriter.java:66)
at
org.apache.axiom.util.base64.AbstractBase64DecodingWriter.write(AbstractBase64DecodingWriter.java:57)
at java.io.Writer.write(Writer.java:140)
at
org.apache.axiom.util.stax.XMLStreamReaderUtils.writeTextTo(XMLStreamReaderUtils.java:287)
at
org.apache.axiom.om.impl.SwitchingWrapper.writeTextTo(SwitchingWrapper.java:466)
at
org.apache.axiom.util.stax.XMLStreamReaderUtils.writeTextTo(XMLStreamReaderUtils.java:285)
at
org.apache.axiom.util.stax.XMLStreamReaderUtils.getDataHandlerFromElement(XMLStreamReaderUtils.java:237)
... 23 more
The base64 data passed to the web service looks like this(exact snapshot of the
HTTP request, with just the first 3 lines shown):
<data
xmlns="">MS4wMToxNDIdMS4wMjowMzAwHTEuMDM6MR8wMx4yHzAwHjQfMDEeNB8wMh0xLjA0OlBOUx0xLjA1
OjIwMTEwODAyHTEuMDY6Mh0xLjA3OkZMRkRMRUNWWh0xLjA4OkZMMDM3ODhXMB0xLjA5OjExMDgw
MjAwMDcdMS4xMToxOS42OR0xLjEyOjE5LjY5HDIuMDAxOjE4HTIuMDAyOjAwHAAAgngBAAL/////
There is \r\n between each line.
All this used to work with 1.4.1 and now suddenly stopped with the above error.
After some more investigation it turned out that if all \r\n are removed from
the <data> element with the base64 data (basically make the base64 value a
single line), everything works Ok.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]