PHP code example of ircykk / ezwm

1. Go to this page and download the library: Download ircykk/ezwm library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ircykk / ezwm example snippets




use Ircykk\Ezwm\Auth\authToken;
use Ircykk\Ezwm\Auth\session;
use Ircykk\Ezwm\AuthService\AuthClientFactory;
use Ircykk\Ezwm\AuthService\AuthService;
use Ircykk\Ezwm\AuthService\Credentials;

ntials object
$credentials = new Credentials(
    $login,
    $password,
    $operatorId,
    $domain,
    $type
);

$authClientFactory = new AuthClientFactory();
$authClient = $authClientFactory->build(EZWM_ENV_TEST);
$authService = new AuthService($credentials, $authClient);

try {
    $sessionResponse = $authService->createSession();

    /** @var session $session */
    $session = $sessionResponse['session'];
    /** @var authToken $authToken */
    $authToken = $sessionResponse['authToken'];

    $sessionId = $session->getId();
    $authTokenId = $authToken->getId();

    echo "Session ID: $sessionId; Auth Token ID: $authTokenId";
} catch (Exception $e) {
    echo html_entity_decode($e->getMessage());
}

/**
 * @param loginRequest $request
 * @param null $outputHeaders
 * @return string
 */
public function login(loginRequest $request, &$outputHeaders = null)
{
   return $this->__soapCall('login', array($request), null, null, $outputHeaders);
}