- The web services definition language file to access AiM is located at : (Test instance https://uconnapp.assetworks.com:8443/fmax/wsdl/fmax-wsdl.wsdl)
- This should load up the list of all web services available like the following:
- Download SoapUI from https://www.soapui.org/downloads/latest-release.html
- Install SoapUI and open it.
- Create a new project in SoapUI : Go to File -> New Soap Project
- Provide a soap project name and correct initial wsdl.
Only choose Create sample for all operations and leave the others unchecked, then click the Ok button.
It should generate the WSDLs and look something like the following
Work Order web service creation
Please follow the steps below to create an work order from SOAP.
- Find templateApPProESoapBinding service from the navigator on left pane. Expand the grey arrow next to templateAePProE and double click on the Request 1.
- Before running please enter your username and password in the “Request Property” are below Navigator on left pane.
Another way to do authorization is the following:
- Click on authorization -> new authorization. -> Add New Authorization. In the “Add Authorization” window choose “Basic” as Type and press ok.
- An authorization window will appear below. Please enter your credentials for AiM there. No need to put any domain value.
- At this point hit the run button. This returns a document back. Id for document in example is “120328-001021”.
This will create a new work_order in AiM. One needs to fill up the mandatory fields before submitting.
- To know the table and column names associated with a field on the work order form one should click on it and it pops up the information.
In the example above Organization field corresponds to ‘oc_code’ column on ‘ae_p_pro_e’ table in the database. In soap the same column name is used for that field with the following naming convention.
- All underscores are replaced with upper case of the character following the underscore.
- Camel case naming convention is used for soap.
Example : ‘oc_code’ is replaced by ‘ocCode’ in soap. Similarly, a field ‘entClerk’ on soap is converted to ‘ent_clerk’ in database.
Click on the ‘raw’ tab to find the entire message sent through service. Below I will be using different colored boxes to represent different types of information used in the message. The information in the red box is related to cookies. This information helps maintain sessions. The default idle time for a session is 30 minutes. A few suggestions and information about session is the following:
- It is possible to increase the idle time for a session. For changing the idle time the AiM customer support team should be contacted.
- Increasing the session idle time too much is not a good idea because that causes two main problems. First, it leaves the system unsecured for obvious reasons. Second, a session occupies a certain amount of memory that it only releases after the session is ended. Hence, too long idle time will stop the user from creating multiple sessions because of memory issue.
- A session is only terminated if it times out or the user logs out of the system. There is a no way to reset the cookies to terminate a session.
The authentication information holds the user credential information and this is not secured. Hence, one should never use http for using AiM service. Using https does not have this problem as it uses its own secured encoding scheme.
SOAPAction is the method name called from its binding
Find by Primary Key on Work order
Open findAePProEByKeySoapBinding web service, expand and click on the Request1.
This has a question mark in it. A question mark stands for user input and must be filled out before sending back.
Now, fill in a work order in place of ‘?’ and enter the user id and password in ‘Request Properties’ as show in the figure below.
Run the web service and this returns all
In the above example the user calls findAePProEByKey method in ‘WORKMGT’ module. It requires the
element called ‘aePProEKey’.
It returns the following:
- Table name (in Yellow box)
- The columns names (in red box) with all the information that are filled out.
Write down all sub table information 1:40 to 2:16
Working with updateAePProESoapBinding
Insert a record using InsertAeHEmpESoapBinding
- Find the web service named InsetAeHEmpESoapBinding and create a new request.
- The tag <fmax:aeHEmpE> corresponds to the table. All the ‘?’ need to be replaced with values. However, if one can copy from other response and update some of the fields in the following way.
- Click the ‘-‘ sign next to tag corresponding to the table. For this example its <fmax:aeHEmpE>.
- A line appears below the tag <fmax:aeHEmpE>. Select the tag along with the line.
- Delete the selected text (that contains the line and the tag). This removes all the table related data from the web service.
- Copy the entire table information from other web service. For this example the web service we are using is updateAeHEmpESoapBinding. Click ‘-‘ next to the tag <fmax:aeHEmpE>. This will shrink the entire table data into a line that appears right below the tag.
- Select and Copy the tag along with the line. Now that all the table data is copied we want to use this for InsetAeHEmpESoapBinding to insert a record.
- Paste the entire data
- Make changes to the data according to your need.
- Entire the credentials and execute it.
Finding an employee by key:
Find by document : steps
Find all the records that were edited in last two weeks: Steps
- Go to findAeHEmpEByDocument and create a new request.
- Provide values for attributes for search and get rid of all other attributes with ‘?’.
- The output could be a list of records. Hence it always starts with <aeHEmpEList>
- The output only returns headers of each record. To find the detailed record one needs to find by primary key as shown above.
- Following is an example to deal with ‘timetype’ attribute. Here we try to find out records that has ’empType’=S, ‘active’=T and ‘time type’ = RE and ‘sqlOperator’ = ‘STARTS_WITH’. ‘RE’ stands for regular.
- To find records here employee last name contains ‘o’ add <fmax:lname value=’o’ sqlOperator=’CONTAINS’>
- Find all employee record that were created in last two weeks