ISO8583 connector [1] allows you to send (produce) the ISO8583 standard messages through WSO2 ESB. There are various versions in ISO8583 standard, Here the connector is developed based on 1987 version and used jpos which is the third party library , and jposdef.xml has the field definitions of the standard ISO8583 Messages. According to the field definitions each and every ISO8583 Messages in xml format which comes from the Rest-client, will be packed and will be send to the Test-server [2]. The Test-server need to be listen on port 5010, consume the String of ISO8583 Messages and acknowledge the connector by changing the relevant response fields according to the requirements and the response ISO8583 Messages will be set into the message context in xml format.
Sample ISO8583 Connector Configuration
In order to use the ISO8583 connector, you need to download the jpos-1.9.4.jar from the http://mvnrepository.com/artifact/org.jpos/jpos/1.9.4 , download jdom-1.1.3.jar from http://mvnrepository.com/artifact/org.jdom/jdom/1.1.3 and download commons-cli-1.3.1.jar from http://mvnrepository.com/artifact/commons-cli/commons-cli/1.3. Then copy the jars to the <ESB_HOME>/repository/components/lib directory and copy the jposdef.xml file into <ESB_HOME>. The recommend ESB version is 4.9 and later .For general information on using connectors and their operations in your ESB configurations, see Using a Connector.
To use the ISO8583 connector, add the <ISO8583.init> element in your configuration before connecting with Test-server. Here the host and port are the main parameters to connect with Test-server
<
ISO8583.init
>
<
serverHost
>localhost</
serverHost
>
<
serverPort
>5010</
serverPort
>
</
ISO8583.init
>
To send the messages, use </ISO8583.sendMessage> operation and using Rest-client to send the xml format messages. In Rest-client set the header application/xml as Content-Type.
POST the body in xml format and xml format message should be in the following structure.
<
ISOMessage
>
<
data
>
<
field
id
=
"0"
>0200</
field
>
<
field
id
=
"3"
>568893</
field
>
<
field
id
=
"4"
>000000020000</
field
>
<
field
id
=
"7"
>0110563280</
field
>
<
field
id
=
"11"
>456893</
field
>
<
field
id
=
"44"
>DFGHT</
field
>
<
field
id
=
"105"
>ABCDEFGHIJ 9871236548</
field
>
</
data
>
</
ISOMessage
>
If you have done the configuration correctly with ISO8583 Connector, then you can see the log in your console.
INFO - LogMediator To: /services/ISO8583_Test, MessageID: urn:uuid:7cf953fa-8d29-4054-a144-9a44286a3bdb, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelop/"><soapenv:Body><ISOMessage>
<data>
<field id="0">0200</field>
<field id="3">568893</field>
<field id="4">000000020000</field>
<field id="7">0110563280</field>
<field id="11">456893</field>
<field id="44">DFGHT</field>
<field id="105">ABCDEFGHIJ 9871236548</field>
</data>
</ISOMessage>
In your Test-server you can see the String ISO8583 Messages (Packed Message).
0200B2200000001000000000000000800000568893000000020000011056328045689305DFGHT021ABCDEFGHIJ 9871236548
Now the Test-server acknowledge the connector, the response messages will be set into the message context as following.
<ISOMessage><data><field id="0">0210</field><field id="3">568893</field><field id="4">000000020000</field><field id="7">0110563280</field><field id="11">456893</field><field id="39">00</field><field id="44">DFGHT</field><field id="105">ABCDEFGHIJ 9871236548</field></data></ISOMessage></soapenv:Body></soapenv:Envelope>
Note : If you need to see the above log in your ESB console, then you have to put the following in your configuration.
<log level="full"/>
In following post, we will see different kind of scenarios with WSO2 ESB ISO8583 Inbound and Connector.
References
https://docs.wso2.com/display/ESBCONNECTORS/Configuring+ISO8583+Connector+Operation
http://www.iso.org/iso/home.html
https://en.wikipedia.org/wiki/ISO_8583
http://www.codeproject.com/Articles/100084/Introduction-to-ISO-8583
https://docs.wso2.com/display/ESBCONNECTORS/Writing+a+Connector
https://milindaperera.blogspot.com/2014/10/create-wso2-esb-connector-for-absolute.html
http://chanakaindrajith.blogspot.com/2014/04/getting-started-with-wso2-esb-connectors.html
No comments:
Post a Comment