Skip Navigation Links | |
Exit Print View | |
Oracle Java CAPS SWIFT Message Library User's Guide Java CAPS Documentation |
Overview of SWIFT Message Libraries
Installing the SWIFT Message Library
To Increase the Heap Size for GlassFish
To Increase the Heap Size for NetBeans
Using the SWIFT Message Library
Message Library and Collaboration Locations in NetBeans
SWIFT Message Library JAR Files
Using Message Validation Features
Validation Collaboration Definitions
Message Format Validation Rules (MFVR)
In Collaboration Validation Methods
Calling the Validation Methods in your Collaboration
About the SWIFT MX Validation Sample
SWIFT Correlation Repository Sample
Linking the Domain Name and Direction to a Color
Using the SCR for Monitoring Flows
Using the Viewer for Monitoring Transactions
Using the Viewer to Repair Messages
BICDirService Method Operation
To Update BICPlusBAN Information
BICPlusIBAN Validation Method Definitions
Using SWIFT FIN-Based Funds OTDs
SWIFT Message Library Funds Features
This section explains the SWIFT Message Library validation error files and messages.
There are separate error messages and reporting mechanisms for each type of validation performed by a Service. You can control the amount of debugging information in the error messages you receive by using the debug flags as parameters when you call the command() method. The library’s error parser provides the following debug levels:
Regular Information: Gives general information, and if an error occurs, the path to the node or piece of data that caused the error.
Debug: Gives all of the node information generated by the parse, that is, each field and subfield.
Parser Debug: Combines the debug level with information regarding just what the parser is matching, and the data being used. In general, you only need to use this level for situations where the error cannot be determined using the other levels because of the quantity of data. This level gives the exact location and nature of the failure.
Error message file output appears at the end of any message that generates an error.
The available debug level flags are:
A or a: Enables the abbreviation of path names. This reduces the path output when you are printing to a Regular Information set.
D or d: Enables Debug (mid-level) debugging. If enabled, this generates more debug data than the Regular Information level, but less than the Parser Debug level.
I or i: Enables Regular Information level debugging.
L or l: Enables saving and display of the last successfully parsed node. When a parse has failed, this information is the last item printed by the current root node.
P or p: Enables the Parser Debug-level information. If enabled, this generates the maximum information about what the internal parser is doing.
Using the Debug Level flags, you can configure the debugging information you receive by setting the appropriate debug parameter in the OTD’s command() method. For example, to set the error message level to the Regular Information level (I flag), with abbreviations turned on (A flag), you would set command() with the parameters A and I. You can do this from the Collaboration Editor’s Business Rules Designer as displayed below.
Figure 1 Setting the debug level using the Business Rules Designer
This produces the following Java code (this example uses the mt_202 Validation Collaboration:
mt_202_1.command( "AI" );
Calling command() enables any of the debug functions presented as a parameter. For more information, see the SWIFT Message Library Javadoc.
An example of a regular information-level parse error (cannot find a required field) is:
at 0: com.stc.swift.runtime.SwiftUnmarshalException: mt_103.Mt_103: 0: Failed to parse required child(Data).
An example of a parse error with the debug level enabled (cannot find a required field) is:
at 146: null: com.stc.swift.runtime.SwiftUnmarshalException: mt_543.Mt_543.Data.GeneralInformation.FunctionOfTheMessage: 146: Failed to parse required child(String2).
Given this path to the data, you can determine where in the message the parser failed by looking at:
The SWIFT User Handbook
The structure of the OTD in the NetBeans OTD Editor
The Javadoc for the OTD
See MFVR Errors for MFVR-specific error information. For more detailed error information, see Error Message Information.
The following example shows error message output at the parse debug level:
[main] PARSE - Swift: matchDelimSkip("{1:") --> true. [main] PARSE - Swift: getData("F|A|L") --> "F". [main] DEBUG - Swift: mt_502.Mt_502.BasicHeader.AppIdentifier: 3: Mapped data("F"). [main] DEBUG - Swift: mt_502.Mt_502.BasicHeader.AppIdentifier: 3: Mapped rep[0]. [main] PARSE - Swift: getData(charSet, 2, 2) --> "01". [main] DEBUG - Swift: mt_502.Mt_502.BasicHeader.ServiceIdentifier: 4: The following is the last field successfully parsed the 4th 22a: [main] PARSE - Swift: matchDelimSkip("22H::") --> true. [main] PARSE - Swift: getData(charSet, 4, 4) --> "PAYM". [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String3: 218: Mapped data("PAYM"). [main] PARSE - Swift: matchDelimSkip("//") --> true. [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String3: 218: Mapped rep[0]. [main] PARSE - Swift: getData(charSet, 4, 4) --> "APMT". [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String5: 224: Mapped data("APMT"). [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String5: 224: Mapped rep[0]. [main] PARSE - Swift: matchDelimSkip(" :") --> true. [main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH: 213: Mapped rep[0].
The message goes on for several more lines, not indicating any error. Then the parser is looking for any more 22a’s, F or H, and does not find one. See the following example:
[main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator[3]: 159: Mapped rep[3]. [main] PARSE - Swift: matchDelimSkip("22F::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorF: 231: Failed to find BeginDelimiter("22F::"). [main] PARSE - Swift: matchDelimSkip("22H::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH: 231: Failed to find BeginDelimiter("22H::").
The parser then looks for a 98a either option A|B|C as follows:
[main] PARSE - Swift: matchDelimSkip("98A::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.DateTime[0].DateTimeA: 231: Failed to find BeginDelimiter("98A::"). [main] PARSE - Swift: matchDelimSkip("98B::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.DateTime[0].DateTimeB: 231: Failed to find BeginDelimiter("98B::"). [main] PARSE - Swift: matchDelimSkip("98C::") --> false. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.DateTime[0].DateTimeC: 231: Failed to find BeginDelimiter("98C::").
The parser finds no repetitions, which does not fit in the required range of 1 to 3 as described in the following example, so at this point, the parser fails, because no expected repetitions were found:
[main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails: 231: Failed to match minimum repititions[ 1 < 0 <= 3 ]. [main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails: 145: Failed to parse required child(DateTime). [main] PARSE - Swift: mt_502.Mt_502.Data: 145: Failed to match minimum repititions[ 1 < 0 <= 1 ]. [main] PARSE - Swift: mt_502.Mt_502.Data: 73: Failed to parse required child(OrderDetails). [main] PARSE - Swift: mt_502.Mt_502: 67: Failed to match minimum repititions[ 1 < 0 <= 1 ]. [main] PARSE - Swift: mt_502.Mt_502: 0: Failed to parse required child(Data). [main] LAST - Swift: Last match: mt_502.Mt_502. Exception in thread "main" at 0: null: com.stc. swift.runtime.SwiftUnmarshalException: mt_502.Mt_502: 0: Failed to parse required child(Data). at com.stc.swift.runtime.SwiftOtdRep. throwExcept(SwiftOtdRep.java:1977) at com.stc.swift.runtime.SwiftOtdRep. parseChildren(SwiftOtdRep.java:1577) at com.stc.swift.runtime.SwiftOtdRep. parse(SwiftOtdRep.java:1486) at com.stc.swift.runtime.SwiftOtdRep. unmarshal(SwiftOtdRep.java:1339)