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

J

JGH

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.
 
J

JGH

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->{$_}); }
}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top