in reply to Re^2: Force integer to occupy 64 bits (bytes)
in thread Force integer to occupy 64 bits

It wants bytes as long (int64) type.

But that isn't bytes, it doesn't say byte order (little or big endian). Have you see pack?
pack'q<', $d64
pack 'q>', $d64

  • Comment on Re^3: Force integer to occupy 64 bits (bytes)

Replies are listed 'Best First'.
Re^4: Force integer to occupy 64 bits (bytes)
by yuhang91 (Initiate) on Jul 29, 2013 at 10:23 UTC
    Thanks for the suggestions, really appreciate it! I've tried using pack but the returned data type still doesn't match that required by the web service, regardless of byte order. I get the error org.xml.sax.SAXException: Bad types (class [B -> long).

    So far, the only case where I don't receive the "Bad types" error is when I supply an integer greater than 2,147,483,647, which is the maximum value of a 32int. It seems that Perl is dynamically assigning the size of the integer depending on the value and I have no control over it. The web service, on the other hand, is in Java, and doesn't seem to accept anything other than the long that it demands!

    I guess I will explore other options to avoid this challenge.