12.5 Příklad aktivace mobilního čísla

<?php
$wsdl = 'https://api.ipex.cz/soap/ProviderManagement/v1?wsdl';
try {
  $soapClient = new SoapClient($wsdl, array('encoding' => 'UTF-8', 'trace' => 1,
'exceptions' => 1));
} catch (Exception $exc) {
  echo $exc->getMessage();
}
// ziskani overovaciho tokenu
$credentials = array(
  'userName' => 'prihlasovaci_jmeno',
  'password' => 'heslo'
);
$out = $soapClient->__soapCall("getAccessToken", $credentials);
$accessToken = $out['accessToken'];
// nastaveni hlavicky pro overeni
$tokenHeader = new StdClass;
$tokenHeader->accessToken = $accessToken;
$soapClient->__setSoapHeaders(new SoapHeader('urn:api-ipex:providermanagement',
'verifyAccess', $tokenHeader));
// provedeni dotazu
$params = array(
  'customerId' => 123,
    'numberDetail' => array(
    'tariffPlanId' => 10,
    'number' => 123456789,
    'iccid' => '8942002220038479129',
    'dataTariffPlan' => 1,
    'credit' => 100,
    'monthlyCredit' => 100,
    'paymentType' => 'prepaid'
),
'provisioningAttributes' => array(
  'communicationLanguage' => 'czech',
  'welcomeRoamingSms' => true,
  'mms' => true,
  'sms' => 'allowAll',
  'incomingCall' => true,
  'outgoingCall' => 'blockInternational',
  'premiumService' => 'blockAll',
  'roamingCall' => true,
  'callForwarding' => true,
  'callHold' => true,
  'clir' => 'temporaryAllowed',
  'missedCallAlert' => false,
  'voiceMail' => true,
  'voiceMailLanguage' => 'czech',
  'voiceMailSmsNotify' => true,
  'dataFupNotify' => true,
  'dataRoaming' => true,
  'dataRoamingLimit' => 1225
)
);
$out = $soapClient->__soapCall("createMobileService", $params);
header("Content-Type:text/xml");
echo '',
  $soapClient->__getLastResponse(),
'';