Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xignite-engineering/4323414 to your computer and use it in GitHub Desktop.
Save xignite-engineering/4323414 to your computer and use it in GitHub Desktop.
<?php
// define the SOAP client using the url for the service
$client = new soapclient('http://www.xignite.com/xGlobalHistorical.asmx?WSDL', array('trace' => 1));
// create an array of parameters
$param = array(
'Identifier' => "BMW.DE",
'IdentifierType' => "Symbol",
'StartDate' => "7/5/2011",
'EndDate' => "7/4/2012");
// PLEASE MODIFY THE BELOW LINES TO MATCH YOUR ACCOUNT FIRST
$xignite_header = new SoapHeader('http://www.xignite.com/services/',
"Header", array("Username" => "you@yourcompany.com"));
$client->__setSoapHeaders(array($xignite_header));
// call the service, passing the parameters and the name of the operation
$result = $client->GetCashDividendHistory($param);
// assess the results
if (is_soap_fault($result)) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
echo "<h2>Result</h2>\n<ul>";
echo "<li>Outcome: {$result->GetCashDividendHistoryResult->Outcome}</li>";
echo "<li>Symbol: {$result->GetCashDividendHistoryResult->Security->Symbol}</li>";
echo "<li>Market: {$result->GetCashDividendHistoryResult->Security->Market}</li>";
echo "<ul>";
foreach ($result->GetCashDividendHistoryResult->Dividends as $dividend)
{
echo "<li>Dividend ExDate: {$dividend->ExDate}</li>";
echo "<li>Amount: {$dividend->DividendAmount}</li>";
}
echo "</ul></ul>";
}
?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.xignite.com/services/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.xignite.com/services/">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">On-demand global historical quotes.</wsdl:documentation>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.xignite.com/services/">
<wsdl:types>
<!-- ... -->
<s:element name="GetCashDividendHistoryResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetCashDividendHistoryResult" type="tns:DividendHistory"/>
</s:sequence>
</s:complexType>
</s:element>
<!-- ... -->
<s:complexType name="DividendHistory">
<s:complexContent mixed="false">
<s:extension base="tns:AbstractGlobalHistoricalObject">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Security" type="tns:Security"/>
<s:element minOccurs="0" maxOccurs="1" name="Dividends" type="tns:ArrayOfDividend"/>
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>
<!-- ... -->
</wsdl:types>
</s:schema>
</wsdl:documentation>
</wsdl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment