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

Re: [soaplite] SOAP::Lite serializer error?

Expand Messages
  • simon.fairey@ft.com
    Thanks but the problem is (and I should have mentioned it) that I m using Apache::SOAP so have no access to the SOAP object within my code as that s the beauty
    Message 1 of 3 , Mar 10, 2003
    • 0 Attachment
      Thanks but the problem is (and I should have mentioned it) that I'm using Apache::SOAP so have no access to the SOAP object within my code as that's the beauty of the Apache::SOAP the server is automagically created with a few lines in the httpd.conf then my module is a simple Perl module with no knowledge of soap. I have found some info on the serializer and came up with the following:

      use SOAP::Lite;

      my $s = new SOAP::Lite;
      $s->typelookup->{longint} = [15, sub { $_[0] =~ /^[+-]?\d+$/ }, 'as_longint'];

      sub SOAP::Serializer::as_longerint {
        my $self = shift;
        my($value, $name, $type, $attr) = @_;
        if(length($value) > 8){
          return [$name, {'xsi:type' => 'xsd:string', %$attr}, $value];
        }else{
          return [$name, {'xsi:type' => 'xsd:int', %$attr}, $value];
        }
      }

      But can't seem to wedge it into the Apache as I've no idea where to wedge it :-(

      Si



      Martin Hajduch <martin.hajduch@...>

      10/03/2003 12:00

             
              To:        soaplite@yahoogroups.com
              cc:        
              Subject:        Re: [soaplite] SOAP::Lite serializer error?



      >  or should the correct method be to override the method as and when
      > you need to and in which case how do I go about doing that other than
      > editing SOAP::Lite?

      use SOAP::Data instead of scalars (it is like an envelope for data,
      where you can say which type should be used, and also attributes, etc. -
      man SOAP::Lite for more details)

      for example:

      SOAP::Data->name('arg'=>$value)->type('xsd:string')
      produces parameter with name 'arg', value $value and type xsd:string

      SOAP::Data->name('arg'=>$value)->type('xsd:int')
      produces the same as above, but the type is xsd:int

      regards,
      martin



      ------------------------ Yahoo! Groups Sponsor ---------------------~-->
      Get 128 Bit SSL Encryption!
      http://us.click.yahoo.com/xaxhjB/hdqFAA/xGHJAA/W6uqlB/TM
      ---------------------------------------------------------------------~->

      To unsubscribe from this group, send an email to:
      soaplite-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/






      **********************************************************************************
      This email may contain confidential material. If you were not an
      intended recipient, please notify the sender and delete all copies.
      We may monitor email to and from our network.
    Your message has been successfully submitted and would be delivered to recipients shortly.