Balancing Market Toolkit

Created: 11th April 2017
Updated: 4th May 2017
Version: 1.0

Pre-requisites

Java SDK 1.8.x should be installed. The environment variables JAVA_HOME and PATH should be set properly.
Apache Ant 1.9.x (software tool suitable for building Java projects) should be installed. Similarly ANT_HOME and PATH should be set properly.

The following commands must be run without any problem in a console window (Unix terminal or Windows Command Prompt).
java -version
ant -version

Setup

Unzip the "mi-isem-ws-client-5.0.1-b<NNN>.tgz" into an empty directory.

NOTE: THE ENTIRE PATH TO THIS EMPTY DIRECTORY SHOULD NOT CONTAIN SPACE(S).

Directories and Scripts

You should see the following directory structure and files under the "isem-ws-client" directory.

Item Description
certs/ Toolkit certificates are placed in this directory.
certs/server-ca.jks The Java keystore is pre-populated with Toolkit Test CA certificate.
certs/*.p12 Sample Toolkit certificate for development testing.
config/ WSDL and XML Schema files (for reference). This directory also contains "log4j.properties" for configuring Apache log4j logging.
dist/ Web service client jar is in this directory.
request-files/ XML request files to be submitted as web service payload should be placed in this directory.
request-files/mp-market This sub-directory contains sample XMLs for mp-market Web Service request types. To submit a request xml file copy a sample file to the root request-files directory and modify as required.
request-files/ws-client.properties Main configuration file, which has all the property setting for running the Web Service client.
response-files/ Response from the web service request are stored in this directory.
third-party/ Third party libraries (Axix2 and XML Security) are in this directory.
build.xml Build script for web service client.
README.html This readme file.

Files to setup before running the Web Service client

The following files needs to be updated before running the Web Service client.

Important properties to set in "ws-client.properties"

ws.client.end.point      = https://mpc.sem-o.com/mws/ 
ws.client.cert.file      = TOOLKITUSER@PY_034000.p12
ws.client.cert.password  = 123456
ws.client.request.type   = <Request-Type>
ws.client.input.file     = <XML-Request-File>

Web Service Request Types

The following Web Service request types can be used for various activities.

Request type Description
mp.market Market participant market data requests (submit, query)
mp.report Market participant report requests (report list, report download)
ei.inbound.metering External Interface inbound data from MDPs. Meter Data Provider data requests (submit, query)

Sample Execution and Console Output

The web service client can be run as follows:
$ ant
$ ant -Dcfg.file=ws-client.properties

NOTE: You can have your own configuration file and can specify using -Dcfg.file=<MyPropertiesFile> option.

$ ant
Buildfile: /abbrt/appmi/isem-ws-client/build.xml

run.client:
[java] INFO Started web service client...
[java] INFO Config File: ./request-files/ws-client.properties
[java] INFO ClientCert: ./certs/TOOLKITUSER@PY_034000.p12
[java] INFO EndPoint: https://mpc.sem-o.com/mws/
[java] INFO Keystore: ./certs/server-ca.jks
[java] INFO Request Type: mp.report
[java] INFO Admin Role: false
[java] INFO Reading input: ./request-files/rpt-list.xml
[java] INFO Writing file: ./response-files/rpt-list-sig.txt
[java] INFO Submitting attachment...
[java] INFO Submitting attachment returned
[java] INFO Success: true
[java] INFO Warning: false
[java] INFO Writing response to file: ./response-files/rpt-list-out.xml
[java] INFO Finished client.

BUILD SUCCESSFUL
Total time: 1 seconds

The Web Service response is stored in the "response-files" sub-directory.