Exemplo n.º 1
0
 /**
  *
  */
 public function execute()
 {
     $this->checkRequirements();
     $soap = new Soap();
     $soap->init(array('wsdl' => $this->wsdlURL, 'soapoptions' => array('trace' => 1, 'exceptions' => 1)));
     $response = $soap->call('uploadExtension', array('accountData' => $this->getAccountData(), 'extensionData' => $this->getExtensionData(), 'filesData' => Helper::getExtensionFilesData($this->path)));
     return $response;
 }
Exemplo n.º 2
0
 public function testShouldHandleSOAPVersion12()
 {
     $expectedHeader = 'application/soap+xml; charset=utf-8; action="http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP"';
     $this->soapHook->enable($this->getHeaderCheckCallback($expectedHeader));
     $client = new \SoapClient('http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL', array('soap_version' => SOAP_1_2));
     $client->setLibraryHook($this->soapHook);
     $client->GetCityWeatherByZIP(array('ZIP' => '10013'));
 }
Exemplo n.º 3
0
     }
     break;
 case 'claim-code-status':
     if (Session::ValidateCSRFToken($_REQUEST['csrftoken'])) {
         Manager::LoadExtension('Shop', $ClassConstructor);
         Manager::LoadExtension('Soap', $ClassConstructor);
         $ActivationStatus = Shop::CodeActivated($User['id'], $_REQUEST['key']);
         if (!$ActivationStatus) {
             header('Location: /account/management/claim-code?accountName=' . $_REQUEST['accountName'] . '&character=' . $_REQUEST['character'] . '&errorCode=15012');
         } else {
             if ($ActivationStatus['code_activated'] == 1) {
                 header('Location: /account/management/claim-code?accountName=' . $_REQUEST['accountName'] . '&character=' . $_REQUEST['character'] . '&errorCode=15011');
             } else {
                 $ItemData = Shop::GetItemData($ActivationStatus['purchased_item']);
                 Soap::AddItemToList($ItemData['item_id'], 1);
                 if (Soap::SendItem($_REQUEST['character'], $ItemData['item_name'])) {
                     Shop::ChangeActivationState($User['id'], $_REQUEST['key']);
                     $Smarty->assign('ItemData', $ItemData);
                     $Smarty->assign('Page', Page::Info('account_dashboard', array('bodycss' => 'claimcode', 'pagetitle' => $Smarty->GetConfigVars('Account_Management_Claim_Code') . ' - ')));
                     $Smarty->display('account/claim_code_complete');
                 } else {
                     header('Location: /account/management/claim-code?accountName=' . $_REQUEST['accountName'] . '&character=' . $_REQUEST['character'] . '&errorCode=15015');
                 }
             }
         }
     } else {
         header('Location: /account/management/claim-code?accountName=' . $_REQUEST['accountName'] . '&character=' . $_REQUEST['character'] . '&errorCode=15010');
     }
     break;
 case 'services':
     if (!Text::IsNull($_REQUEST['datatype'])) {
 /**
  * @ignore
  * @param Soap $soap
  * @throws TurnitinSDKException
  */
 public function __construct($soap)
 {
     $this->domobject = new DomDocument();
     $this->requestdomobject = new DomDocument();
     $logger = new TurnitinLogger($soap->getLogPath());
     if ($logger) {
         $logger->logInfo($soap->getHttpHeaders() . PHP_EOL . $soap->__getLastRequest());
     }
     if ($soap->getDebug()) {
         $this->outputDebug($soap->__getLastRequest(), 'Request Message', $soap->getHttpHeaders());
     }
     @$this->requestdomobject->loadXML($soap->__getLastRequest());
     if ($logger) {
         $logger->logInfo($soap->__getLastResponse());
     }
     if ($soap->getDebug()) {
         $this->outputDebug($soap->__getLastResponse(), 'Response Message');
     }
     if (($load = @$this->domobject->loadXML($soap->__getLastResponse())) === false) {
         throw new TurnitinSDKException('responsexmlerror', 'XML Response could not be parsed', $soap->getLogPath());
     }
     $this->setMessageId(@$this->domobject->getElementsByTagName('imsx_messageIdentifier')->item(0)->nodeValue);
     $this->setStatus(@$this->domobject->getElementsByTagName('imsx_severity')->item(0)->nodeValue);
     if (is_null($this->getStatus())) {
         $this->setStatus($this->domobject->getElementsByTagName('status')->item(0)->nodeValue);
     }
     if (isset($this->domobject->getElementsByTagName('imsx_codeMinorFieldValue')->item(0)->nodeValue)) {
         $this->setStatusCode(@$this->domobject->getElementsByTagName('imsx_codeMinorFieldValue')->item(0)->nodeValue);
     } else {
         $this->setStatus('status');
         $this->setStatusCode($this->domobject->getElementsByTagName('status')->item(0)->nodeValue);
     }
     $this->setDescription(@$this->domobject->getElementsByTagName('imsx_description')->item(0)->nodeValue);
     if (is_null($this->getDescription())) {
         $this->setDescription($this->domobject->getElementsByTagName('message')->item(0)->nodeValue);
     }
     $this->setMessageRefId(@$this->domobject->getElementsByTagName('imsx_messageRefIdentifier')->item(0)->nodeValue);
 }
 public static function SendMoney($PlayerName, $Subject, $Text, $Money)
 {
     $Command = '.send money ' . $PlayerName . ' "' . $Subject . '" "' . $Text . '" ' . $Money;
     Soap::Execute($Command);
 }
 /**
  * Interpret a SOAP response message to PHP values.
  *
  * @param string $response          The SOAP response message.
  * @param string $function_name     The name of the SOAP function to interpret.
  * @param array  $output_headers    If supplied, this array will be filled with the headers from the SOAP response.
  * @return mixed
  * @throws \SoapFault
  */
 public function response($response, $function_name, array &$output_headers = null)
 {
     return $this->soap->response($response, $function_name, $output_headers);
 }
 public function findAssignments($assignment)
 {
     try {
         $soap = $this->readLineItemIdsForCourseSection(array('sectionSourcedId' => $assignment->getClassId()));
         $response = new Response($this);
         if ($response->getStatus() == 'error') {
             throw new TurnitinSDKException($response->getStatusCode(), $response->getDescription());
         } else {
             $tiiAssignment = new TiiAssignment();
             $assignmentids = array();
             if (isset($soap->sourcedIdSet->sourcedId)) {
                 if (!is_array($soap->sourcedIdSet->sourcedId)) {
                     $soap->sourcedIdSet->sourcedId = array($soap->sourcedIdSet->sourcedId);
                 }
                 foreach ($soap->sourcedIdSet->sourcedId as $id) {
                     $assignmentids[] = $id;
                 }
             }
             $tiiAssignment->setAssignmentIds($assignmentids);
             $response->setAssignment($tiiAssignment);
         }
         return $response;
     } catch (SoapFault $e) {
         throw new TurnitinSDKException($e->faultcode, $e->faultstring, parent::getLogPath());
     }
 }
 public function createSubmission($submission)
 {
     try {
         $request = array();
         $request['resultRecord']['sourcedGUID']['sourcedId'] = '';
         $request['resultRecord']['result']['personSourcedId'] = $submission->getAuthorUserId();
         $request['resultRecord']['result']['lineItemSourcedId'] = $submission->getAssignmentId();
         $request['resultRecord']['result']['extension']['extensionNameVocabulary'] = self::$extensionname_vocab;
         $request['resultRecord']['result']['extension']['extensionValueVocabulary'] = self::$extensionvalue_vocab;
         $request['resultRecord']['result']['extension']['extensionField'][0]['fieldName'] = 'Submitter';
         $request['resultRecord']['result']['extension']['extensionField'][0]['fieldType'] = 'Integer';
         $request['resultRecord']['result']['extension']['extensionField'][0]['fieldValue'] = $submission->getSubmitterUserId();
         $soap = $this->createByProxyResult($request);
         $response = new Response($this);
         if ($response->getStatus() == 'error') {
             throw new TurnitinSDKException($response->getStatusCode(), $response->getDescription());
         } else {
             $tiiSubmission = new TiiSubmission();
             $tiiSubmission->setSubmissionId($soap->sourcedId);
             $response->setSubmission($tiiSubmission);
         }
         return $response;
     } catch (SoapFault $e) {
         throw new TurnitinSDKException($e->faultcode, $e->faultstring, parent::getLogPath());
     }
 }
Exemplo n.º 9
0
 /**
  * @param       $wsdl
  * @param array $options
  * @param array $headers
  */
 protected function build_soap_client($wsdl, $options = array(), $headers = array())
 {
     $soap = Soap::Client($wsdl, $options);
     $soap->__setSoapHeaders(new SoapHeader($this->__get('ns'), 'RequestHeader', $headers));
     return $soap;
 }
Exemplo n.º 10
0
<?php

require_once '../classes/Soap.php';
$soap = new Soap();
if (!empty($_POST['country'])) {
    $country = $_POST['country'];
} else {
    $country = NULL;
}
if (!empty($country)) {
    $xmlCities = $soap->get_cities($country);
    foreach ($xmlCities as $cities) {
        $fullCity = explode(' /', $cities->City);
        $nCity = $fullCity[0];
        echo '<option value="' . $nCity . '">' . $nCity . '</option>';
    }
} else {
    echo '<option>No se encontró registro para ' . $country . '.</option>';
}
Exemplo n.º 11
0
 public function __construct(Port $port)
 {
     parent::__construct($port);
     $this->transport = $this->findTransport($port->getBinding());
 }
 public function findMemberships($membership)
 {
     try {
         $soap = $this->readMembershipIdsForCollection(array('groupSourcedId' => $membership->getClassId(), 'collection' => 'courseSection'));
         $response = new Response($this);
         if ($response->getStatus() == 'error') {
             throw new TurnitinSDKException($response->getStatusCode(), $response->getDescription());
         } else {
             $tiiMembership = new TiiMembership();
             $membershipids = array();
             if (isset($soap->sourcedIdSet->sourcedId)) {
                 if (!is_array($soap->sourcedIdSet->sourcedId)) {
                     $soap->sourcedIdSet->sourcedId = array($soap->sourcedIdSet->sourcedId);
                 }
                 foreach ($soap->sourcedIdSet->sourcedId as $id) {
                     $membershipids[] = $id;
                 }
             }
             $tiiMembership->setMembershipIds($membershipids);
             $response->setMembership($tiiMembership);
         }
         return $response;
     } catch (SoapFault $e) {
         throw new TurnitinSDKException($e->faultcode, $e->faultstring, parent::getLogPath());
     }
 }
Exemplo n.º 13
0
Arquivo: SOAP.php Projeto: techart/tao
 /**
  * @param string $request
  * @param string $location
  * @param string $action
  * @param int    $version
  */
 public function __doRequest($request, $location, $version)
 {
     $this->last_request = Soap::XmlFixer()->fix_xml($request, $this->last_args);
     return parent::__doRequest($this->last_request, $location, $action, (int) $version);
 }
 public function findClasses($class)
 {
     try {
         $queryObject = array('queryObject' => json_encode(array('coursesection_title' => $class->getTitle(), 'date_from' => $class->getDateFrom(), 'integration_id' => $class->getIntegrationId(), 'user_id' => $class->getUserId(), 'user_role' => $class->getUserRole())));
         $soap = $this->discoverCourseSectionIds($queryObject);
         $response = new Response($this);
         if ($response->getStatus() == 'error') {
             throw new TurnitinSDKException($response->getStatusCode(), $response->getDescription(), parent::getLogPath());
         } else {
             $tiiClass = new TiiClass();
             $classids = array();
             if (isset($soap->sourcedIdSet->sourcedId)) {
                 if (!is_array($soap->sourcedIdSet->sourcedId)) {
                     $soap->sourcedIdSet->sourcedId = array($soap->sourcedIdSet->sourcedId);
                 }
                 foreach ($soap->sourcedIdSet->sourcedId as $id) {
                     $classids[] = $id;
                 }
             }
             $tiiClass->setClassIds($classids);
             $response->setClass($tiiClass);
         }
         return $response;
     } catch (SoapFault $e) {
         throw new TurnitinSDKException($e->faultcode, $e->faultstring, parent::getLogPath());
     }
 }
 public function findUser($user)
 {
     try {
         $request = array('queryObject' => $user->getEmail());
         $soap = $this->discoverPersonIds($request);
         $response = new Response($this);
         if ($response->getStatus() == 'error') {
             throw new TurnitinSDKException($response->getStatusCode(), $response->getDescription());
         } else {
             $tiiUser = new TiiUser();
             if (isset($soap->sourcedIdSet->sourcedId)) {
                 $tiiUser->setUserId($soap->sourcedIdSet->sourcedId);
             }
             $response->setUser($tiiUser);
         }
         return $response;
     } catch (SoapFault $e) {
         throw new TurnitinSDKException($e->faultcode, $e->faultstring, parent::getLogPath());
     }
 }
Exemplo n.º 16
0
<?php

require_once '../classes/Soap.php';
$soap = new Soap();
if (!empty($_POST['country'])) {
    $country = $_POST['country'];
} else {
    $country = NULL;
}
if (!empty($_POST['city'])) {
    $city = $_POST['city'];
} else {
    $city = NULL;
}
$xmlWeather = $soap->get_data($country, $city);
echo '<tr>
        <th>Location</th>
        <td>' . $xmlWeather->Location . '</td>
    </tr>
    <tr>
        <th>Time</th>
        <td>' . $xmlWeather->Time . '</td>
    </tr>
    <tr>
        <th>Wind</th>
        <td>' . $xmlWeather->Wind . '</td>
    </tr>
    <tr>
        <th>Visibility</th>
        <td>' . $xmlWeather->Visibility . '</td>
    </tr>
Exemplo n.º 17
0
<?php

require_once './classes/Soap.php';
$soap = new Soap();
$geoIp = $soap->get_location();
$act_country = $geoIp->Country;
$act_city = $soap->normalizar($geoIp->City);
if (empty($act_country)) {
    $country = 'Colombia';
} else {
    $country = $act_country;
}
if (empty($act_city)) {
    $city = 'Bogota';
} else {
    $city = $act_city;
}
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <title>Test BSPKN</title>
        <link href="scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
        <link href="scripts/css/main.css" rel="stylesheet" />
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->