Customizing error messages
In AS4 Microservice,
you can customize the eb:Error
in the ebMS headers of an AS4
message.
The error messages that can be customized are available in the
asFaultService.xml. You can modify the error message through a
provisioning update request. You can use Sterling B2B Integrator message fabric adapter or a
JMS client to send the provisioning update request to the
MEG.PROVISIONER
. However, you cannot modify the message parameters
that are indicated by {0}
. Those parameters are predefined and must not
be customized.
When the error details, such as the shortDescription
,
description
, errorDetail
are changed, the changes
are visible in the corresponding eb:Error
response.
Update provision request for asFaultService XML
The update provision request for asFaultService.xml is as
follows:
Important: The queue that is specified in the
replyTo
field must be configured before sending the update
request.<ns13:ProvisioningRequest
xmlns:ns13="http://www.ibm.com/b2b/apiint/messagedefinitions/messages/xml/provisioning">
<Headers SequenceTotal="0" SequenceNumber="0"
SentFrom="MEG.PROVISIONER" replyTo="test" RedeliveryFlag="false"
priority="4" MessageID="320acda4-1706-463c-bc65-12345678931"
MessageType="com.ibm.b2b.apiint.messagedefinitions.messages.xml.provisioning.ProvisioningRequest"
MessageVersion="0" />
<Header>
<action>UPDATE</action>
<subtype>DEPLOYABLE</subtype>
<id>AS4FaultMessageService</id>
<type>com.ibm.b2b.comms.as4.common.fault.CustFaultMessageServiceImpl</type>
</Header>
<Body>
<p:ExtFaultMessages tns:deployable="true" tns:id="AS4IFaultMessageServiceTest" xmlns:p="http://www.ibm.com/b2b/apiint/messagedefinitions/messages/xml/extFaultMsg"
xmlns:tns="http://www.ibm.com/b2b/apiint/messagedefinitions/messages/xml/exchange/commons"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/b2b/apiint/messagedefinitions/messages/xml/extFaultMsg ExtFaultMessages.xsd ">
<tns:name>AS4ExtFaultService</tns:name>
<tns:description>description</tns:description>
<ExtFaultMessage errCode="BCXAS40001E">
<shortDescription>DestLookUpErr</shortDescription>
<description>Error occurred while looking up destination.</description>
<errorDetail>Unable to send the business document object to the delivery destination {0} because the destination was not found.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40002E">
<shortDescription>UserExitErr</shortDescription>
<description>UserExitManagementServiceFailure.</description>
<errorDetail>Error occurred while executing UserExitManagementService.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40003E">
<shortDescription>ConfigLookUpErr</shortDescription>
<description>Error occurred while unpacking the message.</description>
<errorDetail>Error occurred while looking up the configuration details for the incoming message.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40004E">
<shortDescription>ProcessingErr</shortDescription>
<description>Error processing receipt</description>
<errorDetail>Error encountered while processing receipt.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40005E">
<shortDescription>ProcessingErr</shortDescription>
<description>Error response received for the business document.</description>
<errorDetail>An error response was received for the business document sent to the application.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40006E">
<shortDescription>TimeOutErr</shortDescription>
<description>Timed out, while waiting for bussiness reponse.</description>
<errorDetail>Time out occurred while waiting for a response from the application.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40007E">
<shortDescription>ProcessingErr</shortDescription>
<description>Message validation failed.</description>
<errorDetail>Error occurred while validating the incoming message.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40008E">
<shortDescription>BackendDeliveryErr</shortDescription>
<description>Error occurred while delivering a document to the application.</description>
<errorDetail>Error occurred while delivering the document with Transaction ID {0}.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40009E">
<shortDescription>ProcessingErr</shortDescription>
<description>Error while reading the incoming message</description>
<errorDetail>Error occurred while reading or parsing the incoming ebMS message.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40010E">
<shortDescription>AuthErr</shortDescription>
<description>Unauthorized Credential</description>
<errorDetail>The credentials used in the incoming message are not authorized</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40011E">
<shortDescription>ProcessingErr</shortDescription>
<description>WSSecurity element not found.</description>
<errorDetail>No WSSecurity header with actor ebms found in the inbound message.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40012E">
<shortDescription>UserNameTokenErr</shortDescription>
<description>User name token not found.</description>
<errorDetail>UsernameToken is specified as mandatory in the Conformance policy but is absent in the inbound message.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40013E">
<shortDescription>ProcessingErr</shortDescription>
<description>Message not signed</description>
<errorDetail>Message was not signed but was expecting signed messages.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40014E">
<shortDescription>SignProcessingErr</shortDescription>
<description>Signature verification Failed</description>
<errorDetail>Signature verification failed for incoming message.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40015E">
<shortDescription>RMProcessingErr</shortDescription>
<description>Reliable Messaging is unsupported by the Receiver</description>
<errorDetail>Reliable messaging was specified but it is not supported by the receiver.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40016E">
<shortDescription>AnonymousTPErr</shortDescription>
<description>Signature of the anonymous partner cannot be authenticated.</description>
<errorDetail>Signature of the anonymous partner cannot be authenticated either because of a missing certificate or an unsupported certificate type.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40017E">
<shortDescription>ProcessingErr</shortDescription>
<description>Unsupported Compression Algorithm.</description>
<errorDetail>The compression algorithm specified is not supported.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40018E">
<shortDescription>ProcessingErr</shortDescription>
<description>Mime type is missing.</description>
<errorDetail>The MIME type is missing for an attachment.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40019E">
<shortDescription>ProcessingErr</shortDescription>
<description>Content length not valid.</description>
<errorDetail>The content length value specified in the request is greater than the maximum limit.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40020E">
<shortDescription>UserNameTokenErr</shortDescription>
<description>UsernameToken not valid.</description>
<errorDetail>The UsernameToken specified is not complete. Either the User name or Password (or both) are missing</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40021E">
<shortDescription>UserNameTokenErr</shortDescription>
<description>Incorrect Password type specified in Usernametoken.</description>
<errorDetail>The password type of the Usernametoken in the inbound message does not match the configured value.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40022E">
<shortDescription>UserNameTokenErr</shortDescription>
<description>Created Timestamp Missing.</description>
<errorDetail>Created Timestamp is mandatory for UsernameToken with PasswordDigest.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40023E">
<shortDescription>ProcessingErr</shortDescription>
<description>SOAP envelope is missing.</description>
<errorDetail>SOAP envelope is missing in incoming message.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40024E">
<shortDescription>ProcessingErr</shortDescription>
<description>Security Element is missing.</description>
<errorDetail>Security Element is missing in incoming message.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40025E">
<shortDescription>ProcessingErr</shortDescription>
<description>Security Element not valid.</description>
<errorDetail>Security Element neither has UserNameToken Element nor Signature Element.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40026E">
<shortDescription>AnonymousTPErr</shortDescription>
<description>Anonymous user cannot be authenticated.</description>
<errorDetail>Anonymous user cannot be authenticated because of missing security header in the incoming message.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40027E">
<shortDescription>ProcessingErr</shortDescription>
<description>Certificate lookup failed.</description>
<errorDetail>Certificate lookup failed while attempting to extract certificate with alias {0}.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40028E">
<shortDescription>ProcessingErr</shortDescription>
<description>Signature verification failed.</description>
<errorDetail>Signature verification failed with alias {0}.</errorDetail>
</ExtFaultMessage>
<ExtFaultMessage errCode="BCXAS40029E">
<shortDescription>ProcessingErr</shortDescription>
<description>Internal error occured.</description>
<errorDetail>Internal error occured while processing message.</errorDetail>
</ExtFaultMessage>
</p:ExtFaultMessages>
</Body>
</ns13:ProvisioningRequest>