Define Fault Mapping in Orchestrated Integrations

You can define fault mappings in integrations. This mapping transforms a Database Adapter fault when used as a target into the source format defined in its WSDL. You add the Database Adapter to a scope action in an orchestrated integration and select this fault in the Fault Handler part of the scope action.

A serviceInvocationError fault mapping is defined in the WSDL

In the mapper, the elements of serviceInvocationError provide details about the runtime fault:
  • type: The type of fault.

  • title: The title of the fault.

  • detail: Information about the fault cause.

  • errorCode: Information about the fault code.

  • remedialAction: How to fix the fault.

This fault structure is populated during runtime when any exception occurs in an outbound invocation (for example, a primary key violation).

If using the adapter in a map data integration, only reason, detail, and errorCode are available in the mapper.

Assume an exception (for example, NumberFormatException) occurs in an invoke (outbound) adapter. Exceptions are mapped in fault mappings and returned to the source format as defined in its WSDL contract. In this use case, a stored procedure is used that accepts only an integer type. If you invoke the adapter by passing a noninteger value, Oracle Integration reports the fault back to you.

To define fault mapping:

  1. Create connections for the SOAP Adapter and the Database adapter.
  2. Create an orchestrated integration.
  3. Drag the SOAP Adapter into the integration canvas as a trigger.
    The Adapter Endpoint Configuration wizard is displayed.
  4. Configure the SOAP Adapter (for this example, named s1).
  5. From the Actions palette, drag a Scope action below the SOAP Adapter.
  6. From the Invokes palette, drag the Database Adapter inside the scope.
    Description of db_fault_hanlder1.png follows
    Description of the illustration db_fault_hanlder1.png
    The Adapter Endpoint Configuration wizard is displayed.
  7. Select an operation to invoke any stored procedure that accepts only an integer as the input parameter (for this example, the adapter is named db1).
  8. Define mappings for the Database Adapter.
    Description of db_fault_hanlder2.png follows
    Description of the illustration db_fault_hanlder2.png
  9. In the integration canvas, click Reposition and move the s1 map inside the scope.
  10. Define mappings for s1.
    Description of db_fault_hanlder3.png follows
    Description of the illustration db_fault_hanlder3.png
  11. Click the Fault Handler part and select Oracle Database : serviceInvocationError db1.
    Description of db_fault_hanlder4.png follows
    Description of the illustration db_fault_hanlder4.png
  12. From the Actions palette, drag a Fault Return action inside the Fault Handler part.
  13. Define fault mappings.
    Description of db_fault_hanlder5.png follows
    Description of the illustration db_fault_hanlder5.png
    The root element for the fault is serviceInvocationError. The fault includes other elements that carry the fault details: type, title, detail, errorCode, and remedialAction. The detail element carries information about the fault cause. The remedialAction element suggests the action to fix the fault.
  14. From the Actions menu menu, select Tracking and define the tracking field.
  15. Activate and invoke the integration by passing a string value (that is, a noninteger value) from the SOAP UI.
    <typ:getOrganization>
       <typ:partyId>test</typ:partyId>
    </typ:getOrganization>

    The fault response returns information similar to the following:

    <nstrgmpr:code>XSD object conversion error</nstrgmpr:code>
      <nstrgmpr:message>An error occurred while parsing XML representing a Java object.</nstrgmpr:message>
    <nstrgmpr:severity>Unable to convert the XSD element DATA_IN whose SQL type is INTEGER and JDBC type is INTEGER. Cause: java.lang.NumberFormatException: For input string: "test"</nstrgmpr:severity>
    <nstrgmpr:detail>
    <nstrgmpr:code>serviceInvocationError</nstrgmpr:code>
    <nstrgmpr:message>Check to ensure that the XML data describing the object matches the definition of the element in the XSD.</nstrgmpr:message>
    <nstrgmpr:detail>
    <nstrgmpr:code/>
    <nstrgmpr:message/>
    <nstrgmpr:severity/>
    <nstrgmpr:detail/>
    </nstrgmpr:detail>
    <nstrgmpr:detail xsi:type="nstrgmpr:ServiceErrorMessage" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    </nstrgmpr:detail>
    </nstrgmpr:ServiceErrorMessage>
    </detail>