
<?php

/*
 *
 * Copyright 2009 France Telecom SA Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and limitations under the License.
 */


/**
 *  @desc Client proxy for the service ConnectivityDirectory
 *  @name  M2M_ConnectivityDirectoryClient
 *  @package M2M API
 *  @param M2M_ServiceConfigurator
 */

class M2M_ConnectivityDirectoryClient extends M2M_M2mClient {
  
  /**
   * @var array of string
   * mapping class/xml_entity
   */
  private $_aClassMap = array(
       "getConnectivityDirectory" => "getConnectivityDirectory",
    "LineIdentifierCollection" => "LineIdentifierCollection",
    "Msisdn" => "Msisdn",
    "getConnectivityDirectoryResponse" => "getConnectivityDirectoryResponse",
    "ConnectivityDirectory" => "ConnectivityDirectory",
    "Sim" => "Sim",
    "Subscription" => "Subscription",
    "SubscriptionDescription" => "SubscriptionDescription",
    "Device" => "Device",
    "Contact" => "Contact",
    "CommunicationModule" => "CommunicationModule",
    "ConnectivityDirectoryDevice" => "ConnectivityDirectoryDevice",
    "Machine" => "Machine",
    "ConnectivityDirectoryMachine" => "ConnectivityDirectoryMachine",
    "CustomerIdentifier" => "CustomerIdentifier",
    "ConnectivityDirectoryGeographicPosition" => "ConnectivityDirectoryGeographicPosition",
    "ConnectivityDirectoryGeographicPositionAccuracy" => "ConnectivityDirectoryGeographicPositionAccuracy",
    "Imsi" => "Imsi",
    "searchInConnectivityDirectory" => "searchInConnectivityDirectory",
    "ConnectivityDirectorySearchCriterion" => "ConnectivityDirectorySearchCriterion",
    "SortCriterion" => "SortCriterion",
    "searchInConnectivityDirectoryResponse" => "searchInConnectivityDirectoryResponse",
    "SimStatusDistribution" => "SimStatusDistribution",
    "SimStatusStatistic" => "SimStatusStatistic",
    "updateConnectivityDirectory" => "updateConnectivityDirectory",
    "DataBySubscriptionNumber" => "DataBySubscriptionNumber",
    "DataBySimSerialNumber" => "DataBySimSerialNumber",
    "DataByDeviceImei" => "DataByDeviceImei",
    "DataByDeviceSerialNumber" => "DataByDeviceSerialNumber",
    "DataByDeviceUniqueId" => "DataByDeviceUniqueId",
    "DataByMachineSerialNumber" => "DataByMachineSerialNumber",
    "DataByMsisdnVoice" => "DataByMsisdnVoice",
    "DataByMsisdnData" => "DataByMsisdnData",
    "DataByMsisdnFax" => "DataByMsisdnFax",
    "updateConnectivityDirectoryResponse" => "updateConnectivityDirectoryResponse",
    "UpdatesCompletedList" => "UpdatesCompletedList",
    "LineIdentifier" => "LineIdentifier",
    "UpdatesFailedList" => "UpdatesFailedList",
    "UpdateFailed" => "UpdateFailed");
	

  /**
   * 
   * @param M2M_ServiceConfigurator $oService
   */
 	public function __construct(M2M_ServiceConfigurator $oService) {
		parent::__construct($oService, $oService->get_sConnectivityDirectoryUrl(), dirname(__FILE__) . "/resources/ConnectivityDirectory_V1_10.wsdl" , $this->_aClassMap );
    }
  
  /**
   * 	
   * @param ServiceConfig $oInput
   * @return getConnectivityDirectoryResponse
   * 
   */
  public function call_getConnectivityDirectory($oInput) {
    
    try {
	    // call the operation
	    $oResponse = $this->_oSoapClient->getConnectivityDirectory ( $oInput );
    }
    catch ( Exception $e ) {
		parent::logRequest ("A problem occured while calling " . __METHOD__);
		parent::logResponse (" Last Response (warning: may not be the response you expected if the request failed before reaching the endpoint)." . __METHOD__ );      
		throw $e;
    }    
    
    // Log SOAP exchanges
    parent::logSuccessfullExchange();
        
    return $oResponse;
  }
  
  /**
   * 
   * @param ServiceConfig $oInput
   * @return searchInConnectivityDirectoryResponse  
   */  
  public function call_searchInConnectivityDirectory($oInput) {
    
    try {
      // call the operation
      $oResponse = $this->_oSoapClient->searchInConnectivityDirectory ( $oInput );
    } 
    catch ( Exception $e ) {
      parent::logRequest ( "A problem occured while calling " . __METHOD__);
      parent::logResponse (" Last Response (warning: may not be the response you expected if the request \"failed before reaching the endpoint\")." . __METHOD__ );
      throw $e;
    }   
    
    // Log SOAP exchanges    
    parent::logSuccessfullExchange();
    
    return $oResponse;
  }
  
  /**
   * @param ServiceConfig $oInput
   * @return updateConnectivityDirectoryResponse  
   */
  public function call_updateConnectivityDirectory($oInput) {
    
    try {
      // call the operation
      $oResponse = $this->_oSoapClient->updateConnectivityDirectory ( $oInput );
    }
    catch ( Exception $e ) {
      parent::logRequest ( "A problem occured while calling " . __METHOD__);
      parent::logResponse (" Last Response (warning: may not be the response you expected if the request \"failed before reaching the endpoint\")." . __METHOD__ );      
      throw $e;
    }       
    
    // Log SOAP exchanges
    parent::logSuccessfullExchange();
    
    return $oResponse;
  }
}

?>
	
		  		  

