Natural Resources CanadaGovernment of Canada
 
 Français    Contact us    Help    Search    Canada site
 ESS Home    Priorities    Products &
 services
   About the
 Sector
   Site map
Satellite image of Canada
Natural Resources Canada
Geoscience Data Repository
.Home
Geochronology data
.Home/ Download data
.Database format
.Web Services
.WMS Service Examples
.Help for application
See also...
.Terms and conditions
.System requirements
.Alternate access to data
.What's new?
.Tell us what you think!
Related links
.Geochronology Laboratory


Geological Survey of Canada
Geological Survey of Canada


Proactive disclosure


Print version Print version 
 Geoscience Data Repository
Natural Resources Canada > Earth Sciences Sector > Priorities > Geoscience Data Repository > Geochronology Knowledgebase
Canadian Geochronology Knowledgebase
Web Services

Geochronology data contained in the Canadian Geochronology Knowledgebase is accessible through XML Web services. This page describes what is available, states where it can be located, and hints at how you can retrieve the data programmatically.

Service description

The database includes these tables:

  • GSC_Age - catalogue of age assessments
  • Rockfile - catalogue of samples
  • Refs - catalogue of reference materials
  • Rockref - bridge table between Rockfile and Refs

These tables are combined into a flat file view; the services query this view for information. You can get data from one table at a time or you can get all the data in the view at once. The data may be filtered to obtain only that which corresponds to a particular

  • province or territory, or
  • project, or
  • National Topographic System (NTS) sheet.

Note that you must supply parameters to some of the service methods, as described on the next page. Finally, you can obtain the results in either XML or comma-delimited format.

Web services locations

The Web services are listed below. Those services returning data as XML have a different address from those returning comma-delimited text. In each table you can obtain the name of the desired service method by finding the intersection of the data table name and the particular filter.

Services returning data in XML format

Methods are located at http://gdr.ess.nrcan.gc.ca/ geochron/web_services/TableAsXML.asmx

XML unfiltered by Province
All tables allAsXML allAsXMLByProv
Rockfile rockfileAsXML rockfileAsXMLByProv
Refs refsAsXML refsAsXMLByProv
RockRef rockrefAsXML rockrefAsXMLByProv
GSC_Age gsc_ageAsXML gsc_ageAsXMLByProv
XML byProject by NTS
all tables allAsXMLbyProj allAsXMLbyNTS
Rockfile rockfileAsXMLbyProj rockfileAsXMLbyNTS
Refs refsAsXMLbyProj refsAsXMLbyNTS
RockRef rockrefAsXMLbyProj rockrefAsXMLbyNTS
GSC_Age gsc_ageAsXMLbyProj gsc_ageAsXMLbyNTS

Services returning data in comma-delimited text format

Methods are located at http://gdr.ess.nrcan.gc.ca/ geochron/web_services/TableAsCSV.asmx

CSV unfiltered by Province
all tables allAsCSV allAsCSVByProv
Rockfile rockfileAsCSV rockfileAsCSVByProv
Refs refsAsCSV refsAsCSVByProv
RockRef rockrefAsCSV rockrefAsCSVByProv
GSC_Age gsc_ageAsCSV gsc_ageAsCSVByProv
CSV byProject by NTS
all tables allAsCSVbyProj allAsCSVbyNTS
Rockfile rockfileAsCSVbyProj rockfileAsCSVbyNTS
Refs refsAsCSVbyProj refsAsCSVbyNTS
RockRef rockrefAsCSVByProj rockrefAsCSVByNTS
GSC_Age gsc_ageAsCSVByProj gsc_ageAsCSVByNTS

The parameters required to be supplied to some methods are given below. Failure to provide the correct parameter (for example, a valid province code for "...ByProv" methods) results in an error message being returned.

Web service method parameters
parameter name description values
pr two-letter abbreviation for province or territory AB, BC, MB, NB, NF, NS, NU, NT, ON, PE, QC, SK, YT
project project name Churchill 1999, Churchill-Y12, Grenville 2003, Yukon 2002
nts National Topographic System sheet number e.g. 64 or 64A or 64A04

Obtaining data using these services is described briefly on the next page.

Using Geochonology Web Services

Basic description

Web services are like other functions or methods available to a programming environment. The developer needs to know :

  • where the method can be found,
  • the name of the method,
  • any parameters the method needs to complete processing, and
  • the type of result.

Typically, a Web service will describe all of this information via a Web Services Decription Language (WSDL) document. The WSDL is an XML document sometimes referred to as the "contract": the service will process and return a result given a SOAP (Simple Object Access Protocol) message containing the correct parameters.

For these geochronology Web services, most of this information is given on the previous page. For all methods listed, the result is a "string" as defined by Microsoft's .NET environment. This data type is easily understood by most programming and scripting languages, or may be easily converted.

NOTE that the result may be very large and may thus require special handling or increased memory, depending on the programming environment.

A simple example - ASP.NET application

An example Web application developed in ASP.NET and coded in VB.NET can be seen via the geochron Web service example page.

The application takes input from the user, uses that input to determine which method to call, passes the correct parameter values to the method and displays the results on a new page.

Here is a portion of the VB.NET code behind the application (formatted to fit this page):

Private Sub Page_Load (ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles MyBase.Load

     Dim result As String
     Dim value As String
A->  Dim gcXService As Geochronology.TableASXML =
              New Geochronology.TableASXML()
. . .

Select Case Request.Form.Item("tablesel").ToString()
 Case "rockfile"
  Select Case Request.Form.Item("formattype").ToString()
    Case "xml"
      Select Case Request.Form.Item("limit").ToString()
        Case "prov"
          value = Request.Form.Item("prov").ToString()
B->       result = gcXService.rockfileAsXMLByProv(value)
. . .

At point A->, an instance of a proxy class is created that substitutes for the Web service class. The programme then goes through the values chosen by the user on the Web page and selects the appropriate service method. For example, if the user has chosen to get data from the rockfile table, in XML format, filtering for a particular province, then the value of the province chosen is given as the parameter to the "rockfileAsXMLByProv" method, at point B->. The result of that method is received and later printed to the screen.

Other programming interfaces

There are a wide variety of programming interfaces for using Web services as a client or server. One of the attractions of Web services for a client is that one only needs to know the service definition in order to use the service; no knowledge of how the service is programmed is needed. Here is a partial list of existing packages employing SOAP, a popular protocol for accessing Web services.

Application Language Platform Package
Stand alone desktop application Java Unix/Windows Apache SOAP for Java
C++ Windows WASP for C++
C# .NET built-in (System.Web. HTTPRequest, etc.)
VB, Excel Macros Windows MS-SOAP Toolkit
Server-scripted Web page Java (JSP, servlets, applets) Unix, Windows Apache SOAP for Java
PHP Unix/Windows xml-rpc or nusoap
ASP.NET .NET built-in
ASP Windows MS-SOAP Toolkit
Client-side scripted Web page Javascript Windows (IE5.0+) webservice.htc behaviour
Perl CGI Perl Unix/Windows SOAPLite for Perl

Geochronology Web Services Example
Select a table for the source of data:
Refs   GscAge   RockRef  Rock File  All

Limit the selected records:
 No Limit
 by Province/Territory
 by Project
 by NTS sheet
(e.g. 101B02, or 25D)

Select a format for storage:
  XML  Comma-delimited text
 


2006-05-11Important notices