Hi I have to build a soap client to make request to: https://api.edu.gov.pt/services/e360/listStudentCodes?wsdl Here is my Code:
$Username="********";
$PAssword="********";
$anolectivo=2017;
$CodEscola=123456;
$Codes="https://api.edu.gov.pt/services/e360/listStudentCodes?wsdl";
$options = array(
'login' => $Username,
'password' => $password,
'exceptions' => false,
'trace' => 1
,'stream_context' => stream_context_create(array('ssl'=>array('verify_peer'=>false,'verify_peer_name'=>false, 'allow_self_signed' => true)))
);
try{
$client = new SoapClient($Codes,$options);
$result = $client->__soapCall("ListarCodigosAlunos",array('AnoLetivo' => $anolectivo,'CodigoAgrupamento' => $CodEscola,'CodigoEscola' => $CodEscola),$options);
if (is_soap_fault($result)) {
trigger_error("Error SOAP: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR);
}else print_r($result);
} catch (Exception $e) {
echo "<h2>Exception Error!</h2>";
echo $e->getMessage();
}
but All i get is:
Fatal error: SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://www.w3.org/2006/05/addressing/wsdl' in E:\xampp\htdocs\SOAP\test.php on line 34
i manage to go down to
SoapFault Object
(
[message:protected] => Wrong Version
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => E:\xampp\htdocs\SOAP\e360T2.php
[line:protected] => 46
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => E:\xampp\htdocs\SOAP\e360T2.php
[line] => 46
[function] => __soapCall
[class] => SoapClient
[type] => ->
[args] => Array
(
[0] => ListarCodigosAlunos
[1] => Array
(
[AnoLetivo] => 2018
[CodigoAgrupamento] => 400324
[CodigoEscola] => 400324
)
'verify_peer'=>false,'verify_peer_name'=>false, 'allow_self_signed' => true
This is very bad practice. Configure your server properly. – miken32