Scores Php Sample
<?php
class ScoresRequest {
  public $TimeStamp; // dateTime
}
 
class ScoresType {
  public $Event; // EventType
  public $Proposition; // EventType
  public $asOfDateTime; // dateTime
}
 
class EventType {
  public $ClosingLines; // ClosingLinesType
  public $Participants; // ParticipantsType
  public $dateTime; // dateTime
  public $id; // integer
  public $league; // string
  public $leagueId; // integer
  public $period; // integer
  public $season; // string
  public $status; // string
  public $timer; // string
}
 
class ClosingLinesType {
  public $Book; // BookType
}
 
class BookType {
  public $PeriodOdds; // PeriodOddsType
  public $id; // integer
  public $name; // string
}
 
class PeriodOddsType {
  public $Money; // MoneyType
  public $Total; // TotalType
  public $Spread; // SpreadType
  public $linePeriod; // string
  public $timeStamp; // dateTime
}
 
class MoneyType {
  public $away; // integer
  public $home; // integer
}
 
class TotalType {
  public $overPrice; // integer
  public $points; // decimal
  public $underPrice; // integer
}
 
class SpreadType {
  public $awayPrice; // integer
  public $homePrice; // integer
  public $awayPoints; // decimal
  public $homePoints; // decimal
}
 
class ParticipantsType {
  public $Participant; // ParticipantType
}
 
class ParticipantType {
  public $Pitcher; // PitcherType
  public $PeriodSummary; // PeriodSummaryType
  public $abbreviation; // string
  public $id; // integer
  public $name; // string
  public $rotation; // integer
  public $score; // string
  public $side; // string
  public $team; // string
}
 
class PitcherType {
  public $hand; // string
  public $id; // integer
  public $name; // string
}
 
class PeriodSummaryType {
  public $Period; // PeriodType
}
 
class PeriodType {
  public $final; // boolean
  public $name; // string
  public $number; // integer
  public $score; // integer
}
 
/**
 * ScoresService class
 * 
 *  
 * 
 * @author    Matthew Belzberg - Don Best Sports
 * @copyright Creative Commons Attribution 3.0 Unported License
 * @package   donbest.samples.php
 */
class ScoresService extends SoapClient {
 
  private static $classmap = array(
                                    'ScoresRequest' => 'ScoresRequest',
                                    'ScoresType' => 'ScoresType',
                                    'EventType' => 'EventType',
                                    'ClosingLinesType' => 'ClosingLinesType',
                                    'BookType' => 'BookType',
                                    'PeriodOddsType' => 'PeriodOddsType',
                                    'MoneyType' => 'MoneyType',
                                    'TotalType' => 'TotalType',
                                    'SpreadType' => 'SpreadType',
                                    'ParticipantsType' => 'ParticipantsType',
                                    'ParticipantType' => 'ParticipantType',
                                    'PitcherType' => 'PitcherType',
                                    'PeriodSummaryType' => 'PeriodSummaryType',
                                    'PeriodType' => 'PeriodType',
                                   );
 
  public function ScoresService($wsdl = "http://feeds.donbest.com/webservices/scores.wsdl", $options = array()) {
    foreach(self::$classmap as $key => $value) {
      if(!isset($options['classmap'][$key])) {
        $options['classmap'][$key] = $value;
      }
    }
    parent::__construct($wsdl, $options);
  }
 
  /**
   *  
   *
   * @param ScoresRequest $ScoresRequest
   * @return ScoresType
   */
  public function Scores(ScoresRequest $ScoresRequest,$username,$password) {
 
    $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('Scores', array($ScoresRequest),       array(
            'uri' => 'http://donbest.com/scores/definitions',
            'soapaction' => '',
                $header
           )
      );
  }
 
}
 
?>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License