views:

146

answers:

2
+1  Q: 

SOAP::Lite in Perl

I am new with Perl. I'm following a bioinformatics webapi and I'm attempting to simply display the value stored in $result. My print "$result\n"; command doesn't appear to be functioning. What are some possibilities as to what is going on here?

# #!/usr/local/bin/perl
use strict;

# 1. include SOAP Lite 
use SOAP::Lite;

# 2. specifies WSDL file
my $service = SOAP::Lite -> service('http://xml.nig.ac.jp/wsdl/GetEntry.wsdl');

# 3. call SOAP service
my $result = $service->getXML_DDBJEntry("AB000003");

print "$result\n";
A: 

Open the URL from your code in a browser and try a find "AB000003" via the browser search function.
For me I can not find the text - thus empty/undef is the logical result.

weismat
This answer is not helpful. There is a `getXML_DDBJEntry` operation defined and there's no way to tell from the document whether `AB000003` is a valid input for that operation or not.
mobrule
My guess is and was that AB000003 is a valid input, but does not yield a result. Otherwise you should find the string literal in the XML file.
weismat
weismat
+1  A: 

As I recall, $result is an object; Try:

use Data::Dumper;
print Dumper($result), "\n";

This may help you determine what is going on.

Ricky Morse
$VAR1 = undef; is returned in terminal
JZ
Try changing your use statement to be like: `use SOAP::Lite +trace => 'debug';` . This will allow you to see everything that is getting sent and received, which may show you where things are going wrong.
Ricky Morse