Schedule Php Sample
<?php
class ScheduleType {
  public $Event; // EventType
  public $Proposition; // PropositionType
  public $date; // date
}
 
class EventType {
  public $Grouping; // GroupingType
  public $Location; // LocationType
  public $TvStation; // TvStationType
  public $Participants; // ParticipantsType
  public $dateTime; // dateTime
  public $id; // integer
  public $league; // string
  public $leagueId; // integer
  public $scheduledDateTime; // dateTime
  public $season; // SeasonType
  public $status; // StatusType
  public $timeChange; // boolean
  public $gameCircled; // boolean
}
 
class LocationType {
  public $id; // integer
  public $abbreviation; // string
  public $name; // string
  public $city; // string
  public $state; // string
  public $country; // string
  public $tba; // boolean
  public $stadiumType; // string
  public $surfaceType; // string
  public $elevation; // integer
  public $seatingCapacity; // positiveInteger
  public $postalCode; // string
}
 
class TvStationType {
  public $id; // integer
  public $name; // string
}
 
class ParticipantsType {
  public $Participant; // ParticipantType
}
 
class ParticipantType {
  public $Pitcher; // PitcherType
  public $abbreviation; // string
  public $id; // integer
  public $name; // string
  public $rot; // positiveInteger
  public $side; // SideType
}
 
class PitcherType {
  public $hand; // HandType
  public $id; // integer
  public $name; // string
  public $pitcherChange; // boolean
}
 
class PropositionType {
  public $Grouping; // GroupingType
  public $Props; // PropsType
  public $dateTime; // dateTime
  public $id; // integer
  public $league; // string
  public $leagueId; // integer
}
 
class PropsType {
  public $Prop; // PropType
}
 
class PropType {
  public $name; // string
  public $rot; // integer
}
 
class GroupingType {
  public $id; // integer
  public $description; // string
}
 
class SeasonType {
  const regular = 'regular';
  const pre = 'pre';
  const post = 'post';
}
 
class StatusType {
  const pending = 'pending';
  const in_progress = 'in-progress';
  const postponed = 'postponed';
  const cancelled = 'cancelled';
   public $final = 'final';
}
 
class SideType {
  const away = 'away';
  const home = 'home';
  const neutral = 'neutral';
}
 
class HandType {
  const left = 'left';
  const right = 'right';
  const _switch = 'switch';
  const unknown = 'unknown';
}
 
/**
 * ScheduleService class
 * 
 *  
 * 
 * @author    Matthew Belzberg - Don Best Sports
 * @copyright Creative Commons Attribution 3.0 Unported License
 * @package   donbest.samples.php
 */
class ScheduleService extends SoapClient {
 
  private static $classmap = array(
                                    'ScheduleType' => 'ScheduleType',
                                    'EventType' => 'EventType',
                                    'LocationType' => 'LocationType',
                                    'TvStationType' => 'TvStationType',
                                    'ParticipantsType' => 'ParticipantsType',
                                    'ParticipantType' => 'ParticipantType',
                                    'PitcherType' => 'PitcherType',
                                    'PropositionType' => 'PropositionType',
                                    'PropsType' => 'PropsType',
                                    'PropType' => 'PropType',
                                    'GroupingType' => 'GroupingType',
                                    'SeasonType' => 'SeasonType',
                                    'StatusType' => 'StatusType',
                                    'SideType' => 'SideType',
                                    'HandType' => 'HandType',
                                   );
 
  public function ScheduleService($wsdl = "http://feeds.donbest.com/webservices/schedule.wsdl", $options = array()) {
    foreach(self::$classmap as $key => $value) {
      if(!isset($options['classmap'][$key])) {
        $options['classmap'][$key] = $value;
      }
    }
    parent::__construct($wsdl, $options);
  }
 
  /**
   *  
   *
   * @param string $ScheduleRequest
   * @return ScheduleType
   */
  public function Schedule($ScheduleRequest,$username,$password) {
 
 # Hardcoded Password / Username !!
 
    $authheader = sprintf('
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
             <wsse:UsernameToken>
                <wsse:Username>%s</wsse:Username>
                <wsse:Password>%s</wsse:Password>
             </wsse:UsernameToken>
        </wsse:Security>
    ', htmlspecialchars($username), htmlspecialchars($password));
 
    $authvars = new SoapVar($authheader,XSD_ANYXML);
    $header=new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security",$authvars);
 
    $this->__setSoapHeaders($header);
 
    return $this->__soapCall('Schedule', array($ScheduleRequest),       array(
            'uri' => 'http://donbest.com/schedule/definitions',
            'soapaction' => '',$header
           )
      );
  }
 
}
 
?>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License