CAM-SOAPClient

 view release on metacpan or  search on metacpan

lib/CAM/SOAPClient.pm  view on Meta::CPAN

   my $schema = SOAP::Schema->can('schema_url') ?
       SOAP::Schema->schema_url($url) :
       SOAP::Schema->schema($url);
   my $services = $schema->parse()->services();
   #use Data::Dumper; print STDERR Dumper($services);

   foreach my $class (values %{$services})
   {
      foreach my $method (keys %{$class})
      {
         my $endpoint = $class->{$method}->{endpoint};
         # 'uri' was used thru SOAP::Lite v0.60, 'namespace' is used in v0.65+
         my $namespace = $class->{$method}->{uri} ? $class->{$method}->{uri}->value() : $class->{$method}->{namespace};
         $self->{proxies}->{$method} = $endpoint ? $endpoint->value() : undef;
         $self->{uris}->{$method} = $namespace;
      }
   }

   return $self;
}

=item $self->setURI($uri)

Specifies the URI for the SOAP server.  This is not needed if you are

t/client.t  view on Meta::CPAN

   my $spaths = Data::Dumper->new([$paths])->Terse(1)->Indent(0)->Dump();
   my $response = $obj->call('null', $paths);
   is_deeply($response, $test->{scalar}, "call scalar $spaths");
   $response = [$obj->call('null', $paths)];
   is_deeply($response, $test->{array},  "call array  $spaths");

   #print Dumper($obj->getLastSOM());
}

$obj = CAM::SOAPClient->new(wsdl => 'file:t/test.wsdl');
is($obj->{proxies}->{test}, 'http://www.foo.com/test.cgi', 'WSDL test - endpoint');
is($obj->{uris}->{test}, 'http://foo.com/test', 'WSDL test - uri');

is(CAM::SOAPClient->new(), undef, 'no uri specified');
isnt(CAM::SOAPClient->new('http://localhost'), undef, 'no proxy specified');
is_deeply({CAM::SOAPClient->new('http://localhost', undef, 'user', 'pass')->loginParams()}, {username => 'user', password => 'pass'}, 'username and password');

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.095 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )