You are not logged in.

PaulP

Beginner

  • "PaulP" started this thread

Posts: 9

Date of registration: Nov 5th 2012

  • Send private message

1

Monday, November 5th 2012, 4:09pm

how to pass a byte[] datatype to a java function ?

Hello everyone,

I am trying to make a xml-rpc call using org.apache.xmlrpc.XmlRpcClient.
(jar is at http://repo1.maven.org/maven/xmlrpc/jars/xmlrpc-1.2-b1.jar)

I need to pass a parameter as a base64 encoded String.

To do so, the XmlRpcClient needs the string to be seen as a byte[] type so I ended to write the following :

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
Dim TheClient As New org#apache#xmlrpc#XmlRpcClient("http://someserver.x.com") 
Dim TheParams As New java#util#Vector 
Dim element  As java#lang#String 
Dim mybaos As java#io#ByteArrayOutputStream 

element = "String to pass"
mybaos.write(element.getBytes) 
TheParams.addElement(mybaos.toByteArray())

 TheResult = TheClient.execute("nameoffunction",TheParams) 

MsgBox(TheResult)


I get the message "Method "addElement" not found with this parameters."

Is there any way to pass a byte[] type to a java function ?

Rate this thread
WoltLab Burning Board