Sepasoft MES Module Suite
SOAP Faults
SOAP Faults are supported by the Web Services module.
Example SOAP Fault
SOAP Faults are returned in industry-standard XML format. Example:
Example SOAP Fault
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>com.inductiveautomation.ignition.licensing.common.LicensingException: CDKey '4G9BM9' not found</faultstring> <detail> <ns1:fault xmlns:ns1="http://webservices.inductiveautomation.com"> <ns1:responseCode> <ns1:code>5</ns1:code> <ns1:desc>Rejected CDKey</ns1:desc> </ns1:responseCode> </ns1:fault> <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">ip-10-232-151-57.us-west-1.compute.internal</ns2:hostname> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope>
Example SOAP Fault Implementation
The following example steps demonstrate implementing a simple SOAP fault script in the Sepasoft Web Services module:
- Create a new SOAP Provider in the MES Web Services module (in the Project section of Ignition Designer).
- Add a new Operation named "fault_test".
- In Types under "fault_test", add a new member named "user_input" of type Integer.
- In Types under "fault_testResponse" add new member named "out" of type String.
In the Script area, paste the following:
XML |
|
This script takes an integer input. If the input is less than 5, it successfully returns. If it is greater than or equal to 5, it raises a fault.
- Save your new SOAP Provider.
- Create a new SOAP Consumer in the MES Web Services module (in the Project section of Ignition Designer).
- Copy the WSDL URL from the SOAP Provider to the SOAP Consumer.
- Copy the script and set "user_input" to 4.
- Execute the script. It should return a dictionary.
- Change "user_input" to 5.
- Execute the script. It should throw an exception with your faultString message in the exception body.
Sepasoft MES Module Suite