Bonjour,

J'espère étre dans la bonne rubrique pour vous exposer mon problème.

Voilà je cherche à travers un script en php à communiquer avec un web service.
Les spécificité sont : j'utilise une authentification NTLM au lieu d'une authentification basique.

Voici mon script :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
 
class NTLMSoapClient extends SoapClient {
	function __doRequest($request, $location, $action, $version) {
		$headers = array(
			'Method: POST',
			'Connection: Keep-Alive',
			'User-Agent: PHP-SOAP-CURL',
			'Content-Type: text/xml; charset=utf-8',
			'SOAPAction: &quot;'.$action.'&quot;',
		);
		$this->__last_request_headers = $headers;
		$ch = curl_init($location);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
		curl_setopt($ch, CURLOPT_POST, true );
		curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
		curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
		curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
		curl_setopt($ch, CURLOPT_USERPWD, $this->UserName.':'.$this->Password);
		$response = curl_exec($ch);
		return $response;
	}
	function __getLastRequestHeaders() {
		return implode("\n", $this->__last_request_headers)."\n";
	}
}
 
class ExchangeNTLMSoapClient extends NTLMSoapClient 
	{ 
		protected $UserName = 'mon.login@mail'; 
		protected $Password = 'monpassword'; 
	}
 
class NTLMStream {
	private $path;
	private $mode;
	private $options;
	private $opened_path;
	private $buffer;
	private $pos;
 
	public function stream_open($path, $mode, $options, $opened_path) {
		$this->path = $path;
		$this->mode = $mode;
		$this->options = $options;
		$this->opened_path = $opened_path;
		$this->createBuffer($path);
		return true;
	}
 
	public function stream_close() {
		curl_close($this->ch);
	}
 
	public function stream_read($count) {
		if(strlen($this->buffer) == 0) {
			return false;
		}
		$read = substr($this->buffer,$this->pos, $count);
		$this->pos += $count;
		return $read;
	}
 
	public function stream_write($data) {
		if(strlen($this->buffer) == 0) {
			return false;
		}
		return true;
	}
 
	public function stream_eof() {
		if($this->pos > strlen($this->buffer)) {
			return true;
		}
		return false;
	}
 
	public function stream_tell() {
		return $this->pos;
	}
 
	public function stream_flush() {
		$this->buffer = null;
		$this->pos = null;
	}
 
	public function stream_stat() {
		$this->createBuffer($this->path);
		$stat = array(
			'size' => strlen($this->buffer),
		);
		return $stat;
	}
 
	public function url_stat($path, $flags) {
		$this->createBuffer($path);
		$stat = array(
			'size' => strlen($this->buffer),
		);
 
		return $stat;
	}
 
	private function createBuffer($path) {
		if($this->buffer) {
			return;
		}
		$this->ch = curl_init($path);
		curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($this->ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
		curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
		curl_setopt($this->ch, CURLOPT_USERPWD, $this->UserName.':'.$this->Password);
		$this->buffer = curl_exec($this->ch);
		$this->pos = 0;
	}
}
 
class ExchangeNTLMStream extends NTLMStream 
	{ 
		protected $UserName = 'mon.login@mail'; 
		protected $Password = 'monpassword'; 
	}
 
stream_wrapper_unregister('http');
stream_wrapper_register('http', 'ExchangeNTLMStream') or die("Failed to register protocol"); 
$client = new ExchangeNTLMSoapClient("http://www.monwebservice/wseditic/wscheck.asmx?WSDL",
								array( 'soap_version'	=> SOAP_1_2));
$params = array (
	'Login' =>'{mon.login@mail}');
$rawXMLresponse = $client->GetApprenant($params)->GetApprenantResult->any;
stream_wrapper_restore('http');
?>
Je fais appel ici à une fonction banale "GetApprenant" pour testé que mon script marche. Il devrait donc me retourné toutes les informations concernant l'apprenant mis en paramètre, hors lors de l'execution de celui-ci, il me retourne l'erreur suivante:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
"Fatal error: Uncaught SoapFault exception: [soap:Client] Le serveur n'a pas reconnu la valeur de l'en-tête HTTP SOAPAction : "http://si.rouenbs.fr/GetApprenant". in C:\wamp\www\LienWebServiceNTLM1.php:171 Stack trace: #0 C:\wamp\www\LienWebServiceNTLM1.php(171): SoapClient->__call('GetApprenant', Array) #1 C:\wamp\www\LienWebServiceNTLM1.php(171): ExchangeNTLMSoapClient->GetApprenant(Array) #2 {main} thrown in C:\wamp\www\LienWebServiceNTLM1.php on line 171"
Une Idée sur la cause ?

Merci d'avance,