how i could send this XML http://ift.tt/2vu5MCa to this web services http://ift.tt/2wmK1kh
Using this script:
<?Php
require "config.php";
//echo "Hola";
//////////////////////////////////////
$sql="SELECT DATE_FORMAT(FROM_UNIXTIME(submit_time), '%b %e, %Y %l:%i %p') AS Submitted,
MAX(IF(field_name='rut', field_value, NULL )) AS 'rut',
MAX(IF(field_name='nombre', field_value, NULL )) AS 'nombre',
MAX(IF(field_name='apellido', field_value, NULL )) AS 'apellido',
MAX(IF(field_name='correo', field_value, NULL )) AS 'correo',
MAX(IF(field_name='telefonomovil', field_value, NULL )) AS 'telefonomovil',
MAX(IF(field_name='carrera', field_value, NULL )) AS 'carrera' FROM wp_cf7dbplugin_submits WHERE form_name = 'General' GROUP BY submit_time ORDER BY submit_time DESC";
$str ="<soapenv:Envelope xmlns:soapenv=\"http://ift.tt/sVJIaE\" xmlns:tem=\"http://tempuri.org/\">";
$str .="\n\t<soapenv:Header/>";
$str .="\n\t<soapenv:Body>";
$str .="\n\t\t<tem:CMTXUCEN_LandingPage>";
$str .="\n\t\t<tem:ContactosLanding>";
$str .="\n\t\t<tem:Contactos>";
foreach ($dbo->query($sql) as $row) {
$str .= "\n\t\t\t<tem:DTO_Contacto>\n\t\t\t\t<tem:rut>$row[rut]</tem:rut>\n\t\t\t\t<tem:nombre>$row[nombre]</tem:nombre>\n\t\t\t\t<tem:apellido>$row[apellido]</tem:apellido>\n\t\t\t\t<tem:correo>$row[correo]</tem:correo>\n\t\t\t\t<tem:telefonomovil>$row[telefonomovil]</tem:telefonomovil>\n\t\t\t\t<tem:CodigoCarrera>$row[carrera]</tem:CodigoCarrera>\n\t\t\t</tem:DTO_Contacto>";
}
$str .="\n\t\t</tem:Contactos>";
$str .="\n\t\t</tem:ContactosLanding>";
$str .="\n\t\t</tem:CMTXUCEN_LandingPage>";
$str.= "\n\t</soapenv:Body>";
$str .="\n</soapenv:Envelope>";
echo htmlspecialchars($str); //
$file_name="leads.xml"; // nombre del archivo
$fp = fopen ($file_name, "w");
// Abre el archivo, y sino existe lo crea.
fwrite ($fp,$str); // escribe
fclose ($fp); // cierra
chmod($file_name,0777);
?>
Please help
Thanks
Aucun commentaire:
Enregistrer un commentaire