Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] how to use base64

Expand Messages
  • Dave Howorth
    ... As far as I can tell, the method proposed above as recommended in the POD doesn t work. It s beyond my skill and time to understand exactly what s going on
    Message 1 of 2 , Aug 22, 2006
    • 0 Attachment
      I wrote:
      > I'm trying to use base64 encoding. I figure that it is one possible
      > solution to my previous issue of invalid tokens, and the doc says it may
      > be faster as well. But I haven't figured out how to make it work...
      >
      > I'm trying to use the method suggested of adding:
      >
      > *SOAP::Serializer::as_string = \&SOAP::Serializer::as_base64;
      >
      > I've added that line in both my client and server setup. When I run a
      > test, my client reports an error:
      >
      > --- SOAP:CLIENT FAULT ---
      > Type 'base64' can't be found in a schema class 'SOAP::Serializer'
      > at /home/dhoworth/tmp/SOAP/Lite.pm line 114
      >
      > (line number may be off slightly since I've added some debugging printout)

      As far as I can tell, the method proposed above as recommended in the
      POD doesn't work. It's beyond my skill and time to understand exactly
      what's going on in SOAP::Lite but it appears that the above is fouled up
      by AUTOLOAD complexities.

      But I have managed to make SOAP::Lite encode everything as base64. On
      the server after:

      my $daemon = SOAP::Transport::HTTP::Daemon->new( ...args...);

      I added:

      my $serializer = $daemon->serializer;
      $serializer->typelookup->{fudge} =
      [ 9, sub { 1 }, 'as_base64Binary' ];

      On the client, after:

      use SOAP::Lite ...args...;

      I added:

      my $serializer = SOAP::Lite->serializer;
      $serializer->typelookup->{fudge} =
      [ 9, sub { 1 }, 'as_base64Binary' ];

      I think it would probably be better to completely replace the typelookup
      hash because SOAP::Lite appears to sort it every time it encodes a
      scalar :( But I haven't got that far yet.

      Using base64 does seem to solve my 'invalid token' problem.

      Cheers, Dave
    Your message has been successfully submitted and would be delivered to recipients shortly.