0
using the phptester to test the following code:
<?phptry {
$opts = array(
'http' => array(
'user_agent' => 'PHPSoapClient'
)
);
$context = stream_context_create($opts);
$wsdlUrl = 'http://ws.portaledu.com.br:8051/wsConsultaSQL/MEX?wsdl';
$soapClientOptions = array(
"login" => "XxXxXxXx",
"password" => "XxXxXxXxX",
"stream_context" => $context,
"cache_wsdl" => WSDL_CACHE_NONE
);
$client = new SoapClient($wsdlUrl, $soapClientOptions);
echo $status =(string) simplexml_load_string($client->RealizarConsultaSQL(['codSentenca'=>'06','codColigada'=>$CODCOLIGADA,'codSistema'=>'S','parameters'=>'CODCOLIGADA='.$CODCOLIGADA.';IDPS='.$IDPS.';CPF='.$CPF.';DTNASCIMENTO='.$DTNASCIMENTO])->RealizarConsultaSQLResult)->Resultado->DESCRICAO;
}
catch(Exception $e) {
echo $e->getMessage();
}
get back:
WARNING Soapclient::Soapclient(http://ws.portaledu.com.br:8051/wsConsultaSQL/MEX? wsdl): failed to open stream: Connection refused on line number 17
Why not authenticate, will need to release some more port beyond 8051 to make SOAP requests?
the tip was very good, but let me complete the question so that we mark this answer once and for all as a solution,.
– Milrak Pereira Pessoa
that your echo seems a bit strange... I’ll copy it and try to understand
– Michel Simões
It is a bit confusing even, however, the goal is: send a request
SOAP
for thiswsdl
I have already mentioned above, and call the functionRealizarConsultaSQL()
and show on the screen your return!– Milrak Pereira Pessoa
I suggest solving one problem at a time... give an echo on the return first and when you are returning what you expect to leave just for the function, then it is more organized the reasoning. About display the largest, depending on how the return comes you can transform into array and just choose the largest of the list.
– Michel Simões
I understand, but it helps me understand here, because this code did not return me error, let alone xml (did not return anything), as I will do the request for the
RealizarConsultaSQL()
– Milrak Pereira Pessoa
in fact the xml ta returning until qdo I lap right into the browser, then by the CURL tmb will be! from there you just need to process the return of it.
– Michel Simões
Try to understand this process and how it generates your code to consume the service: https://code.google.com/archive/p/php-wsdl-creator/
– Michel Simões