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 SoapUI program is working fine, however, when I try to get a return with php with this code, in the console of my application in java, it is giving NullPointer, at first the parameters are not going correctly , so I think it's just a detail in my code, any suggestions?