本文整理汇总了PHP中nusoap_server::configureWSDL方法的典型用法代码示例。如果您正苦于以下问题:PHP nusoap_server::configureWSDL方法的具体用法?PHP nusoap_server::configureWSDL怎么用?PHP nusoap_server::configureWSDL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nusoap_server
的用法示例。
在下文中一共展示了nusoap_server::configureWSDL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initSoapRequest
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');
}
示例2: array
<?php
include "/var/www/html/nusoap/lib/nusoap.php";
include "Numeros.php";
$soap = new nusoap_server();
$soap->configureWSDL('numeros');
$soap->register('Numeros.add', array('a' => 'xsd:int', 'b' => 'xsd:int'), array('return' => 'xsd:int'), 'add');
$soap->register('Numeros.divide', array('a' => 'xsd:int', 'b' => 'xsd:int'), array('return' => 'xsd:int'), 'divide');
//var_dump($HTTP_RAW_POST_DATA); die();
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$soap->service($HTTP_RAW_POST_DATA);
示例3: curl_post
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);
curl_setopt($ch, CURLOPT_POST, 1);
示例4: array
/*
*
* 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');
// Register the method to uplaod a file
示例5: array
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) {
$extrafield_array = array();
}
foreach ($extrafields->attribute_label as $key => $label) {
//$value=$object->array_options["options_".$key];
示例6: exemplo
<?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();
示例7: CreateServer
/**
* 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;
}
示例8: dbConnect
<?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));
示例9: array
<?php
require "../nusoap/lib/nusoap.php";
require 'Hp12c.php';
$server = new nusoap_server();
$server->configureWSDL('calculaMontante');
$server->register('Hp12c.calculaMontante', array('p' => 'xsd:decimal', 'i' => 'xsd:decimal', 'n' => 'xsd:integer', 'a' => 'xsd:integer'), array('return' => 'xsd:decimal'), 'calculaMontante');
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
示例10: array
dol_syslog("Call User 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('WebServicesDolibarrUser', $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('user', 'complexType', 'struct', 'all', '', array('element' => array('name' => 'element', 'type' => 'xsd:string'), 'id' => array('name' => 'id', 'type' => 'xsd:string'), 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'), 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'), 'note' => array('name' => 'note', 'type' => 'xsd:string'), 'email' => array('name' => 'email', 'type' => 'xsd:string'), 'signature' => array('name' => 'signature', 'type' => 'xsd:string'), 'office_phone' => array('name' => 'office_phone', 'type' => 'xsd:string'), 'office_fax' => array('name' => 'office_fax', 'type' => 'xsd:string'), 'user_mobile' => array('name' => 'user_mobile', 'type' => 'xsd:string'), 'admin' => array('name' => 'admin', 'type' => 'xsd:string'), 'login' => array('name' => 'login', 'type' => 'xsd:string'), 'entity' => array('name' => 'entity', 'type' => 'xsd:string'), 'pass_indatabase' => array('name' => 'pass_indatabase', 'type' => 'xsd:string'), 'pass_indatabase_crypted' => array('name' => 'pass_indatabase_crypted', 'type' => 'xsd:string'), 'datec' => array('name' => 'datec', 'type' => 'xsd:dateTime'), 'datem' => array('name' => 'datem', 'type' => 'xsd:dateTime'), 'fk_thirdparty' => array('name' => 'fk_thirdparty', 'type' => 'xsd:string'), 'fk_contact' => array('name' => 'fk_contact', 'type' => 'xsd:string'), 'fk_member' => array('name' => 'fk_member', 'type' => 'xsd:string'), 'datelastlogin' => array('name' => 'datelastlogin', 'type' => 'xsd:dateTime'), 'datepreviouslogin' => array('name' => 'datepreviouslogin', 'type' => 'xsd:dateTime'), 'statut' => array('name' => 'statut', 'type' => 'xsd:string'), 'photo' => array('name' => 'photo', 'type' => 'xsd:string'), 'lang' => array('name' => 'lang', 'type' => 'xsd:string'), 'entrepots' => array('name' => 'entrepots', 'type' => 'xsd:string'), 'canvas' => array('name' => 'canvas', 'type' => 'xsd:string')));
// Define other specific objects
$server->wsdl->addComplexType('group', 'complexType', 'struct', 'all', '', array('name' => array('name' => 'name', 'type' => 'xsd:string'), 'id' => array('name' => 'id', 'type' => 'xsd:string'), 'datec' => array('name' => 'datec', 'type' => 'xsd:string'), 'nb' => array('name' => 'nb', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('GroupsArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:group[]')), 'tns:group');
$thirdpartywithuser_fields = array('name' => array('name' => 'name', 'type' => 'xsd:string'), 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'), 'name_thirdparty' => array('name' => 'name_thirdparty', 'type' => 'xsd:string'), 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'), 'client' => array('name' => 'client', 'type' => 'xsd:string'), 'fournisseur' => array('name' => 'fournisseur', 'type' => 'xsd:string'), 'address' => array('name' => 'address', 'type' => 'xsd:string'), 'zip' => array('name' => 'zip', 'type' => 'xsd:string'), 'town' => array('name' => 'town', 'type' => 'xsd:string'), 'country_id' => array('name' => 'country_id', 'type' => 'xsd:string'), 'country_code' => array('name' => 'country_code', 'type' => 'xsd:string'), 'phone' => array('name' => 'phone', 'type' => 'xsd:string'), 'phone_mobile' => array('name' => 'phone_mobile', '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'), 'tva_assuj' => array('name' => 'tva_assuj', 'type' => 'xsd:string'), 'tva_intra' => array('name' => 'tva_intra', 'type' => 'xsd:string'), 'login' => array('name' => 'login', 'type' => 'xsd:string'), 'password' => array('name' => 'password', 'type' => 'xsd:string'), 'group_id' => array('name' => 'group_id', '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);
示例11: jv_config
<?php
ob_start();
include '../configuration.php';
include '../library/nusoap/nusoap.php';
// Create the server instance
$server = new nusoap_server();
// Initialize WSDL support
$server->configureWSDL('Get latest news ', 'http://tienkiem.net');
// don gian chi la chuc nag mo ta
//add a custom data type
$server->wsdl->addComplexType('Content', 'complexType', 'struct', 'all', '', array('id' => array('name' => 'id', 'type' => 'xsd:string'), 'alias' => array('name' => 'alias', 'type' => 'xsd:string'), 'title' => array('name' => 'title', 'type' => 'xsd:string'), 'created' => array('name' => 'created', 'type' => 'xsd:string'), 'ccalias' => array('name' => 'ccalias', 'type' => 'xsd:string')));
$server->wsdl->addComplexType('ContentArray', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:Content[]')), 'tns:Content');
// GET LATEST NEWS
$server->register('getLatestNews', array("catID" => "xsd:string", "limit" => "xsd:string", "ws_username" => "xsd:string", "ws_password" => "xsd:string"), array("result" => "tns:ContentArray"), 'uri:http://tienkiem.net', 'uri:http://127.0.0.1/tienkiem.net/api/api.php/getLatestNews', 'rpc', 'encode');
// FUNCTION CONFIG DB,HOST,USERNAME,PASSWORD...
function jv_config($host, $username, $password, $db)
{
require_once "../configuration.php";
$jconfig = new JConfig();
return array("localhost" => $jconfig->host, "user" => $jconfig->user, "password" => $jconfig->password, "db" => $jconfig->db);
}
// Insert,Update ....into database .... by sms gateway
function getLatestNews($catID, $limit, $ws_username, $ws_password)
{
try {
if ($ws_username == 'xgo_api' && $ws_password == 'l4phskvtplklcfp172aavoegc3') {
require_once "../configuration.php";
$jconfig = new JConfig();
$localhost = $jconfig->host;
$user = $jconfig->user;
示例12: get_mahasiswa
<?php
error_reporting(E_ALL);
ini_set('display_error', 1);
require_once 'nusoap/lib/nusoap.php';
require_once 'adodb/adodb.inc.php';
require_once 'mahasiswa.php';
$server = new nusoap_server();
$server->configureWSDL('Service mahasiswa', 'urn:mahasiswa');
$server->wsdl->schemaTargetNamespace = 'urn:mahasiswa';
$server->register('get_mahasiswa', array(), array('return' => 'xsd:string'), 'urn:mahasiswa', 'urn:mahasiswa#get_mahasiswa', 'rpc', 'encoded', 'mengambil semua data mahasiswa');
$server->register('hapus_mahasiswa', array('nim' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:mahasiswa', 'urn:mahasiswa#hapus_mahasiswa', 'rpc', 'encoded', 'menghapus data mahasiswa');
$server->register('tambah_mahasiswa', array('nim' => 'xsd:string', 'nama' => 'xsd:string', 'alamat' => 'xsd:string', 'tempat_lahir' => 'xsd:string', 'tanggal_lahir' => 'xsd:string', 'fakultas' => 'xsd:string', 'jurusan' => 'xsd:string', 'agama' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:mahasiswa', 'urn:mahasiswa#tambah_mahasiswa', 'rpc', 'encoded', 'menambah data mahasiswa');
$server->register('ambilDataMhsByNIM', array('nim' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:mahasiswa', 'urn:mahasiswa#ambilDataMhsByNIM', 'rpc', 'encoded', 'mengambil data mahasiswa berdasarkan nim');
$server->register('ubahdataMahasiswa', array('nimAwal' => 'xsd:string', 'nim' => 'xsd:string', 'nama' => 'xsd:string', 'alamat' => 'xsd:string', 'tempat_lahir' => 'xsd:string', 'tanggal_lahir' => 'xsd:string', 'fakultas' => 'xsd:string', 'jurusan' => 'xsd:string', 'agama' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:mahasiswa', 'urn:mahasiswa#ubahdataMahasiswa', 'rpc', 'encoded', 'ubah data mahasiswa');
function get_mahasiswa()
{
$mahasiswa = new Mahasiswa();
return $mahasiswa->get_mahasiswa();
}
function hapus_mahasiswa($nim)
{
$mahasiswa = new Mahasiswa();
return $mahasiswa->hapus_mahasiswa($nim);
}
function tambah_mahasiswa($nim, $nama, $alamat, $tempat_lahir, $tanggal_lahir, $fakultas, $jurusan, $agama)
{
$mahasiswa = new Mahasiswa();
return $mahasiswa->tambah_mahasiswa($nim, $nama, $alamat, $tempat_lahir, $tanggal_lahir, $fakultas, $jurusan, $agama);
}
function ambilDataMhsByNIM($nim)
示例13: wpdb
<?php
define('BLOCK_LOAD', true);
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/wp-db.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/class-phpass.php';
$wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
error_reporting(-1);
require_once 'lib/nusoap.php';
$_HTTP = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://';
$ns = $_HTTP . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/" . basename($_SERVER['PHP_SELF']);
$server = new nusoap_server();
// $server->soap_defencoding = 'UTF-8';
// $server->decode_utf8 = false;
// $server->encode_utf8 = true;
//echo 'test';
$server->configureWSDL('tpo10wsdl', 'urn:tpo10wsdl');
示例14: array
require_once DOL_DOCUMENT_ROOT . "/skeleton/class/skeleton.class.php";
dol_syslog("Call Skeleton 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('WebServicesDolibarrSkeleton', $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('skeleton', 'complexType', 'struct', 'all', '', array('prop1' => 'xxx', 'prop2' => 'xxx'));
// 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped
// Style merely dictates how to translate a WSDL binding to a SOAP message. Nothing more. You can use either style with any programming model.
// http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
$styledoc = 'rpc';
// rpc/document (document is an extend into SOAP 1.0 to support unstructured messages)
$styleuse = 'encoded';
// encoded/literal/literal wrapped
// Better choice is document/literal wrapped but literal wrapped not supported by nusoap.
示例15: get_pegawai
<?php
error_reporting(E_ALL);
ini_set('display_error', 1);
require_once 'nusoap/lib/nusoap.php';
require_once 'adodb/adodb.inc.php';
require_once 'pegawai.php';
$server = new nusoap_server();
$server->configureWSDL('Service pegawai', 'urn:pegawai');
$server->wsdl->schemaTargetNamespace = 'urn:pegawai';
$server->register('get_pegawai', array('nip' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:pegawai', 'urn:pegawai#get_pegawai', 'rpc', 'encoded', 'Service untuk mengetahui daftar pegawai. Dan untuk menampilkan pegawai secara sepesifik');
$server->register('get_riwayat_pekerjaan', array('nip' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:pegawai', 'urn:pegawai#get_riwayat_pekerjaan', 'rpc', 'encoded', 'Service untuk mengetahui riwayat pekerjaan dari pegawai');
function get_pegawai($nip = "")
{
$pegawai = new Pegawai();
return $pegawai->get_pegawai($nip);
}
function get_riwayat_pekerjaan($nip = "")
{
$pegawai = new Pegawai();
return $pegawai->get_riwayat_pekerjaan($nip);
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);