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

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

am 06.07.2007 15:36:50 von John

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/rpcroute r');

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

Regards
John

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

am 06.07.2007 21:10:23 von Mark Clements

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/rpcroute r');
>
> 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.ws dl);
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

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

am 12.07.2007 19:41:43 von John

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






"Mark Clements" wrote in message
news:468e939b$0$27398$ba4acef3@news.orange.fr...
> 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/rpcroute r');
>>
>> 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.ws dl);
> 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