Get Data Source
This function allows fine-grained object access to a FeatureLayer, a RasterLayer or a StandaloneTable by returning IFeatureClass, IRaster or ITable respectively. If the layer or standalone table has any joins, the returned object will not contain the joined portion. In addition any field visibility or field alias set to the layer in the source map document will be ignored as it returns the underlying data source.
RasterLayer rl = (RasterLayer) mapServer.getLayer("Layers", 0); System.out.println(rl.getSpatialReference().getName()); System.out.println(rl.getFilePath());
But I was under the impression that you can't use the getLayer method from an SOE at all as of 10.1, because it's not supported on optimized map services
A Raster can be created in three ways:
1. Get from a RasterLayer using IRasterLayer::Raster
2. Create from a raster dataset using either :IRasterDataset::CreateDefaultRaster or IRasterDataset2::CreateFullRaster
3. Cocreate a Raster and append raster bands using IRasterBandCollection interface.
FeatureClass fc = new FeatureClass(this.mapServerDataAccess.getDataSource(mapName, layerId));
IRaster raster = this.mapServerDataAccess.getDataSource(mapName, layerId);
This function allows fine-grained object access to a FeatureLayer, a RasterLayer or a StandaloneTable by returning IFeatureClass, IRaster or ITable respectively.