Ver Mensaje Individual
  #8 (permalink)  
Antiguo 14/01/2011, 08:28
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Consumir servicio web desde página HTML con JavaScript

Claro:
Código PHP:
<img src="urlWebservice?method=loquesea&data=loqueseaotravez" width="0" height="0" /> 
Y si necesitás post en lugar de get, ahí sí podés usar javascript:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
title>Documento sin t&#237;tulo</title>
</head>

<
body>
<
div style="position:absolute; width:0; height:0;top:-15000px;">
<
form id="f1" name="form1" method="post" action="urlwebservice" target="pepe">
  <
input type="hidden" name="metodo" value="algunmetodo" />
  <
input type="hidden" name="dato1" value="unvalor" />
  <
input type="hidden" name="dato2" value="otrovalor" />
</
form>
<
iframe name="pepe"></iframe>
<
script>document.getElementById('f1').submit();</script>
</div>
</body>
</html> 

Última edición por Panino5001; 14/01/2011 a las 08:37