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

5496Re: [soaplite] writing a SOAP perl program

Expand Messages
  • Ger Apeldoorn
    Jul 13, 2006
    • 0 Attachment
      Hi Justin,

      Funny, thats exactly what i'm wrestling with currently. I found that Oxygen
      (commercial, Windows/Linux/Mac too i think) has a WSDL debugging tool, which
      is extremely handy.

      It can generate the soap calls conform a given WSDL and you can see the
      response. Very nice.

      Here's my current code (under heavy construction)
      --------------------%<------------------------
      #!/usr/bin/perl -w
      use strict;
      use warnings;
      use SOAP::Transport::HTTP;
      use SOAP::Lite;


      SOAP::Transport::HTTP::CGI
      -> dispatch_to('MyPackage')
      -> handle( );

      BEGIN{
      package MyPackage;

      use vars qw(@ISA);
      @ISA = qw(SOAP::Server::Parameters);
      sub new
      {
      my $class = shift;
      my $self = {};
      bless ($self, $class);
      }

      sub MapInfo #element
      {
      my ($class, $f) = @_; #you will get a hash in $f with all the values. If
      # values are nested, a hash of hashes.
      my %output = ();
      # The response is a hash too.

      $output->{'trlon'} = $f->{'topRight'}->{'wgs84Longitude'};
      $output->{'trlat'} = $f->{'topRight'}->{'wgs84Latitude'};
      return SOAP::Data->name("out" => %output);
      }
      }
      --------------------%<------------------------

      Please keep me posted of your achievements, perhaps we can help each other! :)

      Ger.


      Op donderdag 13 juli 2006 22:07, schreef u:
      > Hi, i'm trying to write a perl program using SOAP with a remote system.
      > The remote side already has a WDSL file, and i'm wondering if anyone has
      > an example how to make use of it in my script? My script should be fairly
      > simple, since all I really have to do is pass a few variables to
      > the remote system and take the response. This is my first time to do
      > something like this, and i'm not even sure if SOAP::lite or SOAP::WSDL is
      > what I should learn to use. Any help would be appreciated,
      >
      > Thanks,
    • Show all 2 messages in this topic