in reply to pb with Soap::lite

You should start by creating the service object and then call the methods you want, and that are available on the contract (WSDL). In your example you are not showing what method you are calling.

#!/usr/bin/perl use strict; use warnings; use SOAP::Lite; my $service = SOAP::Lite -> service('http://url.wsdl'); # now call the login (?) method on the remote service # I am assuming the method you are attempting is Login my $tab = $service->call('Login' => @params_to_login);

As a suggestion, turn on debugging mode (use SOAP::Lite +trace => qw(method trace debug);) so that you can see the messages that are being passed between your client and the service, and also use Data::Dumper to explore the results you get from the method calls.

Replies are listed 'Best First'.
Re^2: pb with Soap::lite
by manuds (Initiate) on Feb 21, 2008 at 08:03 UTC
    sorry i forgot a piece of code... here it is :
    #!/usr/bin/perl use SOAP::Lite +trace; $login='log'; $passwd='pass'; $domain='dom' $tab = SOAP::Lite -> service('http://url.wsdl','login'=>$login,'password'=> $pass +wd,'exceptions'=>'1') ->getDomUsedQuota($domain); print "$tab\n";
    And herre is the php code... if it can help you (me not)
    <? $login='votre_login'; $passwd='votre_mot_de_passe'; $domain='votre_domaine'; <code> $client = new SoapClient('https://url.wsdl',array('login'=> $login,'pa +ssword'=> $passwd,'exceptions'=>'1')); $used_quota=$client->getDomUsedQuota($domain); print "Le quota consommé est $used_quota <br>"; ?>
    I try "+trace", but it doesn't help me... i'm too novice in perl and soap... ;-) Thanks in advance

      If you try to access the service using basic authentication, then you might try adding the code below to provide the auth info when requested.

      ... sub SOAP::Transport::HTTP::Client::get_basic_credentials { return 'username' => 'password'; } my $service = SOAP::Lite -> service('http://url.wsdl'); ...
        thanks but it still not work... i have ab authentification error... i try this :
        #!/usr/bin/perl use SOAP::Lite +trace; $login='log'; $passwd='passwd'; $domain='dom'; sub SOAP::Transport::HTTP::Client::get_basic_credentials { return $login => $passwd; } $tab = SOAP::Lite -> service('http://url.wsdl') ->getDomUsedQuota($domain); ...
        I've got an authentification error... I think it's almost this ...