8.2.8 Acquiring Error Information
If an error occurs at the request-destination service component, the HCSC server, or the SOAP engine, acquire the error information and take corrective action according to the information. For details about how to send an error, see the contents about troubleshooting during the execution of a Web Service (SOAP communication), in the manual Cosminexus Service Platform System Setup and Operation Guide.
- Organization of this subsection
- (1) Service requester-side installation example
- (2) Error information (SOAPFault) format
(1) Service requester-side installation example
The error acquisition method differs depending on the type of SOAP Communication Infrastructure.
(a) When the SOAP Communication Infrastructure provided by Cosminexus is used
When the SOAP Communication Infrastructure provided by Cosminexus is used, catch the CSCMsgServerFaultException object and acquire the SOAP Fault error information.
To acquire the error information, the following must be installed on the service requester side:
...
} catch (CSCMsgServerFaultException e) {
System.err.println("Exception ErrorMessage = "
+ e.getErrorMessage() );
System.err.println("Exception ErrorCode = "
+ e.getErrorCode() );
System.err.println("Exception ProcessInstanceID = "
+ e.getProcessInstanceID() );
System.err.println("Exception FaultCode = "
+ e.getCscmsgFaultCode() );
System.err.println("Exception FaultString = "
+ e.getCscmsgFaultString() );
System.err.println("Exception FaultActor = "
+ e.getCscmsgFaultActor() );
System.err.println("Exception FaultDetails = "
+ new String(e.getCscmsgFaultDetail(), "UTF-8"));
System.err.println("Exception FaultName = "
+ e.getFaultName() );
}
... |
Each method is explained below.
getErrorMessage- Explanation
- Acquires error messages.
- Use this method for acquiring the contents of the following exceptions:
- Exceptions detected inside HCSC-Messaging
- Faults from a service component or business process
- Format
- public java.lang.String getErrorMessage()
getErrorCode- Explanation
- Acquires error codes.
- Use this method for acquiring the error codes corresponding to the following exceptions:
- Exceptions detected inside HCSC-Messaging
- Faults from a service component or business process
- Format
- public java.lang.String getErrorCode()
getProcessInstanceID- Explanation
- Acquires business process instance IDs.
- Format
- public String getProcessInstanceID()
getCscmsgFaultCode- Explanation
- Acquires FaultCode information from a service component (Web services), business process, or custom adapter.
- Format
- public java.lang.String getCscmsgFaultCode()
getCscmsgFaultString- Explanation
- Acquires FaultString information from a service component (Web Services), business process, or custom adapter.
- Format
- public java.lang.String getCscmsgFaultString()
getCscmsgFaultActor- Explanation
- Acquires FaultActor information from a service component (Web Services), business process, or custom adapter.
- Format
- public java.lang.String getCscmsgFaultActor()
getCscmsgFaultDetail- Explanation
- Acquires Detail information from a service component (Web Services), business process, or custom adapter.
- Transfers the Detail information set up by the service component to the service requester in a byte array. Therefore, the acquired byte array must be converted to a character string.
- When there is no Detail information from the service component (Web Services), business process, or custom adapter, the response is sent through a byte array of 0 bytes (empty tag of a SOAP Message).
- Format
- public byte[] getCscmsgFaultDetail()
getFaultName- Explanation
- Acquires exception names from a service component (Web Services) or business process.
- Format
- public String getFaultName()
(b) When the SOAP Communication Infrastructure provided by Cosminexus is not used
The error information to be acquired depends on the SOAP engine installed on the service requester side.
(2) Error information (SOAPFault) format
The following table shows the error information (SOAPFault) format.
Table 8-4 Error information (SOAPFault) format
Element | Name | Content |
---|
faultcode | Fault code | Value that depends on the SOAP engine. QCName that is referenced by the message type attribute of the message part. |
faultstring | Fault string | Value that depends on the SOAP engine. Outputs KDCCP0015-E. |
faultactor | Fault generator | Value that depends on the SOAP engine. There is no value. |
detail# | Fault detail | Detail that corresponds to wsdl:fault. |
- #
- The element detail is for the error information detail. It is stored in the structure described in the following table.
Table 8-5 Error information (SOAPFault) detail
Field name | Explanation |
---|
Error (fault) from a service component, a business process, a custom adapter or for integration with HCSC server | Error (exception) detected by the HCSC server |
---|
errorMessage | Contents of the following errors:
- Error detected inside the HCSC server.
- Error from a service component, business process, or custom adapter.
|
errorCode | Error code corresponding to the following exceptions:
- Error detected inside the HCSC server.
- Error from a service component, business process, or custom adapter.
|
processInstanceID | Instance ID information of a business process A value is set when an error occurs in the business process. |
cscmsgFaultCode | FaultCode information from a service component (Web Services), business process, or custom adapter | -- |
cscmsgFaultString | FaultString information from a service component (Web Services), business process, or custom adapter | -- |
cscmsgFaultActor | FaultActor information from a service component (Web Services), business process, or custom adapter | -- |
cscmsgFaultDetail | Detail information from a service component (Web Services), business process, or custom adapter | -- |
faultName | Fault name (exception name) information from a service component (Web Services or SessionBean) or business process A value is set in the following cases:
- In the case of SOAP Fault of a user-defined exception from a service component (Web services or SessionBean)
- In the case of a fault from business process
No value is set in the case of the SOAP Fault error from Web services that define URI of targetNamespace in the SOAP Fault operation definition file. For details about the SOAP Fault operation definition file, see the manual Cosminexus Service Platform Reference. | -- |
- Legend:
- --: Not applicable