You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Davanum Srinivas (JIRA)" <ji...@apache.org> on 2006/05/11 17:31:04 UTC
[jira] Created: (AXIS2-712) [ADB] convertTobase64Binary (?)
[ADB] convertTobase64Binary (?)
-------------------------------
Key: AXIS2-712
URL: http://issues.apache.org/jira/browse/AXIS2-712
Project: Apache Axis 2.0 (Axis2)
Type: Bug
Reporter: Davanum Srinivas
Please run wsdl2java on Benchmark.wsdl. It generates code (snippet below) inEchoBase64Response#parse
if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.extreme.indiana.edu/wsdl/Benchmark1", "echoBase64Return").equals(reader.getName()))
{
java.lang.String content = getElementTextProperly(reader);
object.setEchoBase64Return(
org.apache.axis2.databinding.utils.ConverterUtil.convertTobase64Binary(content));
reader.next();
} // End of if for expected property start element
On the wire the string being received is base64 encoded, so we need to decode it. (So the name is wrong?). the convertTobase64Binary method just wraps up the bytes of the string into a data handler which is wrong.
Patch is as follows:
Index: modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
===================================================================
--- modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (revision 405712)
+++ modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (working copy)
@@ -327,7 +327,7 @@
throws Exception{
// reusing the byteArrayDataSource from the Axiom classes
ByteArrayDataSource byteArrayDataSource = new ByteArrayDataSource(
- s.getBytes()
+ Base64.decode(s)
);
return new DataHandler(byteArrayDataSource);
}
Thanks,
dims
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (AXIS2-712) [ADB] convertTobase64Binary (?)
Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/AXIS2-712?page=all ]
Davanum Srinivas resolved AXIS2-712:
------------------------------------
Resolution: Fixed
fixed.
> [ADB] convertTobase64Binary (?)
> -------------------------------
>
> Key: AXIS2-712
> URL: http://issues.apache.org/jira/browse/AXIS2-712
> Project: Apache Axis 2.0 (Axis2)
> Type: Bug
> Reporter: Davanum Srinivas
>
> Please run wsdl2java on Benchmark.wsdl. It generates code (snippet below) inEchoBase64Response#parse
> if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.extreme.indiana.edu/wsdl/Benchmark1", "echoBase64Return").equals(reader.getName()))
> {
> java.lang.String content = getElementTextProperly(reader);
> object.setEchoBase64Return(
> org.apache.axis2.databinding.utils.ConverterUtil.convertTobase64Binary(content));
> reader.next();
> } // End of if for expected property start element
> On the wire the string being received is base64 encoded, so we need to decode it. (So the name is wrong?). the convertTobase64Binary method just wraps up the bytes of the string into a data handler which is wrong.
> Patch is as follows:
> Index: modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
> ===================================================================
> --- modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (revision 405712)
> +++ modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (working copy)
> @@ -327,7 +327,7 @@
> throws Exception{
> // reusing the byteArrayDataSource from the Axiom classes
> ByteArrayDataSource byteArrayDataSource = new ByteArrayDataSource(
> - s.getBytes()
> + Base64.decode(s)
> );
> return new DataHandler(byteArrayDataSource);
> }
> Thanks,
> dims
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira