SOAP::Lite, calling apache/axis demo web service

Discussion in 'Perl Misc' started by JGH, Jul 20, 2004.

  1. JGH

    JGH Guest

    Has anyone installed apache/axis and then used SOAP::Lite to talk to the
    demo app they include?

    I went all the way through the axis installation instructions at
    http://ws.apache.org/axis/java/install.html.
    I was able to run the stock quote demo and got back the correct result
    (55.25). If I go to
    http://localhost:8080/axis/servlet/AxisServlet,
    I get a page that says, "And now some services" and I can see the
    services listed there including the following:

    * urn:xmltoday-delayed-quotes (wsdl)
    * test
    * getQuote

    now, however, I want to call it from perl. But I can't get it to return
    anything. My code is below. Is there some place where they document how
    to call
    this service?

    #!/usr/bin/perl
    use SOAP::Lite;

    print "The SOAP Server says: ";
    print SOAP::Lite
    -> uri('urn:xmltoday-delayed-quotes')
    -> proxy('
    http://localhost:8080/axis/servlet/AxisServlet')
    -> getQuote('user1', 'XXX')
    -> result . "\n\n";

    --
    John G. Heim
    University of Wisconsin - Division of Information Technology (DoIT)
    1210 West Dayton St, #4297, Phone: 2-9887

    To boldly code what no one has coded before.
     
    JGH, Jul 20, 2004
    #1
    1. Advertising

  2. JGH

    JGH Guest

    JGH <> wrote in news:cdjvls$p5l$1
    @news.doit.wisc.edu:

    > Has anyone installed apache/axis and then used SOAP::Lite to talk to

    the
    > demo app they include?


    Okay, I got it working:

    #!/usr/bin/perl
    use SOAP::Lite;

    my $lite = SOAP::Lite->new;

    $response = $lite
    ->proxy('http://localhost:8080/axis/servlet/AxisServlet')
    -> uri('urn:xmltoday-delayed-quotes')
    -> getQuote('XXX');
    print "[" . $response->result . "]\n";
    die "Fault: ".$response->faultcode." ".$response->faultdetail." ".
    $response->faultstring if $response->faultcode;

    # Overwrite the a SOAP::Lite function returning proper credentials for
    the SOAP server you are talking to...
    sub SOAP::Transport::HTTP::Client::get_basic_credentials
    { return 'user1' => 'pass1'; }

    {
    my $hash = shift;

    print ("\n------------------\n");
    foreach (sort keys %$hash)
    { printf ("%-20.20s : %s\n", $_, $hash->{$_}); }
    }
     
    JGH, Jul 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Elhanan Maayan
    Replies:
    0
    Views:
    867
    Elhanan Maayan
    May 3, 2004
  2. Replies:
    0
    Views:
    967
  3. hocho888
    Replies:
    1
    Views:
    665
  4. Replies:
    0
    Views:
    1,085
  5. Aaron Brady

    SQL, lite lite lite

    Aaron Brady, Dec 29, 2008, in forum: Python
    Replies:
    15
    Views:
    783
    Aaron Brady
    Jan 1, 2009
Loading...

Share This Page