A self-contained Windows command file can use curl to invoke the esi.manage measure export integration service through judicious use of newline and quote escaping:
@ECHO OFF
SETLOCAL
SET server=127.0.0.1:8080
SET request=^
-h ^
-g PROJECT.NAME ^
-c none -m PRODUCTION -b GROSS -v FORECAST -U Oil:boe -D NONE --curtailment ^
-c scheduled -m PRODUCTION -b GROSS -v FORECAST -U Oil:boe -D SCHEDULED --curtailment ^
-c unscheduled -m PRODUCTION -b GROSS -v FORECAST -U Oil:boe -D UNSCHEDULED --curtailment ^
-c all -m PRODUCTION -b GROSS -v FORECAST -U Oil:boe -D ALL --curtailment ^
2010-01-01 ^
18 M ^
\"origin subset\"
curl ^
--ntlm ^
--user : ^
-X POST ^
-H "content-type:text/plain" ^
--data-binary "%request%" ^
http://%server%/3esi/manage/integration/export
The use of the --data-binary
option is important since -d
or --data-ascii
will reformat the data (e.g. strip newlines).