Bonjour,
Je suis débutant en perl et en webservices (ça commence mal !) mais mon besoin est assez simple.
Un webservice est disponible pour récupérer l'id d'un utilisateur à partir de son login NT et j'essaie d'y faire appel depuis un script Perl. J'utilise Soap Lite mais je n'arrive pas à faire appel au webservice, malgré de nombreux tutoriels trouvés ici et là.
Mon script Perl:
Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| #########################################################################
# Script Name : NTLoginToUID.pl
# Goal : Get an UID from an NT login
# Args :
# Output :
# History :
#########################################################################
use SOAP::Lite;
my $soap = SOAP::Lite
-> uri('http://xxxxxxx/xxxxxxx/directory.asmx')
-> proxy('http://xxxxxxx/xxxxxxx/directory.asmx?wsdl');
my $method = SOAP::Data->name('GetUIDFromNTLogin');
my @params = ( SOAP::Data->name(NTLogin => '123456'));
print $soap->call($method => @params)->result; |
Dans la doc de la méthode j'ai :
Request:
Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| POST /xxxxxxx/directory.asmx HTTP/1.1
Host: xxxxxxx
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/GetUIDFromNTLogin"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetUIDFromNTLogin xmlns="http://tempuri.org/">
<NTLogin>string</NTLogin>
</GetUIDFromNTLogin>
</soap:Body>
</soap:Envelope> |
Response:
Code :
1 2 3 4 5 6 7 8 9 10 11 12
| HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetUIDFromNTLoginResponse xmlns="http://tempuri.org/">
<GetUIDFromNTLoginResult>string</GetUIDFromNTLoginResult>
</GetUIDFromNTLoginResponse>
</soap:Body>
</soap:Envelope> |
Quand je lance mon script, j'ai l'erreur suivante :
URI is not provided as an attribute for method (GetUIDFromNTLogin)
J'ai cherché sur le net, sur Developpez.net, mais je n'ai pas trouvé de solution... Toute piste serait extrêmement appréciée ! (Je bloque depuis un bout de temps déjà...)
Merci pour votre aide,
Will1v