Click here to get back home

SOAP::Lite - is Barnes and Noble web service still active?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
SOAP::Lite - is Barnes and Noble web service still active? John 07-06-2007
Posted by John on July 6, 2007, 9:36 am
Please log in for more thread options


Hi

The following worked several years ago but not now.
Whatever ISBN I use I get -1.0 (No such number).
Just wondering whether the Barnes & Noble price check service is still
active?

my $soap = SOAP::Lite
-> uri('urn:xmethods-BNPriceCheck')
-> proxy('http://services.xmethods.net:80/soap/servlet/rpcrouter');

my $isbn='0465051359';
my $price=$soap->getPrice(SOAP::Data->type(string => $isbn));
print $price->result;

Regards
John



Posted by Mark Clements on July 6, 2007, 3:10 pm
Please log in for more thread options


John wrote:
> Hi
>
> The following worked several years ago but not now.
> Whatever ISBN I use I get -1.0 (No such number).
> Just wondering whether the Barnes & Noble price check service is still
> active?
>
> my $soap = SOAP::Lite
> -> uri('urn:xmethods-BNPriceCheck')
> -> proxy('http://services.xmethods.net:80/soap/servlet/rpcrouter');
>
> my $isbn='0465051359';
> my $price=$soap->getPrice(SOAP::Data->type(string => $isbn));
> print $price->result;
>
The test page is working:

http://www.abundanttech.com/WebServices/bnprice/bnprice.asmx?op=GetBNQuote

with the ISBN from

http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&EAN=9780596002060&itm=3

mark@owl:~$ cat barnesnoblepricesoap.pl
use strict;
use warnings;

use constant URL =>
q(http://www.abundanttech.com/webservices/bnprice/bnprice.wsdl);
use constant SERVICENAME => q(BNPrice);
use constant PORTNAME => q(BNPriceSoap);
use constant OPERATIONNAME => q(GetBNQuote);

use Data::Dumper;
use SOAP::WSDL;

my $isbn = shift;
my $no_dispatch = shift;

my $soap = SOAP::WSDL->new( wsdl => URL , no_dispatch => $no_dispatch);

$soap->wsdlinit( caching => 1 , );
$soap->on_action( sub { sprintf '"%s/%s"', shift || '', shift },
);

$soap->servicename(SERVICENAME);
$soap->portname(PORTNAME);

my %args =
( sISBN => $isbn );
my $som = $soap->call(OPERATIONNAME , %args );

if($som->fault){
die $som->faultstring();
}

print $som->result()."\n";

mark@owl:~$ perl barnesnoblepricesoap.pl 0596002068
39.95
mark@owl:~$

WSDL is your friend :)

The on_action line is necessary (as far as I can tell) to get SOAP::Lite
to work with a .NET web service.

Mark

Mark

Posted by John on July 12, 2007, 1:41 pm
Please log in for more thread options


Hi

Back at my desk. Thanks. This is a different approach to the one I used a
while ago.
I need to look at this SOAP:WSDL as it appears to solve the problem although
I thought
Perl (and SOAP) had not developed a decent WSDL protocol but things must
have changed..

Thanks again. Much appreciated.

Regards
John






> John wrote:
>> Hi
>>
>> The following worked several years ago but not now.
>> Whatever ISBN I use I get -1.0 (No such number).
>> Just wondering whether the Barnes & Noble price check service is still
>> active?
>>
>> my $soap = SOAP::Lite
>> -> uri('urn:xmethods-BNPriceCheck')
>> -> proxy('http://services.xmethods.net:80/soap/servlet/rpcrouter');
>>
>> my $isbn='0465051359';
>> my $price=$soap->getPrice(SOAP::Data->type(string => $isbn));
>> print $price->result;
>>
> The test page is working:
>
> http://www.abundanttech.com/WebServices/bnprice/bnprice.asmx?op=GetBNQuote
>
> with the ISBN from
>
>
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&EAN=9780596002060&itm=3
>
> mark@owl:~$ cat barnesnoblepricesoap.pl
> use strict;
> use warnings;
>
> use constant URL =>
> q(http://www.abundanttech.com/webservices/bnprice/bnprice.wsdl);
> use constant SERVICENAME => q(BNPrice);
> use constant PORTNAME => q(BNPriceSoap);
> use constant OPERATIONNAME => q(GetBNQuote);
>
> use Data::Dumper;
> use SOAP::WSDL;
>
> my $isbn = shift;
> my $no_dispatch = shift;
>
> my $soap = SOAP::WSDL->new( wsdl => URL , no_dispatch => $no_dispatch);
>
> $soap->wsdlinit( caching => 1 , );
> $soap->on_action( sub { sprintf '"%s/%s"', shift || '', shift },
> );
>
> $soap->servicename(SERVICENAME);
> $soap->portname(PORTNAME);
>
> my %args =
> ( sISBN => $isbn );
> my $som = $soap->call(OPERATIONNAME , %args );
>
> if($som->fault){
> die $som->faultstring();
> }
>
> print $som->result()."\n";
>
> mark@owl:~$ perl barnesnoblepricesoap.pl 0596002068
> 39.95
> mark@owl:~$
>
> WSDL is your friend :)
>
> The on_action line is necessary (as far as I can tell) to get SOAP::Lite
> to work with a .NET web service.
>
> Mark
>
> Mark



Similar ThreadsPosted
SOAP::Lite with large web service payloads January 10, 2006, 12:42 pm
SOAP::Lite installation: mod_perl not active September 8, 2004, 3:19 am
SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring November 5, 2004, 8:45 pm
SOAP::Lite WSDL method with multiple soap:body parts February 16, 2005, 3:32 pm
Writing a HTML/ASP SOAP client for a SOAP::Lite destination March 16, 2005, 5:19 pm
Help with SOAP::Lite January 19, 2005, 11:35 pm
SOAP::Lite March 3, 2005, 6:13 am
Using SOAP::Lite and .NET November 16, 2005, 2:12 pm
SOAP::Lite March 5, 2007, 4:26 am
use SOAP::Lite +autodispatch ??? November 23, 2004, 3:12 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap