init
This commit is contained in:
76
soap/test.php
Normal file
76
soap/test.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
|
||||
ini_set("soap.wsdl_cache_enabled", "0");
|
||||
//header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
$url = "http://wozniecki.saas-systems.pl/soap.php?wsdl";
|
||||
$username = "aa";
|
||||
$password = "rudemodz1";
|
||||
|
||||
//require NuSOAP
|
||||
require_once("./nusoap/lib/nusoap.php");
|
||||
|
||||
//retrieve WSDL
|
||||
$client = new nusoap_client($url, 'wsdl');
|
||||
|
||||
//display errors
|
||||
$err = $client->getError();
|
||||
if ($err)
|
||||
{
|
||||
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
|
||||
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
|
||||
exit();
|
||||
}
|
||||
|
||||
//login ----------------------------------------------------
|
||||
$login_parameters = array(
|
||||
'user_auth' => array(
|
||||
'user_name' => $username,
|
||||
'password' => md5($password),
|
||||
'version' => '1'
|
||||
),
|
||||
'application_name' => 'SoapTest',
|
||||
'name_value_list' => array(
|
||||
),
|
||||
);
|
||||
|
||||
$login_result = $client->call('login', $login_parameters);
|
||||
|
||||
|
||||
echo '<pre>';
|
||||
print_r($login_result);
|
||||
echo '</pre>';
|
||||
|
||||
|
||||
//get session id
|
||||
$session_id = $login_result['id'];
|
||||
|
||||
//create account -------------------------------------
|
||||
$set_entry_parameters = array(
|
||||
//session id
|
||||
"session" => $session_id,
|
||||
|
||||
//The name of the module from which to retrieve records.
|
||||
"module_name" => "Accounts",
|
||||
|
||||
'ids' => array(
|
||||
'5b46ae02-3848-df9d-9703-57875b113611',
|
||||
|
||||
),
|
||||
//Record attributes
|
||||
'select_fields' => array(
|
||||
'name',
|
||||
),
|
||||
'link_name_to_fields_array' => array(
|
||||
),
|
||||
);
|
||||
|
||||
$set_entry_result = $client->call("get_entries", $set_entry_parameters);
|
||||
|
||||
echo "<pre>";
|
||||
print_r($set_entry_result['entry_list']);
|
||||
echo "</pre>";
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user