Código PHP:
// Creamos el objeto del servidor
$servidor=new soap_server();
// Generación del WSDL
$servidor->debug_flag=false;
//Configuramos el WSDL
$servidor->configureWSDL("PROGRAMACION", "link_servicio_web",'','document');
$servidor->wsdl->schemaTargetNamespace = "link_servicio_web";
$servidor->wsdl->addComplexType(
"datosParrilla",
"complexType",
"struct",
"sequence",
"",
array("Idprograma" => array("name"=>"Idprograma", "type"=>"xsd:int"),
"Nombre_Programa" => array("name"=>"Nombre_Programa", "type"=>"xsd:string"),
"Fecha_Inicio_Programa" => array("name"=>"Fecha_Inicio_Programa", "type"=>"xsd:string"),
"Fecha_Fin_Programa" => array("name"=>"Fecha_Fin_Programa", "type"=>"xsd:string"),
"Idcanal" => array("name"=>"Idcanal", "type"=>"xsd:int")));
$servidor->wsdl->addComplexType('estructura', 'complexType', 'struct', 'sequence', '', array(),
array(array('ref' => 'datosParrilla', 'wsdl:arrayType' => 'tns:datosParrilla[]')),
'tns:datosParrilla');
// Registramos el método
$servidor->register("datos", array("idcanal" => "xsd:int","fecha" =>"xsd:string"),array('return'=>'tns:estructura'),'link_servicio_web','','document','literal');
function datos ($idcanal,$fecha) {
global $conexion;
//Si la fecha entra en blanco se le da la de hoy
if(empty($fecha)){
$fecha=date("Y-m-d");
}
//Consulta
$consulta="SELECT Idprograma,Nombre_Programa,Fecha_Inicio_Programa,Fecha_Fin_Programa,Idcanal ".
"FROM Programas WHERE Idcanal=".$idcanal." ".
"AND Fecha_Inicio_Programa LIKE '".$fecha."%' ORDER BY Fecha_Inicio_Programa";
//Generamos el Array
$datos_parrilla=GetSqlArray($conexion,$consulta,'Idprograma');
return $datos_parrilla;
}
// Enviar el resultado como una respuesta SOAP por HTTP
$servidor->service($HTTP_RAW_POST_DATA);
?>
Cualquier ayuda es agradecida.