package AWSECommerceService;

# -- generated by SOAP::Lite (v0.55) for Perl -- soaplite.com -- Copyright (C) 2000-2001 Paul Kulchenko --
# -- generated from http://webservices.amazon.com/AWSECommerceService/DE/AWSECommerceService.wsdl [Mon Jul 18 03:30:39 2005]

my %methods = (
  ListLookup => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  CartGet => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  SellerListingLookup => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  CustomerContentLookup => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  ItemLookup => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  SimilarityLookup => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  SellerLookup => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  MultiOperation => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  ItemSearch => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  BrowseNodeLookup => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  CartModify => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  ListSearch => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  CartClear => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  CustomerContentSearch => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  CartCreate => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  TransactionLookup => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  SellerListingSearch => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  CartAdd => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
  Help => {
    endpoint => 'http://soap.amazon.de/onca/soap?Service=AWSECommerceService',
    soapaction => 'http://soap.amazon.com',
    uri => '',
    parameters => [
      SOAP::Data->new(name => 'body', type => '', attr => {}),
    ],
  },
);

use SOAP::Lite;# +trace => qw(all);
use Exporter;
use Carp ();

use vars qw(@ISA $AUTOLOAD @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter SOAP::Lite);
@EXPORT_OK = (keys %methods);
%EXPORT_TAGS = ('all' => [@EXPORT_OK]);

no strict 'refs';
for my $method (@EXPORT_OK) {
  my %method = %{$methods{$method}};
  *$method = sub {
    my $self = UNIVERSAL::isa($_[0] => __PACKAGE__) 
      ? ref $_[0] ? shift # OBJECT
                  # CLASS, either get self or create new and assign to self
                  : (shift->self || __PACKAGE__->self(__PACKAGE__->new))
      # function call, either get self or create new and assign to self
      : (__PACKAGE__->self || __PACKAGE__->self(__PACKAGE__->new));
    $self->proxy($method{endpoint} || Carp::croak "No server address (proxy) specified") unless $self->proxy;
    my @templates = @{$method{parameters}};
    my $som = $self
      -> endpoint($method{endpoint})
      -> uri($method{uri})
      -> on_action(sub{qq!"$method{soapaction}"!})
      -> call($method => map {@templates ? shift(@templates)->value($_) : $_} @_); 
    UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall : $som->result 
                                        : $som;
  }
}

sub AUTOLOAD {
  my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2);
  return if $method eq 'DESTROY';

  die "Unrecognized method '$method'. List of available method(s): @EXPORT_OK\n";
}

1;

