uCosminexus Application Server, Web Service Development Guide
You can use the javax.xml.ws.WebFault annotation to customize the mapping of the return values.
The following figure shows an example of customization with the javax.xml.ws.WebFault annotation:
Figure 16-26 Example of customization with the javax.xml.ws.WebFault annotation
You use the name element to customize the local name of the global element mapped from the fault bean.
Specify the name element using one-byte alphanumeric characters and underscore (_). If other characters are specified, the operations might not function properly (error message is not output).
You specify the targetNamespace element to customize the name space of the global element mapped from the fault bean.
In the targetNamespace element, the http:// or urn: protocol is specified as a name space. The following name space formats and strings can be specified:
Table 16-25 Conditions for the strings that can be coded in the name space (javax.xml.ws.WebFault)
| No. | Conditions | Examples of invalid strings | Operation when an invalid string is specified |
|---|---|---|---|
| 1 | Strings using only one-byte alphanumeric characters (0 to 9, A to Z, a to z) | http://Hitachi.com http://133.145.224.19/ http://[1080:2C14;D30:BA04:275:806:270C:418A]/ |
The operations might not function properly (error message is not displayed). |
| 2 | Strings other than Java reserved words | http://hitachi.com/abstract | The operations might not function properly. |
| 3 | Strings that do not begin with numeric characters | http://1hitachi.com |
The faultBean element specifies the class name of the generated fault bean using a fully qualified name. If the wrapper exception class has the getFaultInfo method that returns the javax.xml.ws.WebFault annotation and the fault bean, the fault bean is not generated even if the faultBean element is specified.
The precautions for specifying the faultBean element are as follows:
Specify the messageName element when customizing the fault message name (the name attribute of the wsdl:message element referenced from the wsdl:fault element) corresponding to the wrapper exception class.
Specify the messageName element with one- byte alphanumeric characters and underscore (_). If you specify the messageName element with any other character, the operation is not guaranteed (no error message is output).
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.