LAADS Web Service Classic Quick Start Guide
Resource Locations
Web Service Description Language (WSDL) URL
http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices?wsdl
This XML document describes the Web Service interface, by describing the operations, parameters, and data structures used in the Web Service.
Web Service Access Point URL
http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices
This is the location of the actual web service that responds to queries.
Web Service Namespace URN
http://modapsws.gsfc.nasa.gov
This is not an actual location but is the namespace that SOAP clients generally require that you provide them with before making queries.
Workflow Synopsis
Typical scenario: search, order, retrieve
Finding and obtaining data files is generally a three step process: searching, ordering, and then retrieving the files. However, the process will generally require more than three web service calls.
Alternate Scenario: search, fetch URLs
Alternatively, if the files you find (via searching) are already online and available on the download server, and you do not require any additional processing (subsetting, reformatting, etc.), you can directly obtain URLs for those files. You can determine whether the files you seek are online by using the getFileProperties method, which contains a boolean field in the results indicating whether the file is currently online.
Example sequences of web service calls
Simple Order (No Post-Processing)
- Instruments = listSatelliteInstruments()
- Products = listProductsByInstrument( Instrument )
- File IDs = searchForFiles( Product, spatial info, temporal info )
- Order IDs = orderFiles( File IDs )
- getOrderStatus( Order ID )
- getOrderUrl( Order ID )
Order with Post Processing
- Products = listProducts()
- File IDs = searchForFiles( Product, spatial info, temporal info )
- getPostProcessingTypes( Product )
- reprojectionNames = listMapProjections( Product )
- reprojectionParams = listReprojectionParameters( reprojectionName )
- Order IDs = orderFilesProcessed( File IDs, reprojectionName, reprojectionParams, otherProcessingOptions, ... )
- getOrderStatus( Order ID )
- getOrderUrl( Order ID )
Simple URL fetching
- Products = listProducts()
- File IDs = searchForFiles( Product, spatial info, temporal info )
- getFileUrls( File IDs )
Code Examples
REST
The web service can be used by executing a series of GET requests to the service. For example, to search and get file URLs:
- http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices/searchForFiles?product=MOD021KM&collection=61&start=2008-10-23&stop=2008-10-23&north=40&south=30&west=-80&east=-70&coordsOrTiles=coords&dayNightBoth=DNB
- http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices/getFileProperties?fileIds=2802317566,2802316280,2802317765
- http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices/getFileUrls?fileIds=2802317566,2802316280,2802317765
Here are some more examples.
PHP with REST
<?php $restQuery = 'http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices/ listProductsByInstrument?instrument=AM1M'; $result = new SimpleXMLElement($restQuery,NULL,TRUE); foreach ( $result as $product ){ echo "$product\n"; } ?>
Perl with SOAP::Lite
use SOAP::Lite; my $WS_NAMESPACE = 'http://modapsws.gsfc.nasa.gov'; my $WS_URL = 'http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices'; my $client = SOAP::Lite->uri($WS_NAMESPACE)->proxy($WS_URL); my $instrument = SOAP::Data->name('instrument')->value('AM1M')->type('string'); my $response = $client->listProductsByInstrument($instrument); if ( $response->fault ) { print $response->faultstring; } else { my @products = (); push @products, $response->result, $response->paramsout; print join("\n", @products); }
PHP with SOAPClient
<?php $client = new SoapClient("http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices?wsdl"); $client->listProductsByInstrument("AM1M"); ?>
Python with SOAPpy
from SOAPpy import SOAPProxy url = 'http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices'; client = SOAPProxy(url); response = client.listProductsByInstrument(instrument='AM1M'); for r in response: print r;
Order Script
The following script and parameter files allow the user to list, download, and order files using the LAADS Web Service Classic (MWS).
- order_MWS.pl - script which accepts parameters files to list, download, and order files using the LAADS Web Service Classic (MWS).
- list_example.txt - parameter file that searches for and lists URLs to MODIS collection 61 1km L1B files over Indonesia for Aug 1, 2008.
- download_example.txt - parameter file that searches for and downloads MODIS collection 61 1km L1B files over Indonesia for Aug 1, 2008.
- order_example.txt - parameter file that orders MODIS collection 61 1km L1B files over Indonesia for Aug 1, 2008, subset and mosaicked in geographic lon/lat grid.