src/wcmf/lib/service/SoapServer.php
public function doCall($action, $params) {
    if (self::$logger->isDebugEnabled()) {
      self::$logger->debug("SoapServer action: ".$action);
      self::$logger->debug($params);
    }
    $authHeader = $this->requestHeader['Security']['UsernameToken'];

    $request = ObjectFactory::getInstance('request');
    $request->setAction('actionSet');
    $request->setFormat('soap');
    $request->setResponseFormat('null');
    $request->setValues([
      'data' => [
        'action1' => [
          'action' => 'login',
          'params' => [
            'user' => $authHeader['Username'],
            'password' => $authHeader['Password']['!']
          ]
        ],
        'action2' => [
          'action' => $action,
          'params' => $params
        ],
        'action3' => [
          'action' => 'logout'
        ]
      ]
    ]);

    // run the application
    $actionResponse = ObjectFactory::getInstance('response');
    try {
      $response = $this->application->run($request);
      if ($response->hasErrors()) {
        $errors = $response->getErrors();
        $this->handleException(new ApplicationException($request, $response, $errors[0]));
      }
      else {
        $responseData = $response->getValue('data');
        $data = $responseData['action2'];
        $actionResponse->setSender($data['controller']);
        $actionResponse->setContext($data['context']);
        $actionResponse->setAction($data['action']);
        $actionResponse->setFormat('soap');
        $actionResponse->setValues($data);
        $formatter = ObjectFactory::getInstance('formatter');
        $formatter->serialize($actionResponse);
        if (self::$logger->isDebugEnabled()) {
          self::$logger->debug($actionResponse->__toString());
        }
      }
    }
    catch (\Exception $ex) {
      $this->handleException($ex);
    }
    return $actionResponse;
  }
public function doCall($action, $params) {
    if (self::$logger->isDebugEnabled()) {
      self::$logger->debug("SoapServer action: ".$action);
      self::$logger->debug($params);
    }
    $authHeader = $this->requestHeader['Security']['UsernameToken'];

    $request = ObjectFactory::getInstance('request');
    $request->setAction('actionSet');
    $request->setFormat('soap');
    $request->setResponseFormat('null');
    $request->setValues([
      'data' => [
        'action1' => [
          'action' => 'login',
          'params' => [
            'user' => $authHeader['Username'],
            'password' => $authHeader['Password']['!']
          ]
        ],
        'action2' => [
          'action' => $action,
          'params' => $params
        ],
        'action3' => [
          'action' => 'logout'
        ]
      ]
    ]);

    // run the application
    $actionResponse = ObjectFactory::getInstance('response');
    try {
      $response = $this->application->run($request);
      if ($response->hasErrors()) {
        $errors = $response->getErrors();
        $this->handleException(new ApplicationException($request, $response, $errors[0]));
      }
      else {
        $responseData = $response->getValue('data');
        $data = $responseData['action2'];
        $actionResponse->setSender($data['controller']);
        $actionResponse->setContext($data['context']);
        $actionResponse->setAction($data['action']);
        $actionResponse->setFormat('soap');
        $actionResponse->setValues($data);
        $formatter = ObjectFactory::getInstance('formatter');
        $formatter->serialize($actionResponse);
        if (self::$logger->isDebugEnabled()) {
          self::$logger->debug($actionResponse->__toString());
        }
      }
    }
    catch (\Exception $ex) {
      $this->handleException($ex);
    }
    return $actionResponse;
  }
public function doCall ( $ action , $ params ) { if ( self :: $ logger -> isDebugEnabled ( ) ) { self :: $ logger -> debug ( "SoapServer action: " . $ action ) ; self :: $ logger -> debug ( $ params ) ; } $ authHeader = $ this -> requestHeader [ 'Security' ] [ 'UsernameToken' ] ; $ request = ObjectFactory :: getInstance ( 'request' ) ; $ request -> setAction ( 'actionSet' ) ; $ request -> setFormat ( 'soap' ) ; $ request -> setResponseFormat ( 'null' ) ; $ request -> setValues ( [ 'data' => [ 'action1' => [ 'action' => 'login' , 'params' => [ 'user' => $ authHeader [ 'Username' ] , 'password' => $ authHeader [ 'Password' ] [ '!' ] ] ] , 'action2' => [ 'action' => $ action , 'params' => $ params ] , 'action3' => [ 'action' => 'logout' ] ] ] ) ; // run the application $ actionResponse = ObjectFactory :: getInstance ( 'response' ) ; try { $ response = $ this -> application -> run ( $ request ) ; if ( $ response -> hasErrors ( ) ) { $ errors = $ response -> getErrors ( ) ; $ this -> handleException ( new ApplicationException ( $ request , $ response , $ errors [ 0 ] ) ) ; } else { $ responseData = $ response -> getValue ( 'data' ) ; $ data = $ responseData [ 'action2' ] ; $ actionResponse -> setSender ( $ data [ 'controller' ] ) ; $ actionResponse -> setContext ( $ data [ 'context' ] ) ; $ actionResponse -> setAction ( $ data [ 'action' ] ) ; $ actionResponse -> setFormat ( 'soap' ) ; $ actionResponse -> setValues ( $ data ) ; $ formatter = ObjectFactory :: getInstance ( 'formatter' ) ; $ formatter -> serialize ( $ actionResponse ) ; if ( self :: $ logger -> isDebugEnabled ( ) ) { self :: $ logger -> debug ( $ actionResponse -> __toString ( ) ) ; } } } catch ( \ Exception $ ex ) { $ this -> handleException ( $ ex ) ; } return $ actionResponse ; }
Process a soap call
@param $action The action
@param $params The action parameters
@return The Response instance from the executed Controller
Process a soap call