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/4323407 to your computer and use it in GitHub Desktop.
Save xignite-engineering/4323407 to your computer and use it in GitHub Desktop.
<?php
// define the SOAP client using the url for the service
$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array("Username" => "your-username", "Password" => "your-password", "Tracer" => ""));
// attach SOAP header
// define the SOAP client using the url for the service
$client = new soapclient('http://www.xignite.com/xMetals.asmx?WSDL',array('trace' => 1));
$client->__setSoapHeaders(array($xignite_header));
// create an array of parameters
// create an arrau of design elements
$Design = new stdClass();
$Design->Outcome = "Success";
$Design->Delay = 200;
$Design->Secure = false;
$Design->TextTitle = "";
$Design->TextHeader = "";
$Design->TextFooter = "";
$Design->TextPriceLine = "";
$Design->TextVolumeBar = "";
$Design->TextHighest = "";
$Design->TextLowest = "";
$Design->TextOpen = "Open";
$Design->TextClose = "Close";
$Design->TextUp = "";
$Design->TextDown = "";
$Design->ColorBackground = "#FFFFFF";
$Design->ColorBackWall = "#fdfdef";
$Design->ColorVolumeBackWall = "#FFFFFF";
$Design->ShowVolumeBackWall = false;
$Design->ColorHighlight = "#00CC00";
$Design->ColorPriceLine = "#00CC00";
$Design->ColorVolumeBar = "#00CC00";
$Design->ColorVolumeBarFill = "#00CC00";
$Design->ColorHigh = "#00CC00";
$Design->ColorStickUp = "#066106";
$Design->ColorStickLow = "#00CC00";
$Design->ColorConstant = "#00CC00";
$Design->ColorLow = "#ff0000";
$Design->ColorPoint = "#00CC00";
$Design->ColorTitle = "#00CC00";
$Design->ColorFooter = "#00CC00";
$Design->ColorHeader = "#00CC00";
$Design->ColorAxis = "#00CC00";
$Design->ColorGrid = "#000000";
$Design->ColorFonts = "#00CC00";
$Design->ColorStripe = "#00CC00";
$Design->ColorOpen = "#9900CC";
$Design->ColorClose = "#00CC00";
$Design->ColorVerticalGrid = "#c8c8c8";
$Design->ColorHorizontalGrid = "#c8c8c8";
$Design->ColorUp = "#00CC00";
$Design->ColorDown = "#9900CC";
$Design->ColorHighLowLine = "#00CC00";
$Design->ColorCollection = "#CE0000,#CE9C00,#3300FF,#00CC00,#9900CC,#FF6600,#0099FF";
$Design->GridHorizontalStyle = "Solid";
$Design->GridVerticalStyle = "Solid";
$Design->GridHorizontalWidth = 1;
$Design->GridVerticalWidth = 1;
$Design->ColorFrame = "";
$Design->FrameBorder = "";
$Design->FormatPriceLine = "Dynamic";
$Design->FormatVolume = "#,#0.0M";
$Design->FormatDate = "M/yy";
$Design->GradeBackground = false;
$Design->GradeBackwall = false;
$Design->WaterMark = "";
$Design->WaterMarkTopMargin = 0;
$Design->WaterMarkLeftMargin = 0;
$Design->WaterMarkTransparency = 0;
$Design->PointSize = 0.015;
$Design->StackVariationLabels = false;
$Design->ShowAxisLabelInLegend = false;
$Design->LineWidth = 2;
$Design->SplitPercent = 0;
$Design->ShowHigh = false;
$Design->ShowLow = false;
$Design->ShowOpen = false;
$Design->ShowClose = false;
$Design->ShowVolume = false;
$Design->ShowUpVariation = false;
$Design->ShowDownVariation = false;
$Design->ShowLegend = true;
$Design->VariationYear = 1;
$Design->VolumeDivider = 1000000;
$Design->VolumeTextOffset = -30;
$Design->PriceTextOffset = -30;
$Design->FrameType = "None";
$Design->Projection = "Orthogonal";
$Design->MarginTop = 4;
$Design->MarginBottom = 6;
$Design->MarginLeft = 2;
$Design->MarginRight = 0;
$Design->FontFamily = "arial";
$Design->FontSizeHeader = 8;
$Design->FontSizeFooter = 8;
$Design->Height = 1.0;
$Design->Width = 1.0;
$Design->ZoomPercent = 100;
$Design->LegendBox = false;
$Design->ColorLegendBackground = "#FFFFFF";
$Design->ColorLegendBorder = "#000000";
$Design->LegendVerticalPosition = "0";
$Design->LegendHorizontalPosition = "76";
$Design->Reload = false;
$Design->ShowPriceChartLabels = true;
$Design->TickPrecision = "Day";
$Design->TickPeriods = "1";
$Design->WaterMarkHorizontalAlign = "Center";
$Design->LightScheme = "None";
$Design->FontSizeLegend = 8;
$Design->FontSizeAxes = 8;
$Design->FontSizeTitle = 9;
$Design->DaysForHourDisplay = 1;
$Design->DaysForDayDisplay = 14;
$Design->DaysForWeekDisplay = 62;
$Design->DaysForBiWeeklyDisplay = 93;
$Design->DaysForMonthDisplay = 186;
$Design->DaysForQuarterDisplay = 372;
$Design->DaysForSemiAnnualDisplay = 1116;
$Design->DaysForAnnualDisplay = 1116;
$Design->DaysForBiAnnualDisplay = 3720;
$Design->DaysForPentaAnnualDisplay = 9300;
$param = array(
'Type' => "COMEXGold",
'StartDate' => "12/01/2010",
'EndDate' => "12/9/2010",
'Style' => "Line",
'Width' => "600",
'Height' => "400",
'Design' => $Design);
// call the service, passing the parameters and the name of the operation
$result = $client->GetHistoricalMetalFutureChartCustom($param);
// assess the results
// assess the results
if (is_soap_fault($result))
{
print_r($result);
}
else
{
$theOutcome = $result->GetHistoricalMetalFutureChartCustomResult->Outcome;
$theChartUrl = $result->GetHistoricalMetalFutureChartCustomResult->Url;
if ($theOutcome == "Success")
{
print "<img src=\"$theChartUrl\">";
}
else
{
print "<img src=\"default.gif\" >";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment