You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ws.apache.org by Brad Karp <bk...@cs.ucl.ac.uk> on 2006/04/11 14:39:22 UTC
zero-length base64 data types in XML-RPC 3?
Greetings.
I'm using Apache XML-RPC 3 to write a Java client that talks to a
server that expects a parameter of type:
<param><value><base64></base64></value></param>
(That is, a parameter that's of type base64, but zero-length.)
How do I convince XML-RPC 3 to generate that XML output?
I've tried:
...
byte[] pm = "".getBytes();
...
Object[] params = new Object[]{ID, vals, pm, app};
try {
Object[] result = (Object[]) client.execute("get", params);
} catch (org.apache.xmlrpc.XmlRpcException e) {
...
}
But that dies:
Exception in thread "main" java.lang.IllegalArgumentException: The buffer must contain at least 4 characters, but has 0
at org.apache.ws.commons.util.Base64$Encoder.<init>(Base64.java:138)
at org.apache.ws.commons.util.Base64$SAXEncoder.<init>(Base64.java:300)
at org.apache.xmlrpc.serializer.ByteArraySerializer.write(ByteArraySerializer.java:39)
at org.apache.xmlrpc.serializer.XmlRpcWriter.writeValue(XmlRpcWriter.java:144)
at org.apache.xmlrpc.serializer.XmlRpcWriter.write(XmlRpcWriter.java:74)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.writeRequest(XmlRpcStreamTransport.java:283)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:207)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)
at get.main(get.java:32)
Many thanks,
-Brad, bkarp@cs.ucl.ac.uk
Re: zero-length base64 data types in XML-RPC 3?
Posted by Jochen Wiedmann <jo...@gmail.com>.
On 4/11/06, Brad Karp <bk...@cs.ucl.ac.uk> wrote:
> (That is, a parameter that's of type base64, but zero-length.)
<action dev="jochen" type="fix" due-to="Brad Karp"
due-to-email="bkarp@cs.ucl.ac.uk">
The Base64 encoder doesn't accept buffers of length 0. Such a buffer
was passed, if the byte array to encode has itself length 0.
</action>
--
Whenever you find yourself on the side of the
majority, it is time to pause and reflect.
(Mark Twain)