Foros del Web » Programando para Internet » PHP »

web service que elimine!

Estas en el tema de web service que elimine! en el foro de PHP en Foros del Web. estimados, como puedo hacer o cual es el concepto que debo saber para poder realizar que un web service me elimine un dato de mi ...
  #1 (permalink)  
Antiguo 30/06/2009, 12:22
Avatar de aRTeX  
Fecha de Ingreso: mayo-2005
Mensajes: 374
Antigüedad: 18 años, 11 meses
Puntos: 0
web service que elimine!

estimados, como puedo hacer o cual es el concepto que debo saber para poder realizar que un web service me elimine un dato de mi base de datos?? (Mysql)

ya que tengo uno, pero me tira el error Error: Response not of type text/xml: text/html.

creo que estoy haciendo mal el xml, pero como debe ser un xml de eliminacion???

saludos.

Código PHP:
<?php
    
require('lib/nusoap.php');
   
    
$l_oServer = new soap_server();
  
    
$l_oServer->debug_flag=false;
    
$l_oServer->configureWSDL('Integracion''http://localhost/WS_IN');
    
$l_oServer->wsdl->schemaTargetNamespace 'Integracion';

    
        
$l_oServer->wsdl->addComplexType('Integracion','complexType''struct','all','',
                array(
                        
'CLIENOMBRE'    => array('name'=>'CLIENOMBRE''type'=>'xsd:string'),
                        
'SEX'        => array('name'=>'SEX''type'=>'xsd:string'),
            
'CLIEAPELLIDOS'    => array('name'=>'CLIEAPELLIDOS''type'=>'xsd:string'),
            
'CASADO'    => array('name'=>'CASADO''type'=>'xsd:string'),
            
'N_KIDS'        => array('name'=>'N_KIDS''type'=>'xsd:string'),
            
'EDUCACION'    => array('name'=>'EDUCACION''type'=>'xsd:string')),
        array(
                        
'PRODUCTID'    => array('name'=>'PRODUCTID''type'=>'xsd:string'))
                     );
  
    
        
$l_oServer->register('getCliente', array('CLIEID' => 'xsd:string'),array('return'=>'tns:Integracion'),'http://localhost/WS_IN');
    
$l_oServer->register('delInventario', array('PRODUCTID' => 'xsd:string'),array('return'=>'tns:Integracion'),'http://localhost/WS_IN');

    function 
getCliente ($a_stInput) {
                if (
is_string($a_stInput)) {   
                        
$l_oDBlink   = @mysql_connect'localhost','root','2001850');
                        
$l_oDBresult = @mysql_db_query('oprc','SELECT CLIENOMBRE, CLIEAPELLIDOS, SEX,CASADO,N_KIDS,EDUCACION FROM clientes WHERE CLIEID='.$a_stInput);
          
                      if (!
$l_oDBresult) {
                            return new 
soap_fault('Server','' 'Internal server error.');
                        }
             
                       if (!
mysql_num_rows($l_oDBresult)) {
                            return new 
soap_fault('Server''','Service contains data only for a few cities.');
                        }
                        
mysql_close($l_oDBlink);
                      
                      return 
mysql_fetch_array($l_oDBresultMYSQL_ASSOC);    
                }
             else {
                      return new 
soap_fault('Client''''Service requires a string parameter.');
                }
          }
    function 
delInventario ($a_stInput_) {
                if (
is_string($a_stInput_)) {   
                        
$l_oDBlink   = @mysql_connect'localhost','root','2001850');
                        
$l_oDBresult = @mysql_db_query('oprc','DELETE FROM inventario WHERE PRODUCTID='.$a_stInput_);
                      
                      if (!
$l_oDBresult) {
                            return new 
soap_fault('Server','' 'Internal server error.');
                        }
                         if (!
mysql_num_rows($l_oDBresult)) {
                            return new 
soap_fault('Server''','Service contains data only for a few cities'.$num);
                        }
                        
mysql_close($l_oDBlink);
                      
                      return 
mysql_num_rows($l_oDBresult);
                }
             else {
                      return new 
soap_fault('Client''''Service requires a string parameter.');
                }
          }
  
$l_oServer->service($HTTP_RAW_POST_DATA);

?>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:11.