3
I have the following code:
$url_data = "http://localhost:8080/sistema/webservice/agenda/consultarHorariosDisponiveis";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt( $ch, CURLOPT_URL, $url_data);
curl_setopt ($ch, CURLOPT_POST, true);
$parametros = array(
"idUnidade" => '3',
"intervaloDuracao" => '10',
"dataInicio" => "02/08/2016",
"dataFim" => "04/08/2016",
"horaInicio" => "08:00",
"horaFim" => "22:00"
);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $parametros);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
curl_close($ch);
Testing the webservice with a program Soapui is working well, however, when I try to get a return with php with this code, in the console of my application in java, is giving Nullpointer, at first the parameters are not going correctly, then I believe it’s just a detail in my code, some suggestion?
I don’t understand your signage, if I may say thank you.
– Math