PHP - principiante PHP-Web Service

 
Vista:
Imágen de perfil de jaime

principiante PHP-Web Service

Publicado por jaime (2 intervenciones) el 08/05/2012 17:23:13
Hola estoy recien empezando con web service y tengo un problema en un pequeño codigo que aparece en la web y que supuestamente funciona pero a mi no.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
  require_once("lib/nusoap.php");
  $ns = "http://localhost/service/";
  $server = new soap_server();
  $server->configureWSDL('CanadaTaxCalculator',$ns);
  $server->wsdl ->schemaTargetNamespace=$ns;
  $server->register('CalculateOntarioTax',array('amount' => 'xsd_string'), array('return' => 'xsd:string'), $ns);
 
  function CalulateOntarioTax($amount){
	  $taxcalc = $amount*0.15;
	  return new soapval('return','xds:string',$taxcalc);
	}
 
	$server ->service($HTTP_RAW_POST_DATA);
 ?>

me da error en la ultima linea

( ! ) Notice: Undefined variable: HTTP_RAW_POST_DATA in C:\wamp\www\service\TMP1nmn8u6.php on line 15

espero realmente me puedan ayudar

este es el link ddel video:
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

principiante PHP-Web Service

Publicado por jaime (1 intervención) el 08/05/2012 22:11:46
la verdad no me quedo muy claro que linea debo cambier por que datos.
haber antes que nada php tambien tiene extensiones php_soap, estas yo las tengo deshabilitadas porque como diced el video baje un toolkit con la misma version del ejemplo y las direcciono a esas, aparte del eror que tengo es , yo no tengo que crear el archivo wsdl ? lo crea el servidor. se supone que cunado ejecuto la pagina cliente este llama al server soap y este quenera a los datos que despues leo , es asi verdad, es mi primer ejemplo que trato d ehacer y no me funcionan ninguno antes pense que era por las versiones yo uso wamp con php 5.3.10 y la misma libreria del ejemplo.

gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de jaime

principiante PHP-Web Service

Publicado por jaime (2 intervenciones) el 08/05/2012 22:20:16
con la version de del toolkit que aparece en el video primero me da este error

Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\service\lib\nusoap.php on line 7381

y como segundo error me da

( ! ) Notice: Undefined variable: HTTP_RAW_POST_DATA in C:\wamp\www\service\TMP1nmn8u6.php on line 15

ahora si utilizo php_soap me da solo este error

( ! ) Notice: Undefined variable: HTTP_RAW_POST_DATA in C:\wamp\www\service\TMP1nmn8u6.php on line 15
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

principiante PHP-Web Service

Publicado por rita (2 intervenciones) el 22/05/2012 21:30:54
yo tenia el mismo error y lo resolvi reemplazando $HTTP_RAW_POST_DATA por php://input
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

principiante PHP-Web Service

Publicado por rita (2 intervenciones) el 22/05/2012 22:30:20
en realidad lo que me salvó fue esto:

1
2
3
if ( !isset( $HTTP_RAW_POST_DATA ) ) $HTTP_RAW_POST_DATA =file_get_contents( 'php://input' );
 
$server->service($HTTP_RAW_POST_DATA);
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar

principiante PHP-Web Service

Publicado por John Alberto (1 intervención) el 07/05/2013 23:03:04
Mi hermano Dios le bendiga, esta respuesta fue de mucha utilidad. Gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

principiante PHP-Web Service

Publicado por heanp (1 intervención) el 01/08/2014 06:48:20
...excelente aportación... enhorabuena
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

principiante PHP-Web Service

Publicado por Galo Lito Gallardo Mendoza (1 intervención) el 16/07/2020 23:22:09
15-Jul-2020 09:47:45 America/Chicago] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[15-Jul-2020 09:47:45 America/Chicago] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[15-Jul-2020 09:47:48 America/Chicago] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[15-Jul-2020 09:47:48 America/Chicago] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[15-Jul-2020 09:47:52 America/Chicago] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[15-Jul-2020 09:47:52 America/Chicago] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0


tengo el mismo problema por favor como puedo resolverlo y en que parte debo poner estas dos lineas estoy usando el XAMPP
gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

principiante PHP-Web Service

Publicado por Riley (1 intervención) el 01/06/2021 23:43:10
Muchas gracias!!!!!!!!! me sirvio bastante!!!!!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar