how someone can turn XML into array of strings Base64 encoded chunks? – seems that it probebly impossibe
20 August, 2013
Hi Support,
How do I encode the XML data (lets say I already put it on string) into Base64 encoded chunks - array of strings?
I started to write a code using your web service class to automate the import of the XML file.
The export into an XML file is done by the YF Administration GUI - so no problem there.
The problem accrues when I try to turn the XML data into: "Array of Base64 encoded chunks of the XML import file" which is Array of strings".
Its in he first stage of the Import - GETIMPORTCONTENT. (page 47-48 on the webservice guide)
I tried to use base64 class of Apache server: http://commons.apache.org/proper/commons-codec/javadocs/api-release/org/apache/commons/codec/binary/Base64.html
but it brings array of bytes. (other classes does the same)
further more there is some kind of inconsistency because export method of ws_class- EXPORTCONTENT brings out A - "Array of ReportBinaryObject objects. These objects will hold the XML for exported artifacts" (not that I am using it!!!).
I am sure there is a easy way to conduct this base64 array of strings or there is something I don't get cause you didn't expended the explanation about this array structure, or there is something wrong with your class
I will appreciate your quick response
How do I encode the XML data (lets say I already put it on string) into Base64 encoded chunks - array of strings?
I started to write a code using your web service class to automate the import of the XML file.
The export into an XML file is done by the YF Administration GUI - so no problem there.
The problem accrues when I try to turn the XML data into: "Array of Base64 encoded chunks of the XML import file" which is Array of strings".
Its in he first stage of the Import - GETIMPORTCONTENT. (page 47-48 on the webservice guide)
I tried to use base64 class of Apache server: http://commons.apache.org/proper/commons-codec/javadocs/api-release/org/apache/commons/codec/binary/Base64.html
but it brings array of bytes. (other classes does the same)
further more there is some kind of inconsistency because export method of ws_class- EXPORTCONTENT brings out A - "Array of ReportBinaryObject objects. These objects will hold the XML for exported artifacts" (not that I am using it!!!).
I am sure there is a easy way to conduct this base64 array of strings or there is something I don't get cause you didn't expended the explanation about this array structure, or there is something wrong with your class
I will appreciate your quick response
Hi,
Sorry for the delay.
Are you doing this in Java? If so you can use JSP here that will import a file for you.
(You'll need to update the first few line to point to the right Yellowfin instance. If you put this in your Yellowfin/appserver/webapps/ROOT directory, you can run it straight from your browser.)
However, with respect to the GETIMPORTCONTENT request.
The Parameters array is used for many service calls.
In the GETIMPORTCONTENT, you just need to put the file into the first element of the array.
Base64 encodes binary objects into a string. That string should be put into the array.
In Java we would do something like this:
byte[] data = xmlfile_string.getBytes("UTF-8");
String base64string = Base64.encodeBytes(data);
Then put it in the request:
rsr.setParameters( new String[] {base64string } );
We use a Base64 decoder/encoder based on this: http://iharder.sourceforge.net/current/java/base64/ but all encoders should generate the same output.
Hope that makes sense.
Regards,
David
Sorry for the delay.
Are you doing this in Java? If so you can use JSP here that will import a file for you.
(You'll need to update the first few line to point to the right Yellowfin instance. If you put this in your Yellowfin/appserver/webapps/ROOT directory, you can run it straight from your browser.)
However, with respect to the GETIMPORTCONTENT request.
The Parameters array is used for many service calls.
In the GETIMPORTCONTENT, you just need to put the file into the first element of the array.
Base64 encodes binary objects into a string. That string should be put into the array.
In Java we would do something like this:
byte[] data = xmlfile_string.getBytes("UTF-8");
String base64string = Base64.encodeBytes(data);
Then put it in the request:
rsr.setParameters( new String[] {base64string } );
We use a Base64 decoder/encoder based on this: http://iharder.sourceforge.net/current/java/base64/ but all encoders should generate the same output.
Hope that makes sense.
Regards,
David