Example #1
0
function initSoapRequest($namespace, $nsurl)
{
    global $nuserver, $HTTP_RAW_POST_DATA;
    if (!$HTTP_RAW_POST_DATA) {
        $HTTP_RAW_POST_DATA = file_get_contents('php://input');
    }
    $nuserver = new nusoap_server();
    $nuserver->configureWSDL($namespace, $nsurl);
    $nuserver->wsdl->schemaTargetNamespace = $nsurl;
    /*
    	Define string und integer-arrays
    */
    $nuserver->wsdl->addComplexType('ArrayOfstring', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:string[]')), 'xsd:string');
    $nuserver->wsdl->addComplexType('ArrayOfint', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:int[]')), 'xsd:int');
}
 public function __construct($wsdl = "IShopClientWS.wsdl", $options = array())
 {
     foreach (self::$classmap as $key => $value) {
         if (!isset($options['classmap'][$key])) {
             $options['classmap'][$key] = $value;
         }
     }
     parent::__construct($wsdl, $options);
 }
Example #3
0
 function parseRequest($headers, $data)
 {
     $this->debug('Entering parseRequest() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']);
     $this->requestAttachments = array();
     if (strstr($headers['content-type'], $this->dimeContentType)) {
         $this->_decodeDIMEMessage($headers, $data);
     } else {
         $this->debug('Not dime content');
     }
     if (!$this->validate_signatrue($data)) {
         $errmsg = 'SOAP Signatrue ERROR';
         if (isset($GLOBALS['validate_signatrue_errmsg'])) {
             $errmsg = $GLOBALS['validate_signatrue_errmsg'];
         }
         $this->fault('TokenError', $errmsg);
     }
     return parent::parseRequest($headers, $data);
 }
Example #4
0
 function parseRequest($headers, $data)
 {
     $this->debug('Entering parseRequest() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']);
     $this->requestAttachments = array();
     //ob_start();
     //var_dump($headers);
     //var_dump($data);
     //echo "\r\n\r\n";
     if (strstr($headers['content-type'], $this->dimeContentType)) {
         $this->_decodeDIMEMessage($headers, $data);
     } else {
         $this->debug('Not dime content');
     }
     if (!$this->validate_signatrue($data)) {
         $this->fault('TokenError', '证书验证失败,请使用正确的ShopEx证书。');
     }
     //var_dump($this->requestAttachments);
     //$logdata = ob_get_contents();
     //file_put_contents(dirname(__FILE__).'/log.txt', $logdata);
     //ob_end_clean();
     return parent::parseRequest($headers, $data);
 }
Example #5
0
<?php

error_reporting(E_ALL);
ini_set('display_error', 1);
require_once 'nusoap/lib/nusoap.php';
require_once 'adodb/adodb.inc.php';
require_once 'penduduk.php';
require_once 'kartuKeluarga.php';
$server = new nusoap_server();
$server->configureWSDL('Service Kependudukan', 'urn:kependudukan');
$server->wsdl->schemaTargetNamespace = 'urn:kependudukan';
$server->register('get_penduduk', array('nik' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#get_penduduk', 'rpc', 'encoded', 'mengambil semua data penduduk');
$server->register('get_penduduk_by_gender_male', array('nik' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#get_penduduk_by_gender_male', 'rpc', 'encoded', 'mengambil semua data penduduk berdasarkan gender laki-laki');
$server->register('get_penduduk_by_nik', array('nik' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#get_penduduk_by_nik', 'rpc', 'encoded', 'mengambil data penduduk berdasarkan nik');
$server->register('hapus_penduduk', array('nik' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#hapus_penduduk', 'rpc', 'encoded', 'menghapus data penduduk');
$server->register('tambah_penduduk', array('NIK' => 'xsd:string', 'nama' => 'xsd:string', 'jenis_kelamin' => 'xsd:string', 'nama' => 'xsd:string', 'tempat_lahir' => 'xsd:string', 'tanggal_lahir' => 'xsd:string', 'agama' => 'xsd:string', 'pendidikan' => 'xsd:string', 'no_kk' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#tambah_penduduk', 'rpc', 'encoded', 'menambah data penduduk');
$server->register('ubah_penduduk', array('NIKAWAL' => 'xsd:string', 'NIK' => 'xsd:string', 'nama' => 'xsd:string', 'jenis_kelamin' => 'xsd:string', 'nama' => 'xsd:string', 'tempat_lahir' => 'xsd:string', 'tanggal_lahir' => 'xsd:string', 'agama' => 'xsd:string', 'pendidikan' => 'xsd:string', 'no_kk' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#ubah_penduduk', 'rpc', 'encoded', 'merubah data penduduk');
$server->register('get_kartuKeluarga', array('nik' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#get_kartuKeluarga', 'rpc', 'encoded', 'mengambil semua data kartu keluarga');
$server->register('hapus_kartuKeluarga', array('no_kk' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#hapus_kartuKeluarga', 'rpc', 'encoded', 'menghapus data kartu keluarga');
$server->register('tambah_kartuKeluarga', array('no_kk' => 'xsd:string', 'kepala_keluarga' => 'xsd:string', 'alamat' => 'xsd:string', 'rt' => 'xsd:string', 'rw' => 'xsd:string', 'desa' => 'xsd:string', 'kecamatan' => 'xsd:string', 'kabupaten' => 'xsd:string', 'provinsi' => 'xsd:string', 'kode_pos' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#tambah_kartuKeluarga', 'rpc', 'encoded', 'menambah data kartu keluarga');
$server->register('ambilDataKKByNoKK', array('no_kk' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#ambilDataKKByNoKK', 'rpc', 'encoded', 'mengambil data kartu keluarga berdasarkan no kk');
$server->register('ambilAnggotaKeluarga', array('no_kk' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#ambilAnggotaKeluarga', 'rpc', 'encoded', 'mengambil data anggota keluarga berdasarkan no kk');
$server->register('ambilNonAnggotaKeluarga', array('no_kk' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#ambilNonAnggotaKeluarga', 'rpc', 'encoded', 'mengambil data yang bukan anggota keluarga');
$server->register('tambahAnggotaKartuKeluarga', array('no_kk' => 'xsd:string', 'NIK' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#tambahAnggotaKartuKeluarga', 'rpc', 'encoded', 'menambah data anggota keluarga');
$server->register('ubah_kartuKeluarga', array('no_kkAwal' => 'xsd:string', 'no_kk' => 'xsd:string', 'kepala_keluarga' => 'xsd:string', 'alamat' => 'xsd:string', 'rt' => 'xsd:string', 'rw' => 'xsd:string', 'desa' => 'xsd:string', 'kecamatan' => 'xsd:string', 'kabupaten' => 'xsd:string', 'provinsi' => 'xsd:string', 'kode_pos' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#ubah_kartuKeluarga', 'rpc', 'encoded', 'mengubah data kartu keluarga');
$server->register('hapusAnggotaKeluarga', array('no_kk' => 'xsd:string', 'nama' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:kependudukan', 'urn:kependudukan#hapusAnggotaKeluarga', 'rpc', 'encoded', 'menghapus anggota keluarga');
function hapusAnggotaKeluarga($no_kk, $nama)
{
    $kartukeluarga = new kartukeluarga();
    return $kartukeluarga->hapusAnggotaKeluarga($no_kk, $nama);
}
Example #6
0
<?php

require_once "nusoap.php";
$server = new nusoap_server();
require_once "CConf_class.php";
$server->register('CConf.getName');
$server->register('CConf.getInterface');
$server->register('CConf.processData');
$server->register('CConf.getPolicySections');
//$server->register('CConf.getDefCaSectionName');
$server->register('CConf.getDefCaSecPolicyName');
$server->register('CConf.getInfoForGivenSectionName', array('sec_name' => 'xsd:string', 'conf_path' => 'xsd:string'), array(), 'uri:helloworld', 'uri:helloworld/hello', 'rpc', 'encoded');
$server->register('CConf.getSsCertInfo');
//$server->register('CConf.getSpkacSignInfo');
$server->register('CConf.getExtensionSections');
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
Example #7
0
<?php

require_once '../../lib/nusoap/lib/nusoap.php';
$server = new nusoap_server();
$server->register('salam');
function salam($nama)
{
    if ($nama == '') {
        return new nusoap_fault('Client', '', 'harus suplai dengan valid string');
    } else {
        $result = 'Halo ' . $nama;
        return $result;
    }
}
$server->service($HTTP_RAW_POST_DATA);
?>

<?php

require_once "CReqGen_class.php";
require_once 'nusoap.php';
$debug = 1;
$server = new nusoap_server();
$server->register('CReqGen.getInterface');
$server->register('CReqGen.processData');
$server->register('CReqGen.getName');
//Вот кто поймет что здесь написанно ТОМУ ПРИЗ!!!!!!!!!!!!
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>


<?php

// enable error reporting
error_reporting(E_ALL);
ini_set('display_error', 1);
require_once "nusoap/lib/nusoap.php";
// initialize and configure server
$server = new nusoap_server();
$server->configureWSDL('login', 'urn:login');
$server->wsdl->schemeTargeNamespace = "urn:login";
// register
$server->register('loginService', array('nim' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:server', 'urn:server#loginServer', 'rpc', 'encoded', 'login ke aplikasi');
// create functions
function dbConnect($query)
{
    try {
        $connect = mysql_connect("localhost", "root", "");
        $db = mysql_select_db("universitas");
        return mysql_query($query);
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
function loginService($nim)
{
    // Check whether the user has filled all the required fields
    if (empty($nim)) {
        return 'Data tidak boleh kosong!';
    }
    // sanitize the input from user
    $nim = strip_tags(mysql_real_escape_string($nim));
Example #10
0
require_once "../master.inc.php";
require_once NUSOAP_PATH . '/nusoap.php';
// Include SOAP
require_once DOL_DOCUMENT_ROOT . '/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT . "/categories/class/categorie.class.php";
dol_syslog("Call Dolibarr webservices interfaces");
// Enable and test if module web services is enabled
if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) {
    $langs->load("admin");
    dol_syslog("Call Dolibarr webservices interfaces with module webservices disabled");
    print $langs->trans("WarningModuleNotActive", 'WebServices') . '.<br><br>';
    print $langs->trans("ToActivateModule");
    exit;
}
// Create the soap Object
$server = new nusoap_server();
$server->soap_defencoding = 'UTF-8';
$server->decode_utf8 = false;
$ns = 'http://www.dolibarr.org/ns/';
$server->configureWSDL('WebServicesDolibarrCategorie', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
// Define WSDL content
$server->wsdl->addComplexType('authentication', 'complexType', 'struct', 'all', '', array('dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), 'login' => array('name' => 'login', 'type' => 'xsd:string'), 'password' => array('name' => 'password', 'type' => 'xsd:string'), 'entity' => array('name' => 'entity', 'type' => 'xsd:string')));
/*
 * Une catégorie
 */
$server->wsdl->addComplexType('categorie', 'complexType', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'id_mere' => array('name' => 'id_mere', 'type' => 'xsd:string'), 'label' => array('name' => 'label', 'type' => 'xsd:string'), 'description' => array('name' => 'description', 'type' => 'xsd:string'), 'socid' => array('name' => 'socid', 'type' => 'xsd:string'), 'type' => array('name' => 'type', 'type' => 'xsd:string'), 'visible' => array('name' => 'visible', 'type' => 'xsd:string'), 'dir' => array('name' => 'dir', 'type' => 'xsd:string'), 'photos' => array('name' => 'photos', 'type' => 'tns:PhotosArray'), 'filles' => array('name' => 'filles', 'type' => 'tns:FillesArray')));
/*
 * Les catégories filles, sous tableau dez la catégorie
 */
$server->wsdl->addComplexType('FillesArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:categorie[]')), 'tns:categorie');
Example #11
0
require_once NUSOAP_PATH . '/nusoap.php';
// Include SOAP
require_once DOL_DOCUMENT_ROOT . "/core/lib/ws.lib.php";
require_once DOL_DOCUMENT_ROOT . "/contact/class/contact.class.php";
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
dol_syslog("Call Contact webservices interfaces");
// Enable and test if module web services is enabled
if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) {
    $langs->load("admin");
    dol_syslog("Call Dolibarr webservices interfaces with module webservices disabled");
    print $langs->trans("WarningModuleNotActive", 'WebServices') . '.<br><br>';
    print $langs->trans("ToActivateModule");
    exit;
}
// Create the soap Object
$server = new nusoap_server();
$server->soap_defencoding = 'UTF-8';
$server->decode_utf8 = false;
$ns = 'http://www.dolibarr.org/ns/';
$server->configureWSDL('WebServicesDolibarrContact', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
// Define WSDL Authentication object
$server->wsdl->addComplexType('authentication', 'complexType', 'struct', 'all', '', array('dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), 'login' => array('name' => 'login', 'type' => 'xsd:string'), 'password' => array('name' => 'password', 'type' => 'xsd:string'), 'entity' => array('name' => 'entity', 'type' => 'xsd:string')));
// Define WSDL Return object
$server->wsdl->addComplexType('result', 'complexType', 'struct', 'all', '', array('result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string')));
$contact_fields = array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'), 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'), 'address' => array('name' => 'address', 'type' => 'xsd:string'), 'zip' => array('name' => 'zip', 'type' => 'xsd:string'), 'town' => array('name' => 'town', 'type' => 'xsd:string'), 'state_id' => array('name' => 'state_id', 'type' => 'xsd:string'), 'state_code' => array('name' => 'state_code', 'type' => 'xsd:string'), 'state' => array('name' => 'state', 'type' => 'xsd:string'), 'country_id' => array('name' => 'country_id', 'type' => 'xsd:string'), 'country_code' => array('name' => 'country_code', 'type' => 'xsd:string'), 'country' => array('name' => 'country', 'type' => 'xsd:string'), 'socid' => array('name' => 'socid', 'type' => 'xsd:string'), 'status' => array('name' => 'status', 'type' => 'xsd:string'), 'phone_pro' => array('name' => 'phone_pro', 'type' => 'xsd:string'), 'fax' => array('name' => 'fax', 'type' => 'xsd:string'), 'phone_perso' => array('name' => 'phone_perso', 'type' => 'xsd:string'), 'phone_mobile' => array('name' => 'phone_mobile', 'type' => 'xsd:string'), 'code' => array('name' => 'code', 'type' => 'xsd:string'), 'email' => array('name' => 'email', 'type' => 'xsd:string'), 'birthday' => array('name' => 'birthday', 'type' => 'xsd:string'), 'default_lang' => array('name' => 'default_lang', 'type' => 'xsd:string'), 'note' => array('name' => 'note', 'type' => 'xsd:string'), 'no_email' => array('name' => 'no_email', 'type' => 'xsd:string'), 'ref_facturation' => array('name' => 'ref_facturation', 'type' => 'xsd:string'), 'ref_contrat' => array('name' => 'ref_contrat', 'type' => 'xsd:string'), 'ref_commande' => array('name' => 'ref_commande', 'type' => 'xsd:string'), 'ref_propal' => array('name' => 'ref_propal', 'type' => 'xsd:string'), 'user_id' => array('name' => 'user_id', 'type' => 'xsd:string'), 'user_login' => array('name' => 'user_login', 'type' => 'xsd:string'), 'civility_id' => array('name' => 'civility_id', 'type' => 'xsd:string'), 'poste' => array('name' => 'poste', 'type' => 'xsd:string'), 'statut' => array('name' => 'statut', 'type' => 'xsd:string'));
//Retreive all extrafield for contact
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
if (count($extrafields) > 0) {
Example #12
0
 * @author Agung Harry Purnama
 */
/* Load bootstrap so we can get started */
// nothing todo for now
define('MUST_FROM_INDEX', 'SAMPLE_WS2011.2');
//load nusoap library
require 'lib/webi/nusoap.php';
//run ws server
if (!defined('MUST_FROM_INDEX')) {
    exit('Cannot access file directly');
}
//WS Configuration
define('WS_SIKP', 'BDS_SECURITY');
define('WS_NAMA_WSDL', 'WSDL_' . WS_SIKP . '.wsdl');
//Create WS Service Instance with WSDL
$ws_svr = new nusoap_server();
$ws_svr->soap_defencoding = 'UTF-8';
$ws_svr->configureWSDL(WS_SIKP, 'urn:' . WS_NAMA_WSDL);
function ws_proccess($search, $getParams, $controller, $postParams, $jsonItems, $start, $limit)
{
    $GLOBALS["Webi_PageTime"] = microtime(true);
    include 'lib/bootstrap.php';
    /* Load Webi Core */
    sys::import('webi.core');
    wbCore::init();
    $_GET['jsonItems'] = $jsonItems;
    if (!empty($getParams)) {
        $getParams =& wbUtil::jsonDecode($getParams);
    } else {
        $getParams = array();
    }
// Include SOAP
require_once DOL_DOCUMENT_ROOT . '/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
dol_syslog("Call Dolibarr webservices interfaces");
$langs->load("main");
// Enable and test if module web services is enabled
if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) {
    $langs->load("admin");
    dol_syslog("Call Dolibarr webservices interfaces with module webservices disabled");
    print $langs->trans("WarningModuleNotActive", 'WebServices') . '.<br><br>';
    print $langs->trans("ToActivateModule");
    exit;
}
// Create the soap Object
$server = new nusoap_server();
$server->soap_defencoding = 'UTF-8';
$server->decode_utf8 = false;
$ns = 'http://www.dolibarr.org/ns/';
$server->configureWSDL('WebServicesDolibarrSupplierInvoice', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
// Define WSDL Authentication object
$server->wsdl->addComplexType('authentication', 'complexType', 'struct', 'all', '', array('dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), 'login' => array('name' => 'login', 'type' => 'xsd:string'), 'password' => array('name' => 'password', 'type' => 'xsd:string'), 'entity' => array('name' => 'entity', 'type' => 'xsd:string')));
// Define WSDL Return object
$server->wsdl->addComplexType('result', 'complexType', 'struct', 'all', '', array('result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string')));
// Define other specific objects
$server->wsdl->addComplexType('line', 'element', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'type' => array('name' => 'type', 'type' => 'xsd:int'), 'desc' => array('name' => 'desc', 'type' => 'xsd:string'), 'fk_product' => array('name' => 'fk_product', 'type' => 'xsd:int'), 'total_net' => array('name' => 'total_net', 'type' => 'xsd:double'), 'total_vat' => array('name' => 'total_vat', 'type' => 'xsd:double'), 'total' => array('name' => 'total', 'type' => 'xsd:double'), 'vat_rate' => array('name' => 'vat_rate', 'type' => 'xsd:double'), 'qty' => array('name' => 'qty', 'type' => 'xsd:double'), 'date_start' => array('name' => 'date_start', 'type' => 'xsd:date'), 'date_end' => array('name' => 'date_end', 'type' => 'xsd:date'), 'product_ref' => array('name' => 'product_ref', 'type' => 'xsd:string'), 'product_label' => array('name' => 'product_label', 'type' => 'xsd:string'), 'product_desc' => array('name' => 'product_desc', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('LinesArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:line[]')), 'tns:line');
$server->wsdl->addComplexType('invoice', 'element', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'ref' => array('name' => 'ref', 'type' => 'xsd:string'), 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), 'ref_supplier' => array('name' => 'ref_supplier', 'type' => 'xsd:string'), 'fk_user_author' => array('name' => 'fk_user_author', 'type' => 'xsd:int'), 'fk_user_valid' => array('name' => 'fk_user_valid', 'type' => 'xsd:int'), 'fk_thirdparty' => array('name' => 'fk_thirdparty', 'type' => 'xsd:int'), 'date_creation' => array('name' => 'date_creation', 'type' => 'xsd:dateTime'), 'date_validation' => array('name' => 'date_validation', 'type' => 'xsd:dateTime'), 'date_modification' => array('name' => 'date_modification', 'type' => 'xsd:dateTime'), 'date_invoice' => array('name' => 'date_invoice', 'type' => 'xsd:date'), 'date_term' => array('name' => 'date_modification', 'type' => 'xsd:date'), 'type' => array('name' => 'type', 'type' => 'xsd:int'), 'total_net' => array('name' => 'type', 'type' => 'xsd:double'), 'total_vat' => array('name' => 'type', 'type' => 'xsd:double'), 'total' => array('name' => 'type', 'type' => 'xsd:double'), 'note_private' => array('name' => 'note_private', 'type' => 'xsd:string'), 'note_public' => array('name' => 'note_public', 'type' => 'xsd:string'), 'status' => array('name' => 'status', 'type' => 'xsd:int'), 'close_code' => array('name' => 'close_code', 'type' => 'xsd:string'), 'close_note' => array('name' => 'close_note', 'type' => 'xsd:string'), 'lines' => array('name' => 'lines', 'type' => 'tns:LinesArray')));
$server->wsdl->addComplexType('InvoicesArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:invoice[]')), 'tns:invoice');
$server->wsdl->addComplexType('invoices', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:invoice[]')), 'tns:invoice');
 /**
  * Create a NuSOAP soap_server object
  * 
  * @param PhpWsdl $server The PhpWsdl object
  * @return nusoap_server The NuSOAP server object
  */
 public static function CreateServer($server)
 {
     if (!is_null(self::$Server)) {
         return self::$Server;
     }
     // Basic configuration
     self::$Server = new nusoap_server();
     self::$Server->debug_flag = false;
     self::$Server->soap_defencoding = 'UTF-8';
     self::$Server->decode_utf8 = false;
     self::$Server->configureWSDL($server->Name, $server->NameSpace, $server->EndPoint);
     self::$Server->wsdl->schemaTargetNamespace = $server->NameSpace;
     if (!PhpWsdl::CallHook('NuSOAPConfigHook', array('server' => self::$Server))) {
         return self::$Server;
     }
     // Add types
     $i = -1;
     $len = sizeof($server->Types);
     while (++$i < $len) {
         $t = $server->Types[$i];
         PhpWsdl::Debug('Add complex type ' . $t->Name);
         if (!PhpWsdl::CallHook('NuSOAPTypeHook', array_merge($data, array('type' => &$t)))) {
             continue;
         }
         if ($t->IsArray) {
             $type = $t->Type;
             self::$Server->wsdl->addComplexType($t->Name, 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => (in_array($type, PhpWsdl::$BasicTypes) ? 'xsd:' . $type : 'tns:' . $type) . '[]')), in_array($type, PhpWsdl::$BasicTypes) ? 'xsd:' . $type : 'tns:' . $type);
         } else {
             if (get_class($t) == 'PhpWsdlEnum') {
                 self::$Server->wsdl->addSimpleType($t->Name, in_array($t->Type, PhpWsdl::$BasicTypes) ? 'xsd:' . $t->Type : 'tns:' . $t->Type, 'simpleType', 'scalar', $t->Elements);
             } else {
                 $el = array();
                 $j = -1;
                 $eLen = sizeof($t->Elements);
                 while (++$j < $eLen) {
                     $e = $t->Elements[$j];
                     $el[$e->Name] = array('name' => $e->Name, 'type' => in_array($e->Type, PhpWsdl::$BasicTypes) ? 'xsd:' . $e->Type : 'tns:' . $e->Type);
                 }
                 self::$Server->wsdl->addComplexType($t->Name, 'complexType', 'struct', 'sequence', '', $el);
             }
         }
     }
     PhpWsdl::CallHook('NuSOAPTypesHook', $data);
     // Add methods
     $i = -1;
     $len = sizeof($server->Methods);
     while (++$i < $len) {
         $m = $server->Methods[$i];
         PhpWsdl::Debug('Register method ' . $m->Name);
         if (!PhpWsdl::CallHook('NuSOAPMethodHook', array_merge($data, array('method' => &$m)))) {
             continue;
         }
         $param = array();
         $j = -1;
         $pLen = sizeof($m->Param);
         while (++$j < $pLen) {
             $p = $m->Param[$j];
             $param[$p->Name] = in_array($p->Type, PhpWsdl::$BasicTypes) ? 'xsd:' . $p->Type : 'tns:' . $p->Type;
         }
         $r = $m->Return;
         self::$Server->register($m->IsGlobal ? $m->Name : $server->Name . '.' . $m->Name, $param, is_null($r) ? array() : array('return' => in_array($r->Type, PhpWsdl::$BasicTypes) ? 'xsd:' . $r->Type : 'tns:' . $r->Type), $server->NameSpace, $server->NameSpace . $m->Name, 'rpc', 'encoded');
     }
     PhpWsdl::CallHook('NuSOAPMethodsHook', $data);
     return self::$Server;
 }
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT . "/categories/class/categorie.class.php";
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
dol_syslog("Call Dolibarr webservices interfaces");
$langs->load("main");
// Enable and test if module web services is enabled
if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) {
    $langs->load("admin");
    dol_syslog("Call Dolibarr webservices interfaces with module webservices disabled");
    print $langs->trans("WarningModuleNotActive", 'WebServices') . '.<br><br>';
    print $langs->trans("ToActivateModule");
    exit;
}
// Create the soap Object
$server = new nusoap_server();
$server->soap_defencoding = 'UTF-8';
$server->decode_utf8 = false;
$ns = 'http://www.dolibarr.org/ns/';
$server->configureWSDL('WebServicesDolibarrProductOrService', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
// Define WSDL Authentication object
$server->wsdl->addComplexType('authentication', 'complexType', 'struct', 'all', '', array('dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), 'login' => array('name' => 'login', 'type' => 'xsd:string'), 'password' => array('name' => 'password', 'type' => 'xsd:string'), 'entity' => array('name' => 'entity', 'type' => 'xsd:string')));
// Define WSDL Return object
$server->wsdl->addComplexType('result', 'complexType', 'struct', 'all', '', array('result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string')));
$productorservice_fields = array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'ref' => array('name' => 'ref', 'type' => 'xsd:string'), 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), 'type' => array('name' => 'type', 'type' => 'xsd:string'), 'label' => array('name' => 'label', 'type' => 'xsd:string'), 'description' => array('name' => 'description', 'type' => 'xsd:string'), 'date_creation' => array('name' => 'date_creation', 'type' => 'xsd:dateTime'), 'date_modification' => array('name' => 'date_modification', 'type' => 'xsd:dateTime'), 'note' => array('name' => 'note', 'type' => 'xsd:string'), 'status_tobuy' => array('name' => 'status_tobuy', 'type' => 'xsd:string'), 'status_tosell' => array('name' => 'status_tosell', 'type' => 'xsd:string'), 'barcode' => array('name' => 'barcode', 'type' => 'xsd:string'), 'barcode_type' => array('name' => 'barcode_type', 'type' => 'xsd:string'), 'country_id' => array('name' => 'country_id', 'type' => 'xsd:string'), 'country_code' => array('name' => 'country_code', 'type' => 'xsd:string'), 'customcode' => array('name' => 'customcode', 'type' => 'xsd:string'), 'price_net' => array('name' => 'price_net', 'type' => 'xsd:string'), 'price' => array('name' => 'price', 'type' => 'xsd:string'), 'price_min_net' => array('name' => 'price_min_net', 'type' => 'xsd:string'), 'price_min' => array('name' => 'price_min', 'type' => 'xsd:string'), 'price_base_type' => array('name' => 'price_base_type', 'type' => 'xsd:string'), 'vat_rate' => array('name' => 'vat_rate', 'type' => 'xsd:string'), 'vat_npr' => array('name' => 'vat_npr', 'type' => 'xsd:string'), 'localtax1_tx' => array('name' => 'localtax1_tx', 'type' => 'xsd:string'), 'localtax2_tx' => array('name' => 'localtax2_tx', 'type' => 'xsd:string'), 'stock_alert' => array('name' => 'stock_alert', 'type' => 'xsd:string'), 'stock_real' => array('name' => 'stock_real', 'type' => 'xsd:string'), 'stock_pmp' => array('name' => 'stock_pmp', 'type' => 'xsd:string'), 'canvas' => array('name' => 'canvas', 'type' => 'xsd:string'), 'import_key' => array('name' => 'import_key', 'type' => 'xsd:string'), 'dir' => array('name' => 'dir', 'type' => 'xsd:string'), 'images' => array('name' => 'images', 'type' => 'tns:ImagesArray'));
//Retreive all extrafield for product
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
if (count($extrafields) > 0) {
Example #16
0
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
if (!isset($ini)) {
    require_once '../model/Ini.php';
    $ini = new Ini();
}
require_once Ini::$internal_path . "lib/nusoap/nusoap.php";
$server = new nusoap_server();
$server->configureWSDL('ConcertoClientWSDL', 'urn:ConcertoClientWSDL');
$server->register('query', array('query' => 'xsd:string', 'post' => 'xsd:string'), array('result' => 'xsd:string'), 'urn:ConcertoClientWSDL', 'urn:ConcertoClientWSDL#query', 'rpc', 'encoded', 'Executes query.');
function curl_post($query, $post)
{
    $post_fields = "";
    foreach ($post as $k => $v) {
        if ($post_fields != "") {
            $post_fields .= "&";
        }
        $post_fields .= $k . "=" . urlencode($v);
    }
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, Ini::$external_path . $query);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
<?php

require_once '../../lib/nusoap/lib/nusoap.php';
$server = new nusoap_server();
$server->register('get_MemberCurrentLoan');
function get_MemberCurrentLoan($member_id)
{
    if ($member_id == '') {
        return new nusoap_fault('Client', '', 'harus suplai dengan valid string');
    } else {
        require_once '../core/member_cloan.inc.php';
        $mcl = new member_cloan($member_id);
        $result = $mcl->get_result();
        return $result;
    }
}
$server->service($HTTP_RAW_POST_DATA);
?>

// Include SOAP
require_once DOL_DOCUMENT_ROOT . "/core/lib/ws.lib.php";
require_once DOL_DOCUMENT_ROOT . "/comm/action/class/actioncomm.class.php";
require_once DOL_DOCUMENT_ROOT . "/comm/action/class/cactioncomm.class.php";
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
dol_syslog("Call ActionComm webservices interfaces");
// Enable and test if module web services is enabled
if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) {
    $langs->load("admin");
    dol_syslog("Call Dolibarr webservices interfaces with module webservices disabled");
    print $langs->trans("WarningModuleNotActive", 'WebServices') . '.<br><br>';
    print $langs->trans("ToActivateModule");
    exit;
}
// Create the soap Object
$server = new nusoap_server();
$server->soap_defencoding = 'UTF-8';
$server->decode_utf8 = false;
$ns = 'http://www.dolibarr.org/ns/';
$server->configureWSDL('WebServicesDolibarrActionComm', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
// Define WSDL Authentication object
$server->wsdl->addComplexType('authentication', 'complexType', 'struct', 'all', '', array('dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), 'login' => array('name' => 'login', 'type' => 'xsd:string'), 'password' => array('name' => 'password', 'type' => 'xsd:string'), 'entity' => array('name' => 'entity', 'type' => 'xsd:string')));
// Define WSDL Return object
$server->wsdl->addComplexType('result', 'complexType', 'struct', 'all', '', array('result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string')));
$actioncomm_fields = array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'ref' => array('name' => 'ref', 'type' => 'xsd:string'), 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), 'type_id' => array('name' => 'type_id', 'type' => 'xsd:string'), 'type_code' => array('name' => 'type_code', 'type' => 'xsd:string'), 'type' => array('name' => 'type', 'type' => 'xsd:string'), 'label' => array('name' => 'label', 'type' => 'xsd:string'), 'datep' => array('name' => 'datep', 'type' => 'xsd:dateTime'), 'datef' => array('name' => 'datef', 'type' => 'xsd:dateTime'), 'datec' => array('name' => 'datec', 'type' => 'xsd:dateTime'), 'datem' => array('name' => 'datem', 'type' => 'xsd:dateTime'), 'note' => array('name' => 'note', 'type' => 'xsd:string'), 'percentage' => array('name' => 'percentage', 'type' => 'xsd:string'), 'author' => array('name' => 'author', 'type' => 'xsd:string'), 'usermod' => array('name' => 'usermod', 'type' => 'xsd:string'), 'usertodo' => array('name' => 'usertodo', 'type' => 'xsd:string'), 'userdone' => array('name' => 'userdone', 'type' => 'xsd:string'), 'priority' => array('name' => 'priority', 'type' => 'xsd:string'), 'fulldayevent' => array('name' => 'fulldayevent', 'type' => 'xsd:string'), 'location' => array('name' => 'location', 'type' => 'xsd:string'), 'socid' => array('name' => 'socid', 'type' => 'xsd:string'), 'contactid' => array('name' => 'contactid', 'type' => 'xsd:string'), 'projectid' => array('name' => 'projectid', 'type' => 'xsd:string'), 'fk_element' => array('name' => 'fk_element', 'type' => 'xsd:string'), 'elementtype' => array('name' => 'elementtype', 'type' => 'xsd:string'));
//Retreive all extrafield for actioncomm
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label('actioncomm', true);
if (count($extrafields) > 0) {
Example #19
0
 /**
  * processes SOAP message received from client
  *
  * @param	array	$headers	The HTTP headers
  * @param	string	$data		unprocessed request data from client
  * @return	mixed	value of the message, decoded into a PHP type
  * @access   private
  */
 function parseRequest($headers, $data)
 {
     $this->debug('Entering parseRequest() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']);
     $this->requestAttachments = array();
     if (strstr($headers['content-type'], 'multipart/related')) {
         $this->debug('Decode multipart/related');
         $input = '';
         foreach ($headers as $k => $v) {
             $input .= "{$k}: {$v}\r\n";
         }
         $params['input'] = $input . "\r\n" . $data;
         $params['include_bodies'] = true;
         $params['decode_bodies'] = true;
         $params['decode_headers'] = true;
         $structure = Mail_mimeDecode::decode($params);
         foreach ($structure->parts as $part) {
             if (!isset($part->disposition) && strstr($part->headers['content-type'], 'text/xml')) {
                 $this->debug('Have root part of type ' . $part->headers['content-type']);
                 $return = parent::parseRequest($part->headers, $part->body);
             } else {
                 $this->debug('Have an attachment of type ' . $part->headers['content-type']);
                 $info['data'] = $part->body;
                 $info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : '';
                 $info['contenttype'] = $part->headers['content-type'];
                 $info['cid'] = $part->headers['content-id'];
                 $this->requestAttachments[] = $info;
             }
         }
         if (isset($return)) {
             return $return;
         }
         $this->setError('No root part found in multipart/related content');
         return;
     }
     $this->debug('Not multipart/related');
     return parent::parseRequest($headers, $data);
 }
Example #20
0
<?php

require_once 'lib/nusoap.php';
require_once "controller/ConfigManager.php";
$ConfigManager = new ConfigManager();
$elementNamespace = $ConfigManager->getElementNamespace();
$server = new nusoap_server();
// Create server instance
$server->configureWSDL('gecredws', $elementNamespace);
$server->register('login', array("username" => "xsd:string", "password" => "xsd:string"), array("result" => "xsd:string"), $elementNamespace);
$server->register('version', array("param" => "xsd:string"), array("result" => "xsd:string"), $elementNamespace);
function login($username, $password)
{
    require_once "controller/LoginController.php";
    $LoginController = new LoginController();
    return $LoginController->login($username, $password);
}
function version()
{
    require_once "controller/ConfigManager.php";
    $ConfigManager = new ConfigManager();
    return $ConfigManager->getVersione();
}
// 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

/*
 *
 * Example NuSoap PHP WSDL
 * Copyright Sam Judson (c) 2004
 * http://www.wackylabs.net
 *
 */
// Declare a namespace to be used below
$ns = 'http://test.org/webservice';
// Include the nusoap file
include "nusoap.php";
// Setup the WSDL
$server = new nusoap_server();
$server->debug_flag = false;
$server->configureWSDL('ExampleWsdl', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
// Create a complex type
$server->wsdl->addComplexType('ComplexType1', 'complexType', 'struct', 'all', '', array('Id' => array('name' => 'Id', 'type' => 'xsd:int'), 'Title' => array('name' => 'Title', 'type' => 'xsd:string'), 'Distance' => array('name' => 'Distance', 'type' => 'xsd:float'), 'Date' => array('name' => 'Date', 'type' => 'xsd:date')));
// Create an array of the above ComplexType1
// - Note that ComplexType1 is used with []'s and then without []'s
$server->wsdl->addComplexType('Array1', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:ComplexType1[]')), 'tns:ComplexType1');
// Create a complex type to upload a file
$server->wsdl->addComplexType('FileBytes', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:unsignedByte[]')), 'xsd:unsignedByte');
// Register the method to return a single ComplexType1
$server->register('GetComplexType1', array('Id' => 'xsd:int'), array('return' => 'tns:ComplexType1'), $ns, $ns . '#GetComplexType1', 'rpc', 'encoded', 'Get Specific ComplexType1');
// Register the method to return all ComplexType1s
$server->register('GetAllComplexType1', array(), array('return' => 'tns:Array1'), $ns, $ns . '#GetAllComplexType1', 'rpc', 'encoded', 'Get All ComplexType1');
// Register the method to update a single CompexType1
$server->register('UpdateComplexType1', array('ComplexType1' => 'tns:ComplexType1'), array('return' => 'xsd:boolean'), $ns, $ns . '#UpdateComplexType1', 'rpc', 'encoded', 'Update a Complex Type');
Example #22
0
<?php

require_once "CPath_class.php";
require_once 'nusoap.php';
$debug = 1;
$server = new nusoap_server();
$server->register('CPath.getInterface');
$server->register('CPath.processData');
$server->register('CPath.getPath');
$server->register('CPath.getName');
//Вот кто поймет что здесь написанно ТОМУ ПРИЗ!!!!!!!!!!!!
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
Example #23
0
require_once DOL_DOCUMENT_ROOT . '/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
dol_syslog("Call Dolibarr webservices interfaces");
$langs->load("main");
// Enable and test if module web services is enabled
if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) {
    $langs->load("admin");
    dol_syslog("Call Dolibarr webservices interfaces with module webservices disabled");
    print $langs->trans("WarningModuleNotActive", 'WebServices') . '.<br><br>';
    print $langs->trans("ToActivateModule");
    exit;
}
// Create the soap Object
$server = new nusoap_server();
$server->soap_defencoding = 'UTF-8';
$server->decode_utf8 = false;
$ns = 'http://www.dolibarr.org/ns/';
$server->configureWSDL('WebServicesDolibarrThirdParty', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
// Define WSDL Authentication object
$server->wsdl->addComplexType('authentication', 'complexType', 'struct', 'all', '', array('dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), 'login' => array('name' => 'login', 'type' => 'xsd:string'), 'password' => array('name' => 'password', 'type' => 'xsd:string'), 'entity' => array('name' => 'entity', 'type' => 'xsd:string')));
// Define WSDL Return object
$server->wsdl->addComplexType('result', 'complexType', 'struct', 'all', '', array('result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string')));
$thirdparty_fields = array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'ref' => array('name' => 'name', 'type' => 'xsd:string'), 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), 'fk_user_author' => array('name' => 'fk_user_author', 'type' => 'xsd:string'), 'status' => array('name' => 'status', 'type' => 'xsd:string'), 'client' => array('name' => 'client', 'type' => 'xsd:string'), 'supplier' => array('name' => 'supplier', 'type' => 'xsd:string'), 'customer_code' => array('name' => 'customer_code', 'type' => 'xsd:string'), 'supplier_code' => array('name' => 'supplier_code', 'type' => 'xsd:string'), 'customer_code_accountancy' => array('name' => 'customer_code_accountancy', 'type' => 'xsd:string'), 'supplier_code_accountancy' => array('name' => 'supplier_code_accountancy', 'type' => 'xsd:string'), 'date_creation' => array('name' => 'date_creation', 'type' => 'xsd:dateTime'), 'date_modification' => array('name' => 'date_modification', 'type' => 'xsd:dateTime'), 'note_private' => array('name' => 'note_private', 'type' => 'xsd:string'), 'note_public' => array('name' => 'note_public', 'type' => 'xsd:string'), 'address' => array('name' => 'address', 'type' => 'xsd:string'), 'zip' => array('name' => 'zip', 'type' => 'xsd:string'), 'town' => array('name' => 'town', 'type' => 'xsd:string'), 'province_id' => array('name' => 'province_id', 'type' => 'xsd:string'), 'country_id' => array('name' => 'country_id', 'type' => 'xsd:string'), 'country_code' => array('name' => 'country_code', 'type' => 'xsd:string'), 'country' => array('name' => 'country', 'type' => 'xsd:string'), 'phone' => array('name' => 'phone', 'type' => 'xsd:string'), 'fax' => array('name' => 'fax', 'type' => 'xsd:string'), 'email' => array('name' => 'email', 'type' => 'xsd:string'), 'url' => array('name' => 'url', 'type' => 'xsd:string'), 'profid1' => array('name' => 'profid1', 'type' => 'xsd:string'), 'profid2' => array('name' => 'profid2', 'type' => 'xsd:string'), 'profid3' => array('name' => 'profid3', 'type' => 'xsd:string'), 'profid4' => array('name' => 'profid4', 'type' => 'xsd:string'), 'profid5' => array('name' => 'profid5', 'type' => 'xsd:string'), 'profid6' => array('name' => 'profid6', 'type' => 'xsd:string'), 'capital' => array('name' => 'capital', 'type' => 'xsd:string'), 'vat_used' => array('name' => 'vat_used', 'type' => 'xsd:string'), 'vat_number' => array('name' => 'vat_number', 'type' => 'xsd:string'));
//Retreive all extrafield for thirdsparty
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extralabels = $extrafields->fetch_name_optionals_label('societe', true);
if (count($extrafields) > 0) {
Example #24
0
<?php

require_once 'lib/nusoap.php';
$server = new nusoap_server();
$server->configureWSDL('server.exemplo', 'http://retamero.com.br/webservice');
$server->wsdl->schemaTargetNamespace = 'http://retamero.com.br/webservice';
$server->register('exemplo', array('id' => 'xsd:string'), array('retorno' => 'xsd:string'), 'http://retamero.com.br/webservice', 'http://retamero.com.br/webservice/exemplo', 'rpc', 'encoded', 'Apenas um exemplo utilizando o NuSOAP PHP.');
$server->register('update', array('id' => 'xsd:string', 'json' => 'xsd:string'), array('retorno' => 'xsd:string'), 'http://retamero.com.br/webservice', 'http://retamero.com.br/webservice/update', 'rpc', 'encoded', 'Apenas um exemplo utilizando o NuSOAP PHP.');
function exemplo($id)
{
    $conecta = mysql_connect("localhost", "user", "senha") or print mysql_error();
    mysql_select_db("retamero_academia", $conecta) or print mysql_error();
    $sql = "SELECT * FROM medidas WHERE aluno_id = " . $id;
    $result = mysql_query($sql, $conecta);
    //while($consulta = mysql_fetch_array($result)) { //pega indice valor e nome do campo e valor
    while ($consulta = mysql_fetch_assoc($result)) {
        // pega apenas nome do campo e valor
        $retorno = json_encode($consulta);
    }
    mysql_free_result($result);
    mysql_close($conecta);
    if ($retorno == "") {
        $retorno = "{\"id\":\"vazio\"}";
    }
    return $retorno;
}
function update($id, $json)
{
    $decodificado = json_decode($json, true);
    $conecta = mysql_connect("localhost", "user", "senha") or print mysql_error();
    mysql_select_db("retamero_academia", $conecta) or print mysql_error();
Example #25
0
	$versionString = "";
	$global['apiVersion'] = $conf['mod_plus_latest_api'];
}

// fix broken apache servers that don't default to index.php
$fix = "";
if(($_SERVER['HTTP_HOST'] == "archivestage.nlm.nih.gov") || ($_SERVER['HTTP_HOST'] == "archivestage")) {
	$fix = "index.php";
}

// init vars
$serviceName = "plusWebServices";
$ns          = null; // "urn:".$serviceName; //disabled...do we really need it?
$endpoint    = makeBaseUrl().$fix."?wsdl".$versionString;

$server = new nusoap_server;
$server->configureWSDL($serviceName, $ns, $endpoint, 'document');
$server->wsdl->schemaTargetNamespace = $ns;

shn_plus_registerAll($ns);

// if in safe mode, raw post data not set:
if(!isset($HTTP_RAW_POST_DATA)) {
	$HTTP_RAW_POST_DATA = implode("\r\n", file('php://input'));
}

$server->service($HTTP_RAW_POST_DATA);



Example #26
0
 of the License, and not any of the later versions.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
if (!isset($ini)) {
    require_once 'Ini.php';
    $ini = new Ini();
}
$server = new nusoap_server();
$server->configureWSDL('ConcertoClientWSDL', 'urn:ConcertoClientWSDL');
$server->register('run_test', array('tid' => 'xsd:string', 'sid' => 'xsd:string', 'hash' => 'xsd:string', 'btn_name' => 'xsd:string', 'values' => 'xsd:string', 'debug' => 'xsd:string', 'pass' => 'xsd:string', 'time' => 'xsd:string', 'resume_from_last_template' => 'xsd:string'), array('result' => 'xsd:string'), 'urn:ConcertoClientWSDL', 'urn:ConcertoClientWSDL#run_test', 'rpc', 'encoded', 'start/resume Concerto test');
$server->register('get_last_html', array('sid' => 'xsd:string', 'hash' => 'xsd:string', 'pass' => 'xsd:string'), array('result' => 'xsd:string'), 'urn:ConcertoClientWSDL', 'urn:ConcertoClientWSDL#get_last_html', 'rpc', 'encoded', 'get Concerto test session last HTML');
$server->register('get_returns', array('sid' => 'xsd:string', 'hash' => 'xsd:string', 'pass' => 'xsd:string'), array('result' => 'xsd:string'), 'urn:ConcertoClientWSDL', 'urn:ConcertoClientWSDL#get_last_html', 'rpc', 'encoded', 'get Concerto test session return variables');
function authorize_WS($pass)
{
    if (md5(Ini::$remote_client_password) == $pass) {
        return true;
    } else {
        return false;
    }
}
function run_test($tid, $sid, $hash, $btn_name, $values, $debug, $pass, $time, $resume_from_last_template)
{
    if (!authorize_WS($pass)) {
dol_syslog("Call Dolibarr webservices interfaces");

$langs->load("main");

// Enable and test if module web services is enabled
if (empty($conf->global->MAIN_MODULE_WEBSERVICES))
{
	$langs->load("admin");
	dol_syslog("Call Dolibarr webservices interfaces with module webservices disabled");
	print $langs->trans("WarningModuleNotActive",'WebServices').'.<br><br>';
	print $langs->trans("ToActivateModule");
	exit;
}

// Create the soap Object
$server = new nusoap_server();
$server->soap_defencoding='UTF-8';
$server->decode_utf8=false;
$ns='http://www.dolibarr.org/ns/';
$server->configureWSDL('WebServicesDolibarrSupplierInvoice',$ns);
$server->wsdl->schemaTargetNamespace=$ns;


// Define WSDL Authentication object
$server->wsdl->addComplexType(
    'authentication',
    'complexType',
    'struct',
    'all',
    '',
    array(
Example #28
0
<?php

// Подключаем SOAP
require_once 'nusoap/nusoap.php';
$server = new nusoap_server();
$server->register('updateBill');
$server->service(file_get_contents("php://input"));
// Эта функция вызывается при уведомлениях от QIWI Кошелька
function updateBill($login, $password, $txn, $status)
{
    // Если уведомление не о успешной оплате, нам это не интересно
    if ($status != 60) {
        return new soapval('updateBillResult', 'xsd:integer', 0);
    }
    // Работаем в корневой директории
    chdir('../../');
    // Подключаем симплу
    require_once 'api/Okay.php';
    $okay = new Okay();
    // Выбираем оплачиваемый заказ
    $order = $okay->orders->get_order(intval($txn));
    // 210 = Счет не найден
    if (empty($order)) {
        return new soapval('updateBillResult', 'xsd:integer', 210);
    }
    // Выбираем из базы соответствующий метод оплаты
    $method = $okay->payment->get_payment_method(intval($order->payment_method_id));
    if (empty($method)) {
        return new soapval('updateBillResult', 'xsd:integer', 210);
    }
    // Настройки способа оплаты
<?php

require_once "CCertInfo_class.php";
require_once 'nusoap.php';
$debug = 1;
$server = new nusoap_server();
$server->register('CCertInfo.getSubject');
$server->register('CCertInfo.getSubjAttrVal');
$server->register('CCertInfo.getText');
$server->register('CCertInfo.getInterface');
$server->register('CCertInfo.processData');
$server->register('CCertInfo.getName');
//Вот кто поймет что здесь написанно ТОМУ ПРИЗ!!!!!!!!!!!!
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
dol_syslog("Call Dolibarr webservices interfaces");
$langs->load("main");
// Enable and test if module web services is enabled
if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) {
    $langs->load("admin");
    dol_syslog("Call Dolibarr webservices interfaces with module webservices disabled");
    print $langs->trans("WarningModuleNotActive", 'WebServices') . '.<br><br>';
    print $langs->trans("ToActivateModule");
    exit;
}
// Create the soap Object
$server = new nusoap_server();
$server->soap_defencoding = 'UTF-8';
$server->decode_utf8 = false;
$ns = 'http://www.dolibarr.org/ns/';
$server->configureWSDL('WebServicesDolibarrInvoice', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
// Define WSDL Authentication object
$server->wsdl->addComplexType('authentication', 'complexType', 'struct', 'all', '', array('dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'), 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'), 'login' => array('name' => 'login', 'type' => 'xsd:string'), 'password' => array('name' => 'password', 'type' => 'xsd:string'), 'entity' => array('name' => 'entity', 'type' => 'xsd:string')));
// Define WSDL Return object
$server->wsdl->addComplexType('result', 'complexType', 'struct', 'all', '', array('result_code' => array('name' => 'result_code', 'type' => 'xsd:string'), 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string')));
// Define other specific objects
$server->wsdl->addComplexType('line', 'complexType', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'type' => array('name' => 'type', 'type' => 'xsd:int'), 'desc' => array('name' => 'desc', 'type' => 'xsd:string'), 'vat_rate' => array('name' => 'vat_rate', 'type' => 'xsd:double'), 'qty' => array('name' => 'qty', 'type' => 'xsd:double'), 'unitprice' => array('name' => 'unitprice', 'type' => 'xsd:double'), 'total_net' => array('name' => 'total_net', 'type' => 'xsd:double'), 'total_vat' => array('name' => 'total_vat', 'type' => 'xsd:double'), 'total' => array('name' => 'total', 'type' => 'xsd:double'), 'date_start' => array('name' => 'date_start', 'type' => 'xsd:date'), 'date_end' => array('name' => 'date_end', 'type' => 'xsd:date'), 'product_id' => array('name' => 'product_id', 'type' => 'xsd:int'), 'product_ref' => array('name' => 'product_ref', 'type' => 'xsd:string'), 'product_label' => array('name' => 'product_label', 'type' => 'xsd:string'), 'product_desc' => array('name' => 'product_desc', 'type' => 'xsd:string')));
/*$server->wsdl->addComplexType(
    'LinesArray',
    'complexType',
    'array',