Código PHP:
Ver original
<?php require_once("nusoap.php"); $server = new nusoap_server; $server->register("getRefaccionId"); $server->register("objArray"); function conecta(){ $local = false; if($local){ $db = "prueba"; $host = "localhost"; $user = "root"; $pass = "0"; }else{ $db = "hosting"; $host = "localhost"; $user = "root"; $pass = ""; } } } return $link; } function getRefaccionId($id_refaccion){ $link = conecta(); $sql = " SELECT * FROM refacciones WHERE id = $id_refaccion "; $refacciones = _SQL($sql, "array"); "id" => $refacciones['id'], "puertas" => $refacciones['puertas'], "ventanas" => $refacciones['ventanas'], "soportes" => $refacciones['soportes'], "seguros" => $refacciones['seguros'], ); return $refacciones; } function objArray($result){ if( $result != "") $datos[] = $row; } return $datos; } $server->service($HTTP_RAW_POST_DATA); ?>