uCosminexus Application Server, Web Service Development Guide

[Contents][Glossary][Index][Back][Next]

15.1.7 Mapping the fault to the exception class

This subsection describes the mapping of the WSDL fault (name attribute of the wsdl:message element referenced from the wsdl:fault element) to the exception class.

Organization of this subsection
(1) Mapping
(2) Conditions for the fault name
(3) Number of parts of the messages referenced from the fault
(4) Handling when the same operation fault references the same message

(1) Mapping

When the cjwsimport command is executed, the WSDL fault is mapped to the Java type in accordance with the JAX-WS 2.2 specifications. The following figure shows an example of mapping:

Figure 15-9 Example of mapping the fault to the exception class

[Figure]

(2) Conditions for the fault name

In the fault name, you can code a string that fulfills all the conditions described in the following table. However, when customizing with the binding declaration, you can code the strings that can be used as xsd:NCName type of the XML Schema specification.

Table 15-13 Conditions for strings that can be coded in the fault name

No. Conditions Examples of invalid strings Operations when invalid strings are specified
1 Strings using only one-byte alphanumeric characters (0 to 9, A to Z, a to z) and underscore (_) Hitachi_fault The operation might not function properly (error message is not displayed).
2 Strings that do not begin with numeric characters 1User_fault An error message is output in the standard error output and log and the processing ends (KDJW51029-E).

(3) Number of parts of the messages referenced from the fault

The fault can reference messages with only 1 part coded. The following table describes the number of parts of the messages referenced from the fault and the operations:

Table 15-14 Number of parts of the messages referenced from the fault and the operations

No. Number of coding Operations
1 0 An error message is output in the standard error output and log and the processing ends (KDJW51025-E).
2 1 Terminates normally.
3 2 or more An error message is output in the standard error output and log and the processing continues (KDJW51025-E).

(4) Handling when the same operation fault references the same message

When many different operation faults reference the same message, all the faults are handled as the same fault. Therefore, when mapping to Java, a common wrapper exception class is assumed. The following figure shows an example:

Figure 15-10 Example of mapping when the same operation fault references the same message

[Figure]

The following table describes the relationship between the operation coding the fault and the messages referenced from the fault:

Table 15-15 Relationship between the operation coding the fault and the referenced messages

No. Operation coding the fault Messages referenced from the fault Handling of the fault
1 Different Same Handled as the same fault.
2 Different Handled as a different fault.
3 Same Same An error message is output in the standard error output and log and the processing ends (KDJW51026-E).
4 Different Handled as a different fault.