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

writing a SOAP perl program

Expand Messages
  • Justin Zygmont
    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
    Message 1 of 2 , Jul 13, 2006
      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,
    • Ger Apeldoorn
      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,
      Message 2 of 2 , Jul 13, 2006
        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,
      Your message has been successfully submitted and would be delivered to recipients shortly.