This application is a proxy for WMS services, specifically setup to access Web Map Services that have not setup with CORS headers.
While a generic proxy can be used the advantage of this project is its deep knowledge of the WMS protocol, and ability to report any errors using the appropriate ServiceExceptionReport
document expected by WMS clients.
- GETCAPABILITIES
- GETSTYLES
- GETMAP
- GETFEATUREINFO
- GETLEGENDGRAPHIC
The web application double checks content is of the expected type (such as a GetMap
request expecting an image/png
).
Build using maven:
- Tested with AdoptOpenJDK 1.8.0_251
- Tested with Apache Maven 3.6.3
The project makes use of jemafutils
.
-
Build locally using the provided script.
cd jemafUtils ./makejar.sh
-
Or build using maven:
cd jemafUtils mvn clean install
-
Build using the provided scripts.
-
makejar.sh
useslog4j-build.properties
configuration to record onlyWARN
messages:cd WmsProxyWebService makejar.sh
Record logs to
/aafc-aac/agsshare/emaf/logs/wmsproxy.log
. -
devMakejar.sh
useslog4j.properties
configuration recordingINFO
messages:cd WmsProxyWebService devMakejar.sh
Record logs to
wmsproxy.log
-
-
Or build using maven:
cd WmsProxyWebService mvn clean package
-
The resulting war:
ls target/*.war
-
Run locally:
mvn jetty:run-war
The web.xml
contains several apache specific filters:
- url rewrite filter:
http
toremoteService=http
- CORS filter
It is a good practice to manage CORS filter in Tomcat $CATALINA_BASE/conf/web.xml
so policy is strictly under control of the system administrator.
The emaf_config
property is used to supply a configuration file:
-Demaf_config=configFiles/emaf.properties
This is read by GlobalEnvironmentPropertiesController
, and does not appear to be used.
Logging is provided by log4j, see WEB-INF/classes/log4j.properties
. To debug proxy activity a level of TRACE
is recommended:
log4j.logger.ca.gc.agr.jemaf.ws.wmsproxy=TRACE
By default this is hardcoded to record a log file in /aafc-aac/agsshare/emaf/logs/wmsproxy.log
.