Passing huge double arrays in XML-RPC

Z

zapata

I am trying to call a server from a Perl client using the Frontier XML-RPC
package, and need to pass large (huge) double float arrays back and forth.
It looks as if base64 is the format to use, but I am too new to Perl to
figure out how to do the encoding and decoding.

If I have an array @array with thousands of double precision IEEE floats,
what is the coding sequence to get it to base64 and back???

Any help is appreciated, except RTFM, which I have already done.
 
M

Matija Papec

X-Ftn-To: zapata

zapata said:
It looks as if base64 is the format to use, but I am too new to Perl to
figure out how to do the encoding and decoding.

If I have an array @array with thousands of double precision IEEE floats,
what is the coding sequence to get it to base64 and back???

Did you try something already? You don't have to look at base64 for these
calls are transparent to your program.
 
Z

zapata

Matija Papec said:
X-Ftn-To: zapata



Did you try something already? You don't have to look at base64 for these
calls are transparent to your program.

Whren I pass an array with doubles, I see from my port sniffer that it is
coded in XML in long hand, i.e. the doubles are converted to ASCII strings,
and enveloped with each number getting its own wrapper.
I lose the absolute bit patterns of the doubles, and the data being passed
gets bulky.

my @zap = (1.23, 4.23, 3, 44.2e-3, -1.1);
$result = $server->call('PassArray', \@zap);

POST /Helper.rem HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost:8000
User-Agent: libwww-perl/5.79
Content-Type: text/xml
Content-Length: 349

<?xml version="1.0"?>
<methodCall>
<methodName>PassArray</methodName>
<params>
<param><value><array><data>
<value><double>0.0517676767676768</double></value><value><double>4.23</double></value><value><i4>3</i4></value><value><double>0.0442</double></value><value><double>-1.1</double></value></data></array></value>
</param>
</params>
</methodCall>
 
M

Matija Papec

X-Ftn-To: zapata

zapata said:
Whren I pass an array with doubles, I see from my port sniffer that it is
coded in XML in long hand, i.e. the doubles are converted to ASCII strings,
and enveloped with each number getting its own wrapper.
I lose the absolute bit patterns of the doubles, and the data being passed
gets bulky.

I think that problem isn't RPC related (compare Dumper \@zip before and
after rpc call), but you can force doubles to be sent as strings
($server->string) if you want to sprintf them first?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top