ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Karp <bk...@cs.ucl.ac.uk>
Subject zero-length base64 data types in XML-RPC 3?
Date Tue, 11 Apr 2006 12:39:22 GMT
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

Mime
View raw message