The following shows the sequence of steps to perform a SOAP exchange with the MES Application using the EZ_SoapReader. Perform these steps if this is the first time you use the EZ_SoapReader (Each of these steps is explained in detail in the following sub chapters):
- Test the SOAP Interface
- Optional: Create a new account in MES (In case you do not already have an account)
- Generate a Key (to authenticate the client to the MES Application)
- Install the EZ_SoapReader client application
- Start the EZ_SoapReader
- Authenticate the EZ_SoapReader by entering the User Name and PassKey
- Load the sample query
- Run the sample query
A simple way to see if the Web Service is working is to open your browser and to enter the following address:
http://xxx.eazyworks.com/EazyWebService.asmx
xxx is the project name for your MES application when we do the hosting. When your company does the hosting itselves, the whole xxx.eazyworks.com like will look different. After you entered this address, it should show the following page:
If you see this page, you are done. The Web Service works and you can continue making your key. .
The page shown above shows a summary of the instructions that can be used to communicate with the Web Service. In the following we will only use the mGenerateFile to return the result of the sample MES Query as an Excel file.
Clicking the mGenerateFile link on this page will show you an example for the envelop of the SOAP request. It also show the envelop for the return.
To use the EZ_SoapReader, you need to have a valid account in the MES Application. If you don’t have an account yet, click the following link to see how you can Create a New Account
Remember the user access rights for the SOAP account will limit or allow the objects that can be accessed. So check with the MES system administrator if the rights assigned to you are sufficient to do what you would like to do.
To authenticate the EZ_SoapReader application, you need to create a key in the MES application: Generate a New PassKey.
This is the key you will need to enter into your EZ_SoapReader desktop application. You can copy the content of the Pass Key field to a text file. You will need this key when we run the EZ_SoapReader.
You will only have to copy the supplied files to a folder (No installer has to be run). Take the following steps:
- Download the EZ_SoapReader attachment you received by e-mail.
- This is a zipped file, to unzip it first rename the downloaded attachment from EZ_Soap.zip_ -> EZ_Soap.zip (some mail clients prevent to send files with a ‘.zip’ extension)
- Create a new folder on your client PC with the name EZ_Soap. This can be anywhere.
- Extract the files from the ZIP folder to your local EZ_Soap folder
The application consists of the following files:
- EZ_SoapReader.exe
- EZ_SoapReader.exe.config
- AjaxPro.2.dll
You will need all these files in the same folder to run the application.
Web address in the Config file
The config file contains the webaddress to address the web service. In most cases we already set the correct address in the file, but in case you run it internally you have to change it to wherever you are running the application.
You can start the EZ_SoapReader by opening the EZ_Soap folder and double click the EZ_SoapReader.exe application. As shown in the following screen shot (Note, the files can different in your folder, but should contain the EZ_SoapReader application):
This will open the following screen:
Note this picture shows the User Name, PassKey, and MES Query inputs already filled out. We will go over that in the following sections.
To authenticate the EZ_SoapReader to be able to access the MES Application, you have to fill out the following:
- User Name: fill out the user name you use to login into the MES application.
- Copy the PassKey from your user settings form in the MES application, or if you saved it in a file, copy it from there. (Read 'Generate a New PassKey' if you don’t know how to create this key)
The EZ_SoapReader has a pre-configured example. The arguments of this example are automatically filled out at the moment when you press the ‘Sample’ button. Pressing this button will define the output arguments and the input arguments for the MES Query.
It will display a message: Set Sample Values that will return all Travelers.
Sample MES Query
This sample MES Query will get all the travelers that are in the MES Application, and will show these travelers in a single column of an Excel spreadsheet. It will show the Full Name of these travelers.
Output arguments
The output arguments consist of the following:
- Result Path: C:\SampleExcel.xls. This is the file and location where the results of the query will be stored. If you want to store them somewhere else, just enter the full path and file name. Make sure to use extension .xls if you would like to get an Excel file.
- The file type is by default xls. You can change it to CSV.
Query arguments
The MES Query language has 4 main arguments, for each of these arguments an input field is defined in JSON format:
- S_arJSColm: [{"sTyp":"jobname","sNm":"sJob","sFilterValue":"","sTitle":"No"}]
This argument defines the columns you would like to display in the output. For more information see the chapter about the MES Query Syntax - S_o: {"sFlowName":"FR_Flow"}
The main MES object you are querying. In one of the following chapters you can find a full list of all the MES Objects that can be queried. - S_arChecksVals: null
Filters for the results, in this case no filters are set - S_oSort: null
Different ways you can sort the results, in this case no sorting is defined
So now we will connect to the MES application by pressing the ‘RUN File’ button. After pressing this button the following messages are displayed in the SOAP Tester form:
STARTING SERVER CALL….
EXECUTING SOAP CALL….
IF every thing is configured correctly you will get:
DONE
Server Call Finished
You can now check on the location where you defined the EZ_SoapReader to write the xls file to open the file (Program default: C:\SampleExcel.xls)
MES Event Recording
In the user dialog for the user that is used for the SOAP access a couple of events are recorded:
- The actual Key to authenticate the SOAP Request
- The time the Key was generated
- The Last time the Key was used to access the application
Trouble Shooting
If you did not define a Key you will get:
Server was unable to process request. à User Credentials Not Correct
If the address for the Web application is not correct you will get:
The request failed with HTTP status 400: Bad Request
If it cannot get the Web address from the config file:
The request failed with HTTP status 403: Forbidden
This concludes the Step by Step description to perform a SOAP transaction between the EZ_SoapReader and the MES application.