DTN ProphetX® Web Services

Sample Code and Results

The purpose of this section is to provide a series of small but complete examples of code that can be freely downloaded and modified for use in PXWeb related projects.  Some sample results are included at the end of this page to illustrate the output of some requests.

Disclaimer: DTN grants you an nonexclusive copyright license to use this code and you can use it to prepare similar functions tailored to your own needs.  The code is provided for illustrative purposes only and has not been tested under all conditions.  For that reason, DTN provides this code to you "AS IS" without any warranties of any kind.

ASP

Name Description Dependencies
GetDailyHistoryHtml.asp ASP/VBScript example to invoke GetDailyHistory and present result as an HTML table using a style sheet. GetDailyHistoryHtml.xsl
GetQuoteSnapHtml.asp ASP/VBScript example to invoke GetQuoteSnap and present result as an HTML table using a style sheet. GetQuoteSnapHtml.xsl

C#

Name Description Dependencies
DynamicConfig.cs Dynamic handling of the channel configuration avoiding need for a configuration file.
This technique may be needed when accessing PXWeb from some environments like SQL Server Integration Services.

Java

Name Description Dependencies
GetDailyHistoryCsv.java Retrieve history data for a given list of search patterns and reformat result as CSV.
This example can be easily modified for GetMinuteHistory and GetTickHistory.

Python

Sample code has been tested with Python 2.7 from www.python.org.

Most of the examples for Python need the PXWeb.py module, which contains common code to access PXWeb, just download this module at the same location as the example being tested.

Name Description Dependencies
PXWeb.py Common PXWeb access module, most of the Python examples import this module.
GetDailyHistoryCsv.py Retrieve history data for a given list of search patterns and reformat result as CSV.
This example can be easily modified for GetMinuteHistory and GetTickHistory.
PXWeb.py
GetDailyHistoryHtml.py Retrieve history data for a given list of search patterns and reformat result as an HTML table.
This example can be easily modified for GetMinuteHistory and GetTickHistory.
PXWeb.py
GetDailyHistorySvg.py Retrieve history data for a given search pattern and build a SVG chart.
The result SVG file can be viewed on a SVG compatible browser like IE9 and FireFox
PXWeb.py
GetDailyHistorySoap.py Retrieve history data via SOAP for a given list of search patterns and write result to an XML file.
This example can be easily modified for GetMinuteHistory and GetTickHistory.

XSLT

Name Description Dependencies
GetDailyHistoryHtml.xsl Style sheet to convert result from GetDailyHistory to HTML table.
GetQuoteSnapHtml.xsl Style sheet to convert result from GetQuoteSnap to HTML table.

Sample Results

These files where generated by using very open symbol search patterns and they are larger than the average result.

Name Description
GetQuoteSnap.xml Sample result from a GetQuoteSnap request.
GetDailyHistory.xml Sample results from a GetDailyHistory request.