Example #1
1
 public function soapAction()
 {
     $server = new soap_server();
     $server->configureWSDL('productservice', 'urn:ProductModel', URL . 'product/soap');
     $server->wsdl->schemaTargetNamespaces = 'urn:ProductModel';
     $server->wsdl->addComplexType('Producto', 'complexType', 'struct', 'all', '', array('idproducto' => array('name' => 'idproducto', 'type' => 'xsd:string'), 'titulo' => array('name' => 'titulo', 'type' => 'xsd:string'), 'descripcion' => array('name' => 'descripcion', 'type' => 'xsd:string'), 'precio' => array('name' => 'precio', 'type' => 'xsd:integer'), 'gatosdeenvio' => array('name' => 'gatosdeenvio', 'type' => 'xsd:integer'), 'marca' => array('name' => 'marca', 'type' => 'xsd:string'), 'createdAt' => array('name' => 'createdAt', 'type' => 'xsd:string'), 'iddescuento' => array('name' => 'iddescuento', 'type' => 'xsd:string'), 'idcolor' => array('name' => 'idcolor', 'type' => 'xsd:string'), 'idtalla' => array('name' => 'idtalla', 'type' => 'xsd:string'), 'stock' => array('name' => 'stock', 'type' => 'xsd:string'), 'idsubcategoria' => array('name' => 'idsubcategoria', 'type' => 'xsd:string'), 'idimagen' => array('name' => 'idimagen', 'type' => 'xsd:integer'), 'path' => array('name' => 'path', 'type' => 'xsd:string')));
     $server->wsdl->addComplexType('Productos', 'complexType', 'array', 'sequence', '', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:Producto[]')), 'tns:Producto');
     $server->register("ProductModel.selecWithCategorySubcatAndProduct", array("category" => "xsd:string", "subcategory" => "xsd:string", "group" => "xsd:string"), array("return" => "tns:Productos"), "urn:ProductModel", "urn:ProductModel#selecWithCategorySubcatAndProduct", "rpc", "encoded", "Get products by category or subcategory");
     $server->register("ProductModel.toArray", array("id" => "xsd:string"), array("return" => "xsd:Array"), "urn:ProductModel", "urn:ProductModel#toArray", "rpc", "encoded", "Get products id or all");
     $POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
     @$server->service($POST_DATA);
 }
 public static function crearWebServiceUntis()
 {
     $nusoap_server = new soap_server();
     $nusoap_server->configureWSDL('Transferir archivo Untis', 'urn:transferir_archivo_untis');
     // Parametros de entrada
     $nusoap_server->wsdl->addComplexType('datos_entrada', 'complexType', 'struct', 'all', '', array('archivo' => array('name' => 'Archivo', 'type' => 'xsd:base64Binary')));
     // Parametros de Salida
     $nusoap_server->wsdl->addComplexType('datos_salida', 'complexType', 'struct', 'all', '', array('mensaje' => array('name' => 'mensaje', 'type' => 'xsd:string')));
     $nusoap_server->wsdl->addComplexType('anio_lectivo_salida', 'complexType', 'struct', 'all', '', array('mensaje' => array('name' => 'mensaje', 'type' => 'xsd:string')));
     $nusoap_server->register('enviar_xml', array('datos_entrada' => 'tns:datos_entrada'), array('return' => 'tns:datos_salida'), 'urn:transferir_archivo_untis', 'urn:hellowsdl2#enviar_xml', 'rpc', 'encoded', 'La siguiente funcion recibe un archivo y transfiere los datos al servidor');
     $nusoap_server->register('consultar_anio_lectivo_activo', array('datos_entrada' => ''), array('return' => 'tns:anio_lectivo_salida'), 'urn:transferir_archivo_untis', 'urn:hellowsdl3#consultar_anio_lectivo_activo', 'rpc', 'encoded', 'La siguiente funcion envia el año lectivo activo');
     return $nusoap_server;
 }
 public function __construct()
 {
     parent::__construct();
     $this->load->library('nusoap');
     $servicio = new soap_server();
     $servicio->soap_defencoding = 'UTF-8';
     $servicio->decode_utf8 = false;
     $servicio->encode_utf8 = true;
     $ns = "urn:cero_code";
     $servicio->configureWSDL("cero_codeWS", $ns);
     $servicio->schemaTargetNamespace = $ns;
     $servicio->register("get_code", array('id_usuario' => 'xsd:string'), array('return' => 'xsd:string'), $ns, false, 'rpc', 'encoded', 'Cero Code');
     function get_code($id_usuario)
     {
         $CI =& get_instance();
         $CI->load->model('inventario/Inventario_model');
         $codigo = $CI->Inventario_model->get_code($id_usuario);
         return $codigo;
     }
     // 		$servicio->wsdl->addComplexType('Usuario','complexType','struct','all','',
     // array( 'id' => array('name' => 'id','type' => 'xsd:int'),
     // 'usuario' => array('name' => 'usuario','type' => 'xsd:string')));
     $servicio->register("get_usuarios", array(), array('return' => 'xsd:string'), $ns, false, 'rpc', 'encoded', 'Cero Code');
     function get_usuarios()
     {
         $CI =& get_instance();
         $CI->load->model('login/Login_model');
         //$usuarios = new stdClass();
         //$usuarios->lista = $CI->Login_model->get_usuarios();
         $usuarios = $CI->Login_model->get_usuarios();
         return json_encode($usuarios);
     }
     $servicio->service(file_get_contents("php://input"));
 }
Example #4
0
 public static function server()
 {
     $server = new \soap_server();
     //$namespace = "http://localhost:8000/ws";
     $server->configureWSDL('server.hello', 'urn:server.hello', Request::url());
     //$server->configureWSDL('OverService',$namespace);
     $server->wsdl->schemaTargetNamespace = 'urn:server.hello';
     //$server->decode_utf8 = true;
     //$server->soap_defencoding = "UTF-8";
     $server->register('hello', array('name' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:server.hello', 'urn:server.hello#hello', 'rpc', 'encoded', 'Retorna o nome');
     function hello($name)
     {
         return 'Hello ' . $name;
     }
     // respuesta para uso do serviço
     return Response::make($server->service(file_get_contents("php://input")), 200, array('Content-Type' => 'text/xml; charset=ISO-8859-1'));
 }
Example #5
0
function getSOAPServer()
{
    $namespace = 'http://www.w3.org/2001/XMLSchema';
    $server = new soap_server();
    $server->debug_flag = false;
    $server->configureWSDL("FormaSOAP", $namespace);
    $server->wsdl->schemaTargetNamespace = $namespace;
    //----------------------------------------------------------------------------
    //register types
    $server->wsdl->addComplexType('customFieldName', 'complexType', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:int'), 'name' => array('name' => 'name', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('customFieldValue', 'complexType', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:int'), 'value' => array('name' => 'value', 'mixed' => 'true', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('customField', 'complexType', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:int'), 'name' => array('name' => 'name', 'type' => 'xsd:string'), 'value' => array('name' => 'value', 'mixed' => 'true', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('customFieldValuesArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'customFieldValue[]')), 'customFieldValue');
    $server->wsdl->addComplexType('customFieldsArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'customField[]')), 'customField');
    //extended data to create/edit a user
    $server->wsdl->addComplexType('userData', 'complexType', 'struct', 'all', '', array('userid' => array('name' => 'userid', 'type' => 'xsd:string'), 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'), 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'), 'password' => array('name' => 'password', 'type' => 'xsd:string'), 'email' => array('name' => 'email', 'type' => 'xsd:string'), 'signature' => array('name' => 'signature', 'type' => 'xsd:string'), 'lastenter' => array('name' => 'lastenter', 'type' => 'xsd:date'), 'pwd_expire_at' => array('name' => 'pwd_expire_at', 'type' => 'xsd:date'), 'valid' => array('name' => 'valid', 'type' => 'xsd:boolean'), 'custom_fields' => array('name' => '_customfields', 'type' => 'tns:customFieldValuesArray')));
    //essential data of a user
    $server->wsdl->addComplexType('user', 'complexType', 'struct', 'all', '', array('idst' => array('name' => 'idst', 'type' => 'xsd:int'), 'userid' => array('name' => 'userid', 'type' => 'xsd:string'), 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'), 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string')));
    //list of users
    $server->wsdl->addComplexType('usersArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'user[]')), 'user');
    //learning object id and title
    $server->wsdl->addComplexType('object', 'complexType', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:int'), 'title' => array('name' => 'title', 'type' => 'xsd:string'), 'description' => array('name' => 'description', 'type' => 'xsd:string')));
    //array of learning objects
    $server->wsdl->addComplexType('objectsArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'object[]')), 'object');
    //----------------------------------------------------------------------------
    // register functions
    $server->register('authenticate', array('username' => 'xsd:string', 'password' => 'xsd:string', 'third_party' => 'xsd:string'), array('success' => 'xsd:boolean', 'message' => 'xsd:string', 'token' => 'xsd:string', 'expire_at' => 'xsd:string'), $namespace, $namespace . '#authenticate', 'rpc', 'encoded', '...');
    $server->register('getAuthMethod', array(), array('success' => 'xsd:boolean', 'method' => 'xsd:string'), $namespace, $namespace . '#getAuthMethod', 'rpc', 'encoded', '...');
    $server->register('createUser', array('auth_code' => 'xsd:string', 'user_data' => 'userData'), array('success' => 'xsd:boolean'), $namespace, $namespace . '#createUser', 'rpc', 'encoded', '...');
    $server->register('updateUser', array('auth_code' => 'xsd:string', 'idst' => 'xsd:int', 'user_data' => 'userData'), array('success' => 'xsd:boolean'), $namespace, $namespace . '#updateUser', 'rpc', 'encoded', '...');
    $server->register('usersList', array('auth_code' => 'xsd:string'), array('success' => 'xsd:boolean', 'list' => 'usersArray'), $namespace, $namespace . '#usersList', 'rpc', 'encoded', '...');
    $server->register('userDetails', array('auth_code' => 'xsd:string', 'idst' => 'xsd:int'), array('success' => 'xsd:boolean', 'details' => 'userData'), $namespace, $namespace . '#userDetails', 'rpc', 'encoded', '...');
    $server->register('deleteUser', array('auth_code' => 'xsd:string', 'idst' => 'xsd:int'), array('success' => 'xsd:boolean', 'message' => 'xsd:string'), $namespace, $namespace . '#deleteUser', 'rpc', 'encoded', '...');
    //----------------------------------------------------------------------------
    $server->register('searchObjects', array('auth_code' => 'xsd:string', 'type' => 'xsd:string', 'key' => 'xsd:string'), array('success' => 'xsd:boolean', 'objects' => 'objectsArray'), $namespace, $namespace . '#searchObjects', 'rpc', 'encoded', '...');
    $server->register('requestObject', array('auth_code' => 'xsd:string', 'id_object' => 'xsd:int', 'type' => 'xsd:string', 'id_user' => 'xsd:int'), array('success' => 'xsd:boolean', 'object' => 'xsd:string'), $namespace, $namespace . '#requestObject', 'rpc', 'encoded', '...');
    return $server;
}
Example #6
0
function createServer()
{
    // *************************************************************************************
    // create the server instance
    // *************************************************************************************
    $server = new soap_server();
    $server->xml_encoding = "UTF-8";
    $server->decode_utf8 = false;
    $server->configureWSDL('DOMAService', NAMESPACE1);
    // *************************************************************************************
    // define complex types
    // *************************************************************************************
    $server->wsdl->addComplexType('PublishMapRequest', 'complexType', 'struct', 'all', '', array('Username' => array('name' => 'Username', 'type' => 'xsd:string'), 'Password' => array('name' => 'Password', 'type' => 'xsd:string'), 'MapInfo' => array('name' => 'Map', 'type' => 'tns:MapInfo')));
    $server->wsdl->addComplexType('PublishMapResponse', 'complexType', 'struct', 'all', '', array('Success' => array('name' => 'Success', 'type' => 'xsd:boolean'), 'ErrorMessage' => array('name' => 'ErrorMessage', 'type' => 'xsd:string'), 'URL' => array('name' => 'URL', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('PublishPreUploadedMapRequest', 'complexType', 'struct', 'all', '', array('Username' => array('name' => 'Username', 'type' => 'xsd:string'), 'Password' => array('name' => 'Password', 'type' => 'xsd:string'), 'MapInfo' => array('name' => 'Map', 'type' => 'tns:MapInfo'), 'PreUploadedMapImageFileName' => array('name' => 'PreUploadedMapImageFileName', 'type' => 'xsd:string'), 'PreUploadedBlankMapImageFileName' => array('name' => 'PreUploadedBlankMapImageFileName', 'type' => 'xsd:string'), 'PreUploadedThumbnailImageFileName' => array('name' => 'PreUploadedThumbnailImageFileName', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('PublishPreUploadedMapResponse', 'complexType', 'struct', 'all', '', array('Success' => array('name' => 'Success', 'type' => 'xsd:boolean'), 'ErrorMessage' => array('name' => 'ErrorMessage', 'type' => 'xsd:string'), 'URL' => array('name' => 'URL', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('UploadPartialFileRequest', 'complexType', 'struct', 'all', '', array('Username' => array('name' => 'Username', 'type' => 'xsd:string'), 'Password' => array('name' => 'Password', 'type' => 'xsd:string'), 'FileName' => array('name' => 'FileName', 'type' => 'xsd:string'), 'Data' => array('name' => 'Data', 'type' => 'xsd:base64Binary')));
    $server->wsdl->addComplexType('UploadPartialFileResponse', 'complexType', 'struct', 'all', '', array('Success' => array('name' => 'Success', 'type' => 'xsd:boolean'), 'ErrorMessage' => array('name' => 'ErrorMessage', 'type' => 'xsd:string'), 'FileName' => array('name' => 'FileName', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('GetAllMapsRequest', 'complexType', 'struct', 'all', '', array('Username' => array('name' => 'Username', 'type' => 'xsd:string'), 'Password' => array('name' => 'Password', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('GetAllMapsResponse', 'complexType', 'struct', 'all', '', array('Success' => array('name' => 'Success', 'type' => 'xsd:boolean'), 'ErrorMessage' => array('name' => 'ErrorMessage', 'type' => 'xsd:string'), 'Maps' => array('name' => 'Maps', 'type' => 'tns:MapInfoArray')));
    $server->wsdl->addComplexType('GetAllCategoriesRequest', 'complexType', 'struct', 'all', '', array('Username' => array('name' => 'Username', 'type' => 'xsd:string'), 'Password' => array('name' => 'Password', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('GetAllCategoriesResponse', 'complexType', 'struct', 'all', '', array('Success' => array('name' => 'Success', 'type' => 'xsd:boolean'), 'ErrorMessage' => array('name' => 'ErrorMessage', 'type' => 'xsd:string'), 'Categories' => array('name' => 'Categories', 'type' => 'tns:CategoryArray')));
    $server->wsdl->addComplexType('ConnectRequest', 'complexType', 'struct', 'all', '', array('Username' => array('name' => 'Username', 'type' => 'xsd:string'), 'Password' => array('name' => 'Password', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('ConnectResponse', 'complexType', 'struct', 'all', '', array('Success' => array('name' => 'Success', 'type' => 'xsd:boolean'), 'ErrorMessage' => array('name' => 'ErrorMessage', 'type' => 'xsd:string'), 'Version' => array('name' => 'Version', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('MapInfo', 'complexType', 'struct', 'all', '', array('ID' => array('name' => 'ID', 'type' => 'xsd:int'), 'UserID' => array('name' => 'UserID', 'type' => 'xsd:int'), 'CategoryID' => array('name' => 'CategoryID', 'type' => 'xsd:int'), 'Date' => array('name' => 'Date', 'type' => 'xsd:dateTime'), 'Name' => array('name' => 'Name', 'type' => 'xsd:string'), 'Organiser' => array('name' => 'Organiser', 'type' => 'xsd:string'), 'Country' => array('name' => 'Country', 'type' => 'xsd:string'), 'Discipline' => array('name' => 'Discipline', 'type' => 'xsd:string'), 'RelayLeg' => array('name' => 'RelayLeg', 'type' => 'xsd:string'), 'MapName' => array('name' => 'MapName', 'type' => 'xsd:string'), 'ResultListUrl' => array('name' => 'ResultListUrl', 'type' => 'xsd:string'), 'Comment' => array('name' => 'Comment', 'type' => 'xsd:string'), 'MapImageData' => array('name' => 'MapImageData', 'type' => 'xsd:base64Binary'), 'MapImageFileExtension' => array('name' => 'MapImageFileExtension', 'type' => 'xsd:string'), 'BlankMapImageData' => array('name' => 'BlankMapImageData', 'type' => 'xsd:base64Binary')));
    $server->wsdl->addComplexType('Category', 'complexType', 'struct', 'all', '', array('ID' => array('name' => 'ID', 'type' => 'xsd:int'), 'UserID' => array('name' => 'UserID', 'type' => 'xsd:int'), 'Name' => array('name' => 'Name', 'type' => 'xsd:string')));
    $server->wsdl->addComplexType('MapInfoArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:MapInfo[]')), 'tns:MapInfo');
    $server->wsdl->addComplexType('CategoryArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:Category[]')), 'tns:Category');
    // *************************************************************************************
    // register service methods
    // *************************************************************************************
    $server->register('PublishMap', array('request' => 'tns:PublishMapRequest'), array('response' => 'tns:PublishMapResponse'), NAMESPACE1);
    $server->register('PublishPreUploadedMap', array('request' => 'tns:PublishPreUploadedMapRequest'), array('response' => 'tns:PublishPreUploadedMapResponse'), NAMESPACE1);
    $server->register('UploadPartialFile', array('request' => 'tns:UploadPartialFileRequest'), array('response' => 'tns:UploadPartialFileResponse'), NAMESPACE1);
    $server->register('GetAllMaps', array('request' => 'tns:GetAllMapsRequest'), array('response' => 'tns:GetAllMapsResponse'), NAMESPACE1);
    $server->register('GetAllCategories', array('request' => 'tns:GetAllCategoriesRequest'), array('response' => 'tns:GetAllCategoriesResponse'), NAMESPACE1);
    $server->register('Connect', array('request' => 'tns:ConnectRequest'), array('response' => 'tns:ConnectResponse'), NAMESPACE1);
    return $server;
}
Example #7
0
    $banco = Cuenta::first('all', array('conditions' => array(' nro_afiliado = ?', $nro_afiliado)));
    // var_dump($client->nombre);
    if ($client != NULL && $tarjeta != NULL && $banco != NULL) {
        $cuentaCliente = Cuenta::first('all', array('conditions' => array(' ci_cliente = ?', $ci)));
        if ($cuentaCliente->nro_afiliado == $tarjeta->nro_afiliado && $cod_seg == $tarjeta->cod_seg) {
            if ($monto <= $cuentaCliente->saldo) {
                $cuentaCliente->saldo = $cuentaCliente->saldo - $monto;
                $cuentaCliente->save();
                $banco->saldo = $banco->saldo + $monto;
                $banco->save();
                Transaccion::create(array('nro_tarjeta' => $nro_tarjeta, 'ci' => $ci, 'fecha_transaccion' => date("Y-m-d H:i:s"), 'monto' => $monto, "nro_afiliado_adquiriente" => $nro_afiliado, 'cod' => "00"));
                return "00";
            } else {
                Transaccion::create(array('nro_tarjeta' => $nro_tarjeta, 'ci' => $ci, 'fecha_transaccion' => date("Y-m-d H:i:s"), 'monto' => $monto, "nro_afiliado_adquiriente" => $nro_afiliado, 'cod' => "01"));
                return "01";
            }
        } else {
            Transaccion::create(array('nro_tarjeta' => $nro_tarjeta, 'ci' => $ci, 'fecha_transaccion' => date("Y-m-d H:i:s"), 'monto' => $monto, "nro_afiliado_adquiriente" => $nro_afiliado, 'cod' => "10"));
            return "10";
        }
    } else {
        Transaccion::create(array('nro_tarjeta' => $nro_tarjeta, 'ci' => $ci, 'fecha_transaccion' => date("Y-m-d H:i:s"), 'monto' => $monto, "nro_afiliado_adquiriente" => $nro_afiliado, 'cod' => "10"));
        return "10";
    }
}
// Se inicializa el servidor.
$server = new soap_server();
$server->configureWSDL("BancoTere", "urn:BancoTere");
$server->register('pago', array("nro_tarjeta" => "xsd:int", "cod_seg" => "xsd:string", "fecha_exp" => "xsd:string", "monto" => "xsd:string", "ci" => "xsd:int", "nro_afiliado" => "xsd:int"), array("return" => "xsd:string"), 'urn:BancoTere', 'urn:BancoTere#pago', 'rpc', 'encoded', 'transacion del banco');
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
Example #8
0
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    //return $ip;
    if ($ip != "" and $ip != "::1" and $ip != "127.0.0.1" and $ip != "localhost") {
        echo "You are not authorized.";
        exit;
    }
}
get_ip();
$server = new soap_server();
$server->configureWSDL("FruityWifi", "urn:FruityWifi");
$server->register("serviceAction", array("service" => "xsd:string", "action" => "xsd:string"), array("return" => "xsd:string"), "urn:FruityWifi", "urn:FruityWifi#serviceAction", "rpc", "encoded", "Modules action");
$server->register("moduleAction", array("module" => "xsd:string", "action" => "xsd:string"), array("return" => "xsd:string"), "urn:FruityWifi", "urn:FruityWifi#moduleAction", "rpc", "encoded", "Modules action");
$server->register("getAllInterfaces", array("module" => "xsd:string", "action" => "xsd:string"), array("return" => "xsd:string"), "urn:FruityWifi", "urn:FruityWifi#getAllInterfaces", "rpc", "encoded", "Modules action");
$server->register("getInterface", array("module" => "xsd:string"), array("return" => "xsd:string"), "urn:FruityWifi", "urn:FruityWifi#getInterface", "rpc", "encoded", "Modules action");
$server->register("setInterface", array("config" => "xsd:string", "interface" => "xsd:string"), array("return" => "xsd:string"), "urn:FruityWifi", "urn:FruityWifi#setInterface", "rpc", "encoded", "Modules action");
$server->register("getModules", array("module" => "xsd:string", "action" => "xsd:string"), array("return" => "xsd:string"), "urn:FruityWifi", "urn:FruityWifi#getModules", "rpc", "encoded", "Modules action");
$server->register("getStatus", array("service" => "xsd:string"), array("return" => "xsd:string"), "urn:FruityWifi", "urn:FruityWifi#getStatus", "rpc", "encoded", "Service status");
$server->register("getModuleStatus", array("module" => "xsd:string", "action" => "xsd:string"), array("return" => "xsd:string"), "urn:FruityWifi", "urn:FruityWifi#getModuleStatus", "rpc", "encoded", "Modules action");
$server->register("getServiceStatus", array("module" => "xsd:string", "action" => "xsd:string"), array("return" => "xsd:string"), "urn:FruityWifi", "urn:FruityWifi#getServiceStatus", "rpc", "encoded", "Modules action");
$server->service($HTTP_RAW_POST_DATA);
function serviceAction($service, $action)
{
    global $global_webserver;
    if ($service == "s_wireless") {
        $url = "{$global_webserver}/scripts/status_wireless.php?service=wireless&action={$action}";
        execCurl($url);
Example #9
0
 *
 * @author Yannick Warnier <*****@*****.**>
 * @package chamilo.webservices
 */
require_once '../inc/global.inc.php';
$libpath = api_get_path(LIBRARY_PATH);
// Create the server instance
$server = new soap_server();
// Initialize WSDL support
$server->configureWSDL('WSCourseList', 'urn:WSCourseList');
/* Register WSCourseList function */
// Register the data structures used by the service
$server->wsdl->addComplexType('courseDetails', 'complexType', 'struct', 'all', '', array('name' => 'code', 'type' => 'xsd:string', 'name' => 'title', 'type' => 'xsd:string', 'name' => 'url', 'type' => 'xsd:string', 'name' => 'teacher', 'type' => 'xsd:string', 'name' => 'language', 'type' => 'xsd:string'));
$server->wsdl->addComplexType('courseList', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP:ENC:arrayType', 'wsdl:arrayType' => 'tns:courseDetails[]')), 'tns:courseDetails');
// Register the method to expose
$server->register('WSCourseList', array('username' => 'xsd:string', 'signature' => 'xsd:string', 'visibilities' => 'xsd:string'), array('return' => 'xsd:Array'), 'urn:WSCourseList', 'urn:WSCourseList#WSCourseList', 'rpc', 'encoded', 'This service returns a list of courses');
/**
 * Get a list of courses (code, url, title, teacher, language) and return to caller
 * Function registered as service. Returns strings in UTF-8.
 * @param string User name in Chamilo
 * @param string Signature (composed of the sha1(username+apikey)
 * @param mixed  Array or string. Type of visibility of course (public, public-registered, private, closed)
 * @return array Courses list (code=>[title=>'title',url='http://...',teacher=>'...',language=>''],code=>[...],...)
 */
function WSCourseList($username, $signature, $visibilities = 'public')
{
    if (empty($username) or empty($signature)) {
        return -1;
    }
    global $_configuration;
    $info = api_get_user_info_from_username($username);
<?php

require_once 'nusoap.php';
$URL = "http://localhost/prak_sit_travel/service/service_testimonial.php";
$namespace = $URL . '?wsdl';
$server = new soap_server();
$server->configureWSDL('travel', $namespace);
$server->register('testimonial', array('input' => 'xsd:String'), array('output' => 'xsd:Array'), 'urn:servicetestimonial', 'urn:servicetestimonial#testimonial', 'rpc', 'encoded', 'menampilkan testimonial wisata');
$server->register('tambah_testimonial', array('input' => 'xsd:Array'), array('output' => 'xsd:Array'), 'urn:servicetestimonial', 'urn:servicetestimonial#tambah_testimonial', 'rpc', 'encoded', 'menambah Testimonial Pelanggan');
// koneksi ke database
include "koneksi.php";
function testimonial()
{
    $query = "SELECT * from testimonial";
    $hasil = mysql_query($query);
    while ($data = mysql_fetch_array($hasil)) {
        // menyimpan data hasil pencarian dalam array
        $result[] = array('id_testimonial' => $data['id_testimonial'], 'nama' => $data['nama'], 'email' => $data['email'], 'isi' => $data['isi'], 'tanggal' => $data['tanggal']);
    }
    // mereturn array hasil pencarian
    return $result;
}
function tambah_testimonial($nama, $email, $isi)
{
    $date = date("Y-m-d H:i:s");
    $query = "INSERT INTO testimonial (nama, email, isi, tanggal) VALUES ('{$nama}', '{$email}', '{$isi}','{$date}')";
    $hasil = mysql_query($query);
    if ($hasil) {
        return true;
    } else {
        return false;
Example #11
0
require_once 'config/config.php';
include_once 'vtlib/Vtiger/Module.php';
include_once 'include/main/WebUI.php';
require_once 'libraries/nusoap/nusoap.php';
$log =& LoggerManager::getLogger('wordplugin');
error_reporting(0);
$NAMESPACE = 'http://www.yetiforce.com';
$server = new soap_server();
$accessDenied = "You are not permitted to perform this action";
$server->configureWSDL('vtigersoap');
$server->wsdl->addComplexType('contact_column_detail', 'complexType', 'array', '', array('email_address' => array('name' => 'email_address', 'type' => 'xsd:string'), 'first_name' => array('name' => 'first_name', 'type' => 'xsd:string'), 'last_name' => array('name' => 'last_name', 'type' => 'xsd:string'), 'primary_address_city' => array('name' => 'primary_address_city', 'type' => 'xsd:string'), 'account_name' => array('name' => 'account_name', 'type' => 'xsd:string'), 'id' => array('name' => 'id', 'type' => 'xsd:string'), 'salutation' => array('name' => 'salutation', 'type' => 'xsd:string'), 'title' => array('name' => 'title', 'type' => 'xsd:string'), 'phone_mobile' => array('name' => 'phone_mobile', 'type' => 'xsd:string'), 'reports_to' => array('name' => 'reports_to', 'type' => 'xsd:string'), 'primary_address_city' => array('name' => 'primary_address_city', 'type' => 'xsd:string'), 'primary_address_street' => array('name' => 'primary_address_street', 'type' => 'xsd:string'), 'primary_address_state' => array('name' => 'primary_address_state', 'type' => 'xsd:string'), 'primary_address_postalcode' => array('name' => 'primary_address_postalcode', 'type' => 'xsd:string'), 'primary_address_country' => array('name' => 'primary_address_country', 'type' => 'xsd:string'), 'alt_address_city' => array('name' => 'alt_address_city', 'type' => 'xsd:string'), 'alt_address_street' => array('name' => 'alt_address_street', 'type' => 'xsd:string'), 'alt_address_state' => array('name' => 'alt_address_state', 'type' => 'xsd:string'), 'alt_address_postalcode' => array('name' => 'alt_address_postalcode', 'type' => 'xsd:string'), 'alt_address_country' => array('name' => 'alt_address_country', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('account_column_detail', 'complexType', 'array', '', array('accountid' => array('name' => 'accountid', 'type' => 'xsd:string'), 'accountname' => array('name' => 'accountname', 'type' => 'xsd:string'), 'parentid' => array('name' => 'parentid', 'type' => 'xsd:string'), 'account_type' => array('name' => 'account_type', 'type' => 'xsd:string'), 'industry' => array('name' => 'industry', 'type' => 'xsd:string'), 'annualrevenue' => array('name' => 'annualrevenue', 'type' => 'xsd:string'), 'rating' => array('name' => 'rating', 'type' => 'xsd:string'), 'ownership' => array('name' => 'ownership', 'type' => 'xsd:string'), 'siccode' => array('name' => 'siccode', 'type' => 'xsd:string'), 'tickersymbol' => array('name' => 'tickersymbol', 'type' => 'xsd:string'), 'phone' => array('name' => 'phone', 'type' => 'xsd:string'), 'otherphone' => array('name' => 'otherphone', 'type' => 'xsd:string'), 'email1' => array('name' => 'email1', 'type' => 'xsd:string'), 'email2' => array('name' => 'email2', 'type' => 'xsd:string'), 'website' => array('name' => 'website', 'type' => 'xsd:string'), 'fax' => array('name' => 'fax', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('lead_column_detail', 'complexType', 'array', '', array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'date_entered' => array('name' => 'date_entered', 'type' => 'xsd:string'), 'date_modified' => array('name' => 'date_modified', 'type' => 'xsd:string'), 'modified_user_id' => array('name' => 'modified_user_id', 'type' => 'xsd:string'), 'assigned_user_id' => array('name' => 'assigned_user_id', 'type' => 'xsd:string'), 'salutation' => array('name' => 'salutation', 'type' => 'xsd:string'), 'first_name' => array('name' => 'first_name', 'type' => 'xsd:string'), 'last_name' => array('name' => 'last_name', 'type' => 'xsd:string'), 'company' => array('name' => 'company', 'type' => 'xsd:string'), 'designation' => array('name' => 'designation', 'type' => 'xsd:string'), 'lead_source' => array('name' => 'lead_source', 'type' => 'xsd:string'), 'industry' => array('name' => 'industry', 'type' => 'xsd:string'), 'annual_revenue' => array('name' => 'annual_revenue', 'type' => 'xsd:string'), 'license_key' => array('name' => 'license_key', 'type' => 'xsd:string'), 'phone' => array('name' => 'phone', 'type' => 'xsd:string'), 'mobile' => array('name' => 'mobile', 'type' => 'xsd:string'), 'fax' => array('name' => 'fax', 'type' => 'xsd:string'), 'email' => array('name' => 'email', 'type' => 'xsd:string'), 'secondaryemail' => array('name' => 'secondaryemail', 'type' => 'xsd:string'), 'website' => array('name' => 'website', 'type' => 'xsd:string'), 'lead_status' => array('name' => 'lead_status', 'type' => 'xsd:string'), 'rating' => array('name' => 'rating', 'type' => 'xsd:string'), 'employees' => array('name' => 'employees', 'type' => 'xsd:string'), 'address_street' => array('name' => 'address_street', 'type' => 'xsd:string'), 'address_city' => array('name' => 'address_city', 'type' => 'xsd:string'), 'address_state' => array('name' => 'address_state', 'type' => 'xsd:string'), 'address_postalcode' => array('name' => 'address_postalcode', 'type' => 'xsd:string'), 'address_country' => array('name' => 'address_country', 'type' => 'xsd:string'), 'description' => array('name' => 'description', 'type' => 'xsd:string'), 'deleted' => array('name' => 'deleted', 'type' => 'xsd:string'), 'converted' => array('name' => 'converted', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('user_column_detail', 'complexType', 'array', '', array('firstname' => array('name' => 'firstname', 'type' => 'xsd:string'), 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'), 'username' => array('name' => 'username', 'type' => 'xsd:string'), 'secondaryemail' => array('name' => 'secondaryemail', 'type' => 'xsd:string'), 'title' => array('name' => 'title', 'type' => 'xsd:string'), 'workphone' => array('name' => 'workphone', 'type' => 'xsd:string'), 'department' => array('name' => 'department', 'type' => 'xsd:string'), 'mobilephone' => array('name' => 'mobilephone', 'type' => 'xsd:string'), 'otherphone' => array('name' => 'otherphone', 'type' => 'xsd:string'), 'fax' => array('name' => 'fax', 'type' => 'xsd:string'), 'email' => array('name' => 'email', 'type' => 'xsd:string'), 'homephone' => array('name' => 'homephone', 'type' => 'xsd:string'), 'otheremail' => array('name' => 'otheremail', 'type' => 'xsd:string'), 'street' => array('name' => 'street', 'type' => 'xsd:string'), 'city' => array('name' => 'city', 'type' => 'xsd:string'), 'state' => array('name' => 'state', 'type' => 'xsd:string'), 'code' => array('name' => 'code', 'type' => 'xsd:string'), 'country' => array('name' => 'country', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('tickets_list_array', 'complexType', 'array', '', array('ticketid' => array('name' => 'ticketid', 'type' => 'xsd:string'), 'title' => array('name' => 'title', 'type' => 'xsd:string'), 'groupname' => array('name' => 'groupname', 'type' => 'xsd:string'), 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'), 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'), 'parent_id' => array('name' => 'parent_id', 'type' => 'xsd:string'), 'productid' => array('name' => 'productid', 'type' => 'xsd:string'), 'productname' => array('name' => 'productname', 'type' => 'xsd:string'), 'priority' => array('name' => 'priority', 'type' => 'xsd:string'), 'severity' => array('name' => 'severity', 'type' => 'xsd:string'), 'status' => array('name' => 'status', 'type' => 'xsd:string'), 'category' => array('name' => 'category', 'type' => 'xsd:string'), 'description' => array('name' => 'description', 'type' => 'xsd:string'), 'solution' => array('name' => 'solution', 'type' => 'xsd:string'), 'createdtime' => array('name' => 'createdtime', 'type' => 'xsd:string'), 'modifiedtime' => array('name' => 'modifiedtime', 'type' => 'xsd:string')));
$server->register('get_contacts_columns', array('user_name' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'tns:contact_column_detail'), $NAMESPACE);
$server->register('get_accounts_columns', array('user_name' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'tns:account_column_detail'), $NAMESPACE);
$server->register('get_leads_columns', array('user_name' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'tns:lead_column_detail'), $NAMESPACE);
$server->register('get_user_columns', array('user_name' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'tns:user_column_detail'), $NAMESPACE);
$server->register('get_tickets_columns', array('user_name' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'tns:tickets_list_array'), $NAMESPACE);
$server->register('create_session', array('user_name' => 'xsd:string', 'password' => 'xsd:string', 'version' => 'xsd:string'), array('return' => 'xsd:string', 'session' => 'xsd:string'), $NAMESPACE);
$server->register('end_session', array('user_name' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
function get_tickets_columns($user_name, $session)
{
    if (!validateSession($user_name, $session)) {
        return null;
    }
    global $current_user, $log;
    require_once "modules/Users/Users.php";
    $seed_user = new Users();
    $user_id = $seed_user->retrieve_user_id($user_name);
Example #12
0
$uri = 'http://' . $sys_default_domain;
// 1. include client and server
require_once $gfwww . 'soap/nusoap.php';
//$debug = true;
// 2. instantiate server object
$server = new soap_server();
//configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http://schemas.xmlsoap.org/soap/http');
//$server->configureWSDL('GForgeAPI',$uri);
$server->configureWSDL('GForgeAPI', $uri, false, 'rpc', 'http://schemas.xmlsoap.org/soap/http', $uri);
// add types
$server->wsdl->addComplexType('ArrayOfstring', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:string[]')), 'xsd:string');
$server->wsdl->addComplexType('ArrayOfInteger', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:integer[]')), 'xsd:integer');
$server->wsdl->addComplexType('ArrayOflong', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:long[]')), 'xsd:long');
$server->wsdl->addComplexType('ArrayOfint', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:int[]')), 'xsd:int');
// session/authentication
$server->register('login', array('userid' => 'xsd:string', 'passwd' => 'xsd:string'), array('loginResponse' => 'xsd:string'), $uri, $uri . '#login');
$server->register('logout', array('session_ser' => 'xsd:string'), array('logoutResponse' => 'xsd:string'), $uri, $uri . '#logout');
//
//	Include Group Functions
//
require_once $gfwww . 'soap/common/group.php';
//
//	Include User Functions
//
require_once $gfwww . 'soap/common/user.php';
//
//	Include tracker & tracker query Functions
//
require_once $gfwww . 'soap/tracker/tracker.php';
require_once $gfwww . 'soap/tracker/query.php';
//
/**
 * URL Verfication - Required to overcome Apache mis-configuration and leading to shared setup mode.
 */
require_once 'config.php';
if (file_exists('config_override.php')) {
    include_once 'config_override.php';
}
include_once 'vtlib/Vtiger/Module.php';
include_once 'includes/main/WebUI.php';
require_once 'libraries/nusoap/nusoap.php';
$log =& LoggerManager::getLogger('firefoxlog');
$NAMESPACE = 'http://www.vtiger.com/products/crm';
$server = new soap_server();
$accessDenied = "You are not authorized for performing this action";
$server->configureWSDL('vtigersoap');
$server->register('create_lead_from_webform', array('username' => 'xsd:string', 'session' => 'xsd:string', 'lastname' => 'xsd:string', 'firstname' => 'xsd:string', 'email' => 'xsd:string', 'phone' => 'xsd:string', 'company' => 'xsd:string', 'country' => 'xsd:string', 'description' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('create_site_from_webform', array('username' => 'xsd:string', 'session' => 'xsd:string', 'portalname' => 'xsd:string', 'portalurl' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('create_rss_from_webform', array('username' => 'xsd:string', 'session' => 'xsd:string', 'rssurl' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('create_contacts', array('user_name' => 'xsd:string', 'session' => 'xsd:string', 'firstname' => 'xsd:string', 'lastname' => 'xsd:string', 'phone' => 'xsd:string', 'mobile' => 'xsd:string', 'email' => 'xsd:string', 'street' => 'xsd:string', 'city' => 'xsd:string', 'state' => 'xsd:string', 'country' => 'xsd:string', 'zipcode' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('create_account', array('username' => 'xsd:string', 'session' => 'xsd:string', 'accountname' => 'xsd:string', 'email' => 'xsd:string', 'phone' => 'xsd:string', '$primary_address_street' => 'xsd:string', '$primary_address_city' => 'xsd:string', '$primary_address_state' => 'xsd:string', '$primary_address_postalcode' => 'xsd:string', '$primary_address_country' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('create_ticket_from_toolbar', array('username' => 'xsd:string', 'session' => 'xsd:string', 'title' => 'xsd:string', 'description' => 'xsd:string', 'priority' => 'xsd:string', 'severity' => 'xsd:string', 'category' => 'xsd:string', 'user_name' => 'xsd:string', 'parent_id' => 'xsd:string', 'product_id' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('create_vendor_from_webform', array('username' => 'xsd:string', 'session' => 'xsd:string', 'vendorname' => 'xsd:string', 'email' => 'xsd:string', 'phone' => 'xsd:string', 'website' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('create_product_from_webform', array('username' => 'xsd:string', 'session' => 'xsd:string', 'productname' => 'xsd:string', 'productcode' => 'xsd:string', 'website' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('create_note_from_webform', array('username' => 'xsd:string', 'session' => 'xsd:string', 'title' => 'xsd:string', 'notecontent' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('LogintoVtigerCRM', array('user_name' => 'xsd:string', 'password' => 'xsd:string', 'version' => 'xsd:string'), array('return' => 'tns:logindetails'), $NAMESPACE);
$server->register('CheckLeadPermission', array('username' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('CheckContactPermission', array('username' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('CheckAccountPermission', array('username' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('CheckTicketPermission', array('username' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('CheckVendorPermission', array('username' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('CheckProductPermission', array('username' => 'xsd:string', 'session' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
Example #14
0
															"complexType",
															"struct",
															"all",
															"",
															array("Lote" => array("name" => "Lote", "type" => "xsd:int"),
																		"SecuenciaLote" => array("name" => "SecuenciaLote", "type" => "xsd:int"),
																		"FechaImpresionLote" => array("name" => "FechaImpresionLote", "type" => "xsd:date"),
																		"CajaLote" => array("name" => "CajaLote", "type" => "xsd:string"),
																		"CodigoTipoArchivo" => array("name" => "CodigoTipoArchivo", "type" => "xsd:string"),
																		"DescripcionTipoArchivo" => array("name" => "DescripcionTipoArchivo", "type" => "xsd:string"),
																		"Clave" => array("name" => "Clave", "type" => "xsd:string"),
																		"Subclave1" => array("name" => "Subclave1", "type" => "xsd:string"),
																		"Subclave2" => array("name" => "Subclave2", "type" => "xsd:string"),
																		"Subclave3" => array("name" => "Subclave3", "type" => "xsd:string"),
																		"Subclave4" => array("name" => "Subclave4", "type" => "xsd:string"),
																		"CodigoDocumento" => array("name" => "CodigoDocumento", "type" => "xsd:string"),
																		"DescripcionDocumento" => array("name" => "DescripcionDocumento", "type" => "xsd:string"),
																		"CantidadHojas" => array("name" => "CantidadHojas", "type" => "xsd:int"),
																		"Remito" => array("name" => "Remito", "type" => "xsd:int"),
																		"FechaImpresionRemito" => array("name" => "FechaImpresionRemito", "type" => "xsd:date"))
);
*/
$server->register("obtenerLote",		// Nombre de la funcion
									array("lote" => "xsd:int"),		// Parametros de entrada
									array("return" => "xsd:string"),		// Parametros de salida
									$url
);

$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
$server = new soap_server();
//Configuramos el WSDL
$server->configureWSDL("EjWS5_Server");
//Asignamos nuestro NameSpace
$server->wsdl->schemaTargetNameSpace = $namespace;
//Registramos el método para que sea léido por el sistema
//El formato es register(nombreMetodo, parametrosEntrada, parametrosSalida, namespace, soapaction, style, uso, descripcion)
//nombreMetodo: Es el nombre el método.
//parametrosEntrada: Van dentro de un arreglo, así: array('param1'=>'xsd:string', 'param2'=>'xsd:int')
//parametrosSalida: Van igual que los parametros de Entrada. Por defecto: array('return'=>'xsd:string')
//namespace: Colocamos el namespace que obtuvimos anteriormente.
//soapaction: Ocupamos la por defecto: false
//style: Estilo, tenemos rpc o document.
//use: encoded o literal.
//description: Descripción del método.
$server->register('funcionEjWS5', array("nroTramiteASD" => "xsd:int", "idTramiteEE" => "xsd:int", "idNuevoEstado" => "xsd:int"), array("return" => "xsd:string"), $namespace, false, 'rpc', 'encoded', 'Descripcion Ejemplo Tres');
//creamos el metodo, el nombre del método debe calzar con lo que colocamos anteriormente en register.
function funcionEjWS5($nroTramiteASD, $idTramiteEE, $idNuevoEstado)
{
    //CONEXION A LA BASE DE DATOS
    //Preparación de Datos de Conexión
    $ConexionTipoDB = "postgres";
    $ConexionHost = "localhost";
    $ConexionPuerto = "5433";
    $ConexionNombreDB = "EEMINSAL";
    $ConexionUsuario = "postgres";
    $ConexionPass = "******";
    $ConexionStringCompleto = "host={$ConexionHost} port={$ConexionPuerto} dbname={$ConexionNombreDB} user={$ConexionUsuario} password={$ConexionPass}";
    //La conexión en si:
    $conn =& ADONewConnection($ConexionTipoDB);
    $conn->PConnect($ConexionStringCompleto);
<?php

require_once 'nusoap.php';
$URL = "http://localhost/prak_sit_travel/service/service_login.php";
$namespace = $URL . '?wsdl';
$server = new soap_server();
$server->configureWSDL('travel', $namespace);
$server->register('login', array('input' => 'xsd:Array'), array('output' => 'xsd:Array'), 'urn:servicelogin', 'urn:login#login', 'rpc', 'encoded', 'login admin');
// koneksi ke database
include "koneksi.php";
function login($username, $password)
{
    $hash = md5($password);
    $query = "SELECT * FROM admin WHERE username = '******' AND password = '******'";
    $hasil = mysql_query($query);
    $num_rows = mysql_num_rows($hasil);
    // mereturn array hasil pencarian
    return $num_rows;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
Example #17
0
<?php

require_once 'lib/nusoap.php';
include 'funciones.php';
//instanacia al servidor
$server = new soap_server();
$ns = "urn:paiswsl";
$server->configureWSDL("Consulta Pais", $ns);
//$server->schemaTargetNamespace = $ns;
//$server->soap_defencoding = 'UTF-8';
//$server->decode_utf8 = false;
//$server->encode_utf8 = true;
/*
$server->register("Listar",
array("nombre_pais" => "xsd:string"),
array("return" => "xsd:string"),        
$ns);
*/
$server->register("ListarPaises", array("dato" => "xsd:string"), array("return" => "xsd:string"), "urn:listapaises");
$server->register("ListarClubes", array("dato" => "xsd:string"), array("return" => "xsd:string"), "urn:listaclubes");
$server->register("ImagenClub", array("dato" => "xsd:string"), array("return" => "xsd:string"), "urn:imagenclub");
$server->register("ImagenPais", array("dato" => "xsd:string"), array("return" => "xsd:string"), "urn:imagenpais");
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
Example #18
0
<?php 
	require_once("lib/nusoap.php"); 
	function concatenate($str1,$str2) {
		if (is_string($str1) && is_string($str2))
			return $str1 . $str2;
		else
			return new soap_fault(' 客户端 ','','concatenate 函数的参数应该是两个字符串 ');
	}
	$soap = new soap_server;
	$soap->register('concatenate');
	$soap->service($HTTP_RAW_POST_DATA);
?> 
Example #19
0
<?php

// Pull in the NuSOAP code
require_once 'lib/nusoap.php';
// Create the server instance
$server = new soap_server();
// Initialize WSDL support
$server->configureWSDL('commandinjwsdl', 'urn:commandinjwsdl');
// Register the method to expose
$server->register('commandinj', array('command' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:commandinjwsdl', 'urn:commandinjwsdl#commandinj', 'rpc', 'encoded', 'Returns the results of a command');
// Define the method as a PHP function
function commandinj($command)
{
    exec($command, $output);
    $results = "";
    while (list($key, $val) = each($output)) {
        $results = $results . $val;
    }
    return $results;
}
// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
<?php

//incluir soap
require_once 'soap/lib/nusoap.php';
require_once 'soap/lib/class.wsdlcache.php';
//objeto soap_server
$ns = "http://localhost/ProyectoSW/Lab6";
$server = new soap_server();
$server->configureWSDL('passfrec', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
//registramos la funcion
$server->register('passfrec', array('pass' => 'xsd:String', 'key' => 'xsd:String'), array('res' => 'xsd:String'), $ns);
//implementacion
function passfrec($pass, $key)
{
    $filas = file('tickets.txt');
    $pagado = false;
    foreach ($filas as $num_lineas => $fila) {
        if (strpos($fila, $key) !== false) {
            $pagado = true;
        }
    }
    if (!$pagado || strlen($key) < 4) {
        return 'No tienes una licencia valida';
    }
    $lineas = file('toppasswords.txt');
    $enc = false;
    foreach ($lineas as $num_lineas => $linea) {
        $coinciden = strpos($linea, $pass);
        if ($coinciden !== false) {
            $enc = true;
<?php

//incluimos la clase nusoap.php
require_once './lib/nusoap.php';
require_once './lib/class.wsdlcache.php';
//creamos el objeto de tipo soap_server
$ns = "http://vlana001sw.esy.es/SistemasWeb/Lab7/php";
$server = new soap_server();
$server->configureWSDL('passVal', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
//registramos la función que vamos a implementar
$server->register('passVal', array('password' => 'xsd:String'), array('x' => 'xsd:String'), $ns);
//implementamos la función
function passVal($password)
{
    $file = fopen("../txt/toppasswords.txt", "r") or die("Error al abrir el fichero toppasswords.txt");
    while (!feof($file)) {
        $line = fgets($file);
        if (strcmp(substr($line, 0, strlen($line) - 2), $password) == 0) {
            fclose($file);
            return "INVALIDA";
        }
    }
    fclose($file);
    return "VALIDA";
}
//llamamos al método service de la clase nusoap
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
Example #22
0
<?php

//incluimos la clase nusoap.php
require_once '../lib/nusoap.php';
require_once '../lib/class.wsdlcache.php';
//creamos el objeto de tipo soap_server
$ns = "http://vlana001sw.esy.es/SistemasWeb/Lab6/php/sw";
$server = new soap_server();
$server->configureWSDL('ticketVal', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
//registramos la función que vamos a implementar
$server->register('ticketVal', array('ticket' => 'xsd:String'), array('z' => 'xsd:String'), $ns);
//implementamos la función
function ticketVal($ticket)
{
    $file = fopen("../../txt/tickets.txt", "r") or die("Error al abrir el fichero tickets.txt");
    while (!feof($file)) {
        $line = fgets($file);
        if (strcmp(substr($line, 0, strlen($line) - 2), $ticket) == 0) {
            fclose($file);
            return "AUTORIZADO";
        }
    }
    fclose($file);
    return "NOAUTORIZADO";
}
//llamamos al método service de la clase nusoap
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
//Llamar a la librería que corresponde
require_once "lib/nusoap.php";
//Declaramos el NameSpace
$namespace = "urn:EjWS7_Server";
//Creamos el servidor con el que vamos a trabajar
$server = new soap_server();
//Configuramos el WSDL
$server->configureWSDL("EjWS7_Server");
//Asignamos nuestro NameSpace
$server->wsdl->schemaTargetNameSpace = $namespace;
//Registramos el método para que sea léido por el sistema
//El formato es register(nombreMetodo, parametrosEntrada, parametrosSalida, namespace, soapaction, style, uso, descripcion)
//nombreMetodo: Es el nombre el método.
//parametrosEntrada: Van dentro de un arreglo, así: array('param1'=>'xsd:string', 'param2'=>'xsd:int')
//parametrosSalida: Van igual que los parametros de Entrada. Por defecto: array('return'=>'xsd:string')
//namespace: Colocamos el namespace que obtuvimos anteriormente.
//soapaction: Ocupamos la por defecto: false
//style: Estilo, tenemos rpc o document.
//use: encoded o literal.
//description: Descripción del método.
$server->register('funcionEjWS7', array("nroTramite" => "xsd:int"), array("vigenciaTramite" => "xsd:boolean", "cuponPago" => "xsd:string", "valorTramite" => "xsd:string"), $namespace, false, 'rpc', 'encoded', 'Descripcion Ejemplo Tres');
//creamos el metodo, el nombre del método debe calzar con lo que colocamos anteriormente en register.
function funcionEjWS7($nroTramite)
{
    return array("vigenciaTramite" => true, "cuponPago" => "Uno", "valorTramite" => "dos");
}
// Se envía la data del servicio en caso de que este siendo consumido por un cliente.
$POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
// Enviamos la data a través de SOAP
$server->service($POST_DATA);
exit;
Example #24
0
$log =& LoggerManager::getLogger('portal');
$userid = getPortalUserid();
$user = new Users();
$current_user = $user->retrieveCurrentUserInfoFromFile($userid);
//error_reporting(0);
$NAMESPACE = 'http://www.yetiforce.com';
$server = new soap_server();
$server->configureWSDL('customerportal');
$server->wsdl->addComplexType('common_array', 'complexType', 'array', '', array('fieldname' => array('name' => 'fieldname', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('common_array1', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:common_array[]')), 'tns:common_array');
$server->wsdl->addComplexType('add_contact_detail_array', 'complexType', 'array', '', array('salutation' => array('name' => 'salutation', 'type' => 'xsd:string'), 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'), 'phone' => array('name' => 'phone', 'type' => 'xsd:string'), 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'), 'mobile' => array('name' => 'mobile', 'type' => 'xsd:string'), 'parentid' => array('name' => 'parentid', 'type' => 'xsd:string'), 'leadsource' => array('name' => 'leadsource', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('field_details_array', 'complexType', 'array', '', array('fieldlabel' => array('name' => 'fieldlabel', 'type' => 'xsd:string'), 'fieldvalue' => array('name' => 'fieldvalue', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('field_datalist_array', 'complexType', 'array', '', array('fielddata' => array('name' => 'fielddata', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('product_list_array', 'complexType', 'array', '', array('productid' => array('name' => 'productid', 'type' => 'xsd:string'), 'productname' => array('name' => 'productname', 'type' => 'xsd:string'), 'productcode' => array('name' => 'productcode', 'type' => 'xsd:string'), 'commissionrate' => array('name' => 'commissionrate', 'type' => 'xsd:string'), 'qtyinstock' => array('name' => 'qtyinstock', 'type' => 'xsd:string'), 'qty_per_unit' => array('name' => 'qty_per_unit', 'type' => 'xsd:string'), 'unit_price' => array('name' => 'unit_price', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('get_ticket_attachments_array', 'complexType', 'array', '', array('files' => array('fileid' => 'xsd:string', 'type' => 'tns:xsd:string', 'filename' => 'xsd:string', 'type' => 'tns:xsd:string', 'filesize' => 'xsd:string', 'type' => 'tns:xsd:string', 'filetype' => 'xsd:string', 'type' => 'tns:xsd:string', 'filecontents' => 'xsd:string', 'type' => 'tns:xsd:string')));
$server->register('authenticate_user', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('change_password', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('create_ticket', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
//for a particular contact ticket list
$server->register('get_tickets_list', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('get_ticket_comments', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('get_combo_values', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('get_KBase_details', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array1'), $NAMESPACE);
$server->register('save_faq_comment', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('update_ticket_comment', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('close_current_ticket', array('fieldname' => 'tns:common_array'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('send_mail_for_password', array('email' => 'xsd:string'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('get_ticket_creator', array('fieldname' => 'tns:common_array'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('get_picklists', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('get_ticket_attachments', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
$server->register('get_filecontent', array('fieldname' => 'tns:common_array'), array('return' => 'tns:common_array'), $NAMESPACE);
Example #25
0
$l_oServer->wsdl->addComplexType('CustomFieldDefinitionData', 'complexType', 'struct', 'all', '', array('field' => array('name' => 'field', 'type' => 'tns:ObjectRef', 'minOccurs' => '0'), 'type' => array('name' => 'type', 'type' => 'xsd:integer', 'minOccurs' => '0'), 'possible_values' => array('name' => 'possible_values', 'type' => 'xsd:string', 'minOccurs' => '0'), 'default_value' => array('name' => 'default_value', 'type' => 'xsd:string', 'minOccurs' => '0'), 'valid_regexp' => array('name' => 'valid_regexp', 'type' => 'xsd:string', 'minOccurs' => '0'), 'access_level_r' => array('name' => 'access_level_r', 'type' => 'xsd:integer', 'minOccurs' => '0'), 'access_level_rw' => array('name' => 'access_level_rw', 'type' => 'xsd:integer', 'minOccurs' => '0'), 'length_min' => array('name' => 'length_min', 'type' => 'xsd:integer', 'minOccurs' => '0'), 'length_max' => array('name' => 'length_max', 'type' => 'xsd:integer', 'minOccurs' => '0'), 'advanced' => array('name' => 'advanced', 'type' => 'xsd:boolean', 'minOccurs' => '0'), 'display_report' => array('name' => 'display_report', 'type' => 'xsd:boolean', 'minOccurs' => '0'), 'display_update' => array('name' => 'display_update', 'type' => 'xsd:boolean', 'minOccurs' => '0'), 'display_resolved' => array('name' => 'display_resolved', 'type' => 'xsd:boolean', 'minOccurs' => '0'), 'display_closed' => array('name' => 'display_closed', 'type' => 'xsd:boolean', 'minOccurs' => '0'), 'require_report' => array('name' => 'require_report', 'type' => 'xsd:boolean', 'minOccurs' => '0'), 'require_update' => array('name' => 'require_update', 'type' => 'xsd:boolean', 'minOccurs' => '0'), 'require_resolved' => array('name' => 'require_resolved', 'type' => 'xsd:boolean', 'minOccurs' => '0'), 'require_closed' => array('name' => 'require_closed', 'type' => 'xsd:boolean', 'minOccurs' => '0')));
### CustomFieldDefinitionDataArray
$l_oServer->wsdl->addComplexType('CustomFieldDefinitionDataArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:CustomFieldDefinitionData[]')), 'tns:CustomFieldDefinitionData');
### CustomFieldLinkForProjectData
$l_oServer->wsdl->addComplexType('CustomFieldLinkForProjectData', 'complexType', 'struct', 'all', '', array('field' => array('name' => 'field', 'type' => 'tns:ObjectRef', 'minOccurs' => '0'), 'sequence' => array('name' => 'sequence', 'type' => 'xsd:byte', 'minOccurs' => '0')));
### CustomFieldLinkForProjectDataArray
$l_oServer->wsdl->addComplexType('CustomFieldLinkForProjectDataArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:CustomFieldLinkForProjectData[]')), 'tns:CustomFieldLinkForProjectData');
### CustomFieldValueForIssueData
$l_oServer->wsdl->addComplexType('CustomFieldValueForIssueData', 'complexType', 'struct', 'all', '', array('field' => array('name' => 'field', 'type' => 'tns:ObjectRef', 'minOccurs' => '0'), 'value' => array('name' => 'value', 'type' => 'xsd:string', 'minOccurs' => '0')));
### CustomFieldValueForIssueDataArray
$l_oServer->wsdl->addComplexType('CustomFieldValueForIssueDataArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:CustomFieldValueForIssueData[]')), 'tns:CustomFieldValueForIssueData');
###
###  PUBLIC METHODS
###
### mc_version
$l_oServer->register('mc_version', array(), array('return' => 'xsd:string'), $t_namespace);
###
###  PUBLIC METHODS (defined in mc_enum_api.php)
###
### mc_enum_status
$l_oServer->register('mc_enum_status', array('username' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'tns:ObjectRefArray'), $t_namespace, false, false, false, 'Get the enumeration for statuses.');
### mc_enum_priorities
$l_oServer->register('mc_enum_priorities', array('username' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'tns:ObjectRefArray'), $t_namespace, false, false, false, 'Get the enumeration for priorities.');
### mc_enum_severities
$l_oServer->register('mc_enum_severities', array('username' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'tns:ObjectRefArray'), $t_namespace, false, false, false, 'Get the enumeration for severities.');
### mc_enum_reproducibilities
$l_oServer->register('mc_enum_reproducibilities', array('username' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'tns:ObjectRefArray'), $t_namespace, false, false, false, 'Get the enumeration for reproducibilities.');
### mc_enum_projections
$l_oServer->register('mc_enum_projections', array('username' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'tns:ObjectRefArray'), $t_namespace, false, false, false, 'Get the enumeration for projections.');
### mc_enum_etas
$l_oServer->register('mc_enum_etas', array('username' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'tns:ObjectRefArray'), $t_namespace, false, false, false, 'Get the enumeration for ETAs.');
Example #26
0
<?php

include_once 'lib/nusoap.php';
$servicio = new soap_server();
$ns = "urn:miserviciowsdl";
$servicio->configureWSDL("MiPrimerServicioWeb", $ns);
$servicio->schemaTargetNamespace = $ns;
$servicio->register("MiFuncion", array('fecha' => 'xsd:string', 'componente' => 'xsd:string', 'probabilidad' => 'xsd:float'), array('return' => 'xsd:string'), $ns);
function MiFuncion($fecha, $componente, $probabilidad)
{
    $resultadoDisponibilidad = $probabilidad * 100;
    $resultado = "La dispnibilidad del componente " . $componente . " en la fecha: " . $fecha . " es: " . $resultadoDisponibilidad . "% calculado desde el servicio web de Conexion";
    $respuesta = array('frase' => $resultado, 'probabilidad' => $resultadoDisponibilidad);
    return json_encode($respuesta);
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$servicio->service($HTTP_RAW_POST_DATA);
Example #27
0
$server = new soap_server();
$server->configureWSDL('servidor', $namespace);
//Define our namespace
/*$server->wsdl->addComplexType(
    'Person',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id_user' => array('name' => 'id_user', 'type' => 'xsd:int'))
);

*/
//first simple function
$server->register('insertar_persona', array('cedula' => 'xsd:string', 'nombre' => 'xsd:string', 'apellido' => 'xsd:string', 'ruc' => 'xsd:string', 'direccion' => 'xsd:string', 'email' => 'xsd:string', 'telefono' => 'xsd:string', 'fecha' => 'xsd:date', 'ventana' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:Servidor.insertar_persona', 'urn:Servidor.insertar_persona', 'rpc', 'encoded', 'Se inserta en personas');
$server->register('insertar_anamnesis', array('cedula' => 'xsd:string', 'motivo_consulta' => 'xsd:string', 'antecedentes_familiares' => 'xsd:string', 'antecedentes_desarrollo' => 'xsd:string', 'aspectos_generales' => 'xsd:string', 'conclusiones' => 'xsd:string', 'observaciones' => 'xsd:string', 'plan_evaluacion' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:Servidor.insertar_anamnesis', 'urn:Servidor.insertar_anamnesis', 'rpc', 'encoded', 'Se inserta el anamnesis');
$server->register('recuperar_paciente', array('cedula' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:Servidor.recuperar_paciente', 'urn:Servidor.recuperar_paciente', 'rpc', 'encoded', 'Just say hello');
$server->register('recuperar_medico', array('cedula' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:Servidor.recuperar_medico', 'urn:Servidor.recuperar_medico', 'rpc', 'encoded', 'Recuperar');
$server->register('verificar_persona', array('cedula' => 'xsd:string'), array('return' => 'xsd:boolean'), 'urn:Servidor.verificar_persona', 'urn:Servidor.verificar_persona', 'rpc', 'encoded', 'Verificar');
$server->register('facturar', array('fecha' => 'xsd:date', 'iva' => 'xsd:numeric', 'total' => 'xsd:numeric', 'usuario' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:Servidor.facturar', 'urn:Servidor.facturar', 'rpc', 'encoded', 'Facturar');
$server->register('facturar2', array('cedulaP' => 'xsd:string', 'cedulaM' => 'xsd:string', 'fecha' => 'xsd:date', 'horario' => 'xsd:time', 'direccion' => 'xsd:string', 'cantidadH' => 'xsd:integer', 'iva' => 'xsd:numeric', 'total' => 'xsd:numeric', 'usuario' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:Servidor.facturar2', 'urn:Servidor.facturar2', 'rpc', 'encoded', 'Facturar2');
$server->register('verificar_fecha', array('cedulaP' => 'xsd:string', 'cedulaM' => 'xsd:string', 'fecha' => 'xsd:date', 'horario' => 'xsd:time'), array('return' => 'xsd:string'), 'urn:Servidor.verificar_fecha', 'urn:Servidor.verificar_fecha', 'rpc', 'encoded', 'Verificar fecha');
$server->register('agendar', array('cedulaP' => 'xsd:string', 'cedulaM' => 'xsd:string', 'fecha' => 'xsd:date', 'horario' => 'xsd:time', 'comentario' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:Servidor.verificar_fecha', 'urn:Servidor.verificar_fecha', 'rpc', 'encoded', 'Verificar fecha');
$server->register('diagnostico', array('cedula' => 'xsd:string', 'resumen' => 'xsd:string', 'procedimientos_utilizados' => 'xsd:string', 'diagnostico_sindromes' => 'xsd:string', 'diagnostico_nosografico' => 'xsd:string', 'diagnostico_etiologico' => 'xsd:string', 'diagnostico_patogenico' => 'xsd:string', 'conclusion' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:Servidor.diagnostico', 'urn:Servidor.diagnostico', 'rpc', 'encoded', 'Diagnostico');
function diagnostico($cedula, $resumen, $procedimientos_utilizados, $diagnostico_sindromes, $diagnostico_nosografico, $diagnostico_etiologico, $diagnostico_patogenico, $conclusion)
{
    include_once 'biblioteca/conexionBd.php';
    $recursoDeConexion = conectar('postgresql');
    $query = "select id_anamnesis from anamnesis where cedula='{$cedula}'";
    $rs = ejecutarQueryPostgreSql($recursoDeConexion, $query);
Example #28
0
 *
 * @author Yannick Warnier <*****@*****.**>
 * @package chamilo.webservices
 */
require_once '../inc/global.inc.php';
$libpath = api_get_path(LIBRARY_PATH);
// Create the server instance
$server = new soap_server();
// Initialize WSDL support
$server->configureWSDL('WSUserInfo', 'urn:WSUserInfo');
/* Register WSCourseList function */
// Register the data structures used by the service
$server->wsdl->addComplexType('courseDetails', 'complexType', 'struct', 'all', '', array('name' => 'code', 'type' => 'xsd:string', 'name' => 'title', 'type' => 'xsd:string', 'name' => 'url', 'type' => 'xsd:string', 'name' => 'teacher', 'type' => 'xsd:string', 'name' => 'language', 'type' => 'xsd:string'));
$server->wsdl->addComplexType('courseList', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP:ENC:arrayType', 'wsdl:arrayType' => 'tns:courseDetails[]')), 'tns:courseDetails');
// Register the method to expose
$server->register('WSCourseListOfUser', array('username' => 'xsd:string', 'signature' => 'xsd:string'), array('return' => 'xsd:Array'), 'urn:WSUserInfo', 'urn:WSUserInfo#WSUserInfo', 'rpc', 'encoded', 'This service returns a list of courses');
/**
 * Get a list of courses (code, url, title, teacher, language) for a specific
 * user and return to caller
 * Function registered as service. Returns strings in UTF-8.
 * @param string User name in Chamilo
 * @param string Signature (composed of the sha1(username+apikey)
 * @return array Courses list (code=>[title=>'title',url='http://...',teacher=>'...',language=>''],code=>[...],...)
 */
function WSCourseListOfUser($username, $signature)
{
    if (empty($username) or empty($signature)) {
        return -1;
    }
    global $_configuration;
    $info = api_get_user_info_from_username($username);
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/
require_once "config.php";
require_once 'include/logging.php';
require_once 'include/nusoap/nusoap.php';
require_once 'include/database/PearDatabase.php';
require_once 'modules/Contacts/Contacts.php';
$log =& LoggerManager::getLogger('thunderbirdplugin');
$accessDenied = "You are not authorized for performing this action";
$NAMESPACE = 'http://www.vtiger.com/products/crm';
$server = new soap_server();
$server->configureWSDL('vtigersoap');
$server->register('create_session', array('user_name' => 'xsd:string', 'password' => 'xsd:string', 'version' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('end_session', array('user_name' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('SearchContactsByEmail', array('username' => 'xsd:string', 'password' => 'xsd:string', 'emailaddress' => 'xsd:string'), array('return' => 'tns:contactdetails'), $NAMESPACE);
$server->register('GetContacts', array('username' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'tns:contactdetails'), $NAMESPACE);
$server->register('CheckContactPerm', array('user_name' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('CheckContactViewPerm', array('user_name' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('CheckContactEmailPerm', array('user_name' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('CheckLeadViewPerm', array('user_name' => 'xsd:string', 'password' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('AddContact', array('user_name' => 'xsd:string', 'first_name' => 'xsd:string', 'last_name' => 'xsd:string', 'email_address' => 'xsd:string', 'account_name' => 'xsd:string', 'salutation' => 'xsd:string', 'title' => 'xsd:string', 'phone_mobile' => 'xsd:string', 'reports_to' => 'xsd:string', 'primary_address_street' => 'xsd:string', 'primary_address_city' => 'xsd:string', 'primary_address_state' => 'xsd:string', 'primary_address_postalcode' => 'xsd:string', 'primary_address_country' => 'xsd:string', 'alt_address_city' => 'xsd:string', 'alt_address_street' => 'xsd:string', 'alt_address_state' => 'xsd:string', 'alt_address_postalcode' => 'xsd:string', 'alt_address_country' => 'xsd:string', 'office_phone' => 'xsd:string', 'home_phone' => 'xsd:string', 'fax' => 'xsd:string', 'department' => 'xsd:string', 'password' => 'xsd:string', 'description' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('AddLead', array('user_name' => 'xsd:string', 'first_name' => 'xsd:string', 'last_name' => 'xsd:string', 'email_address' => 'xsd:string', 'account_name' => 'xsd:string', 'salutation' => 'xsd:string', 'title' => 'xsd:string', 'phone_mobile' => 'xsd:string', 'reports_to' => 'xsd:string', 'primary_address_street' => 'xsd:string', 'primary_address_city' => 'xsd:string', 'primary_address_state' => 'xsd:string', 'primary_address_postalcode' => 'xsd:string', 'primary_address_country' => 'xsd:string', 'alt_address_city' => 'xsd:string', 'alt_address_street' => 'xsd:string', 'alt_address_state' => 'xsd:string', 'alt_address_postalcode' => 'xsd:string', 'alt_address_country' => 'xsd:string', 'office_phone' => 'xsd:string', 'home_phone' => 'xsd:string', 'fax' => 'xsd:string', 'department' => 'xsd:string', 'password' => 'xsd:string', 'description' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->register('track_email', array('user_name' => 'xsd:string', 'password' => 'xsd:string', 'contact_ids' => 'xsd:string', 'date_sent' => 'xsd:string', 'email_subject' => 'xsd:string', 'email_body' => 'xsd:string'), array('return' => 'xsd:string'), $NAMESPACE);
$server->wsdl->addComplexType('contactdetail', 'complexType', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'), 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'), 'emailaddress' => array('name' => 'emailaddress', 'type' => 'xsd:string'), 'accountname' => array('name' => 'accountname', 'type' => 'xsd:string'), 'middlename' => array('name' => 'middlename', 'type' => 'xsd:string'), 'birthdate' => array('name' => 'birthdate', 'type' => 'xsd:string'), 'jobtitle' => array('name' => 'jobtitle', 'type' => 'xsd:string'), 'department' => array('name' => 'department', 'type' => 'xsd:string'), 'title' => array('name' => 'title', 'type' => 'xsd:string'), 'officephone' => array('name' => 'officephone', 'type' => 'xsd:string'), 'homephone' => array('name' => 'homephone', 'type' => 'xsd:string'), 'otherphone' => array('name' => 'otherphone', 'type' => 'xsd:string'), 'fax' => array('name' => 'fax', 'type' => 'xsd:string'), 'mobile' => array('name' => 'mobile', 'type' => 'xsd:string'), 'asstname' => array('name' => 'asstname', 'type' => 'xsd:string'), 'asstphone' => array('name' => 'asstphone', 'type' => 'xsd:string'), 'reportsto' => array('name' => 'reportsto', 'type' => 'xsd:string'), 'mailingstreet' => array('name' => 'mailingstreet', 'type' => 'xsd:string'), 'mailingcity' => array('name' => 'mailingcity', 'type' => 'xsd:string'), 'mailingstate' => array('name' => 'mailingstate', 'type' => 'xsd:string'), 'mailingzip' => array('name' => 'mailingzip', 'type' => 'xsd:string'), 'mailingcountry' => array('name' => 'mailingcountry', 'type' => 'xsd:string'), 'otherstreet' => array('name' => 'otherstreet', 'type' => 'xsd:string'), 'othercity' => array('name' => 'othercity', 'type' => 'xsd:string'), 'otherstate' => array('name' => 'otherstate', 'type' => 'xsd:string'), 'otherzip' => array('name' => 'otherzip', 'type' => 'xsd:string'), 'othercountry' => array('name' => 'othercountry', 'type' => 'xsd:string'), 'description' => array('name' => 'description', 'type' => 'xsd:string'), 'category' => array('name' => 'category', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('contactdetails', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:contactdetail[]')), 'tns:contactdetail');
function SearchContactsByEmail($username, $password, $emailaddress)
{
    if (authentication($username, $password)) {
Example #30
0
<?php

//incluindo do arquivo nusoap
require_once 'ws\\nusoap.php';
$server = new soap_server();
$server->register('hello');
function hello($name)
{
    return 'HELLO' . $name;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);