Please help me!

瀏覽次數:21 次
跳到第一則未讀訊息

Nguyễn Sinh Thành

未讀,
2006年12月6日 凌晨3:29:322006/12/6
收件者:jpos-...@googlegroups.com
Hi all.
I'm building a payment gateway (PGW). I have some problems.
The PGW illustrated following:
-----------------  3                  2  -----------------                      --------------------
| BankGW |  ------------------------ | VDCGW | <--------------------| Oracle DB |
-----------------                          -----------------                      --------------------
                                                   | 4                                     /\
                                                   |                                        |
                                                   | 1                                     |
                                           -------------------                              |
                                           | VDCClient | ------------------------------
                                           -------------------
BankGW = Bank Gateway
VDCGW = VDC Gateway
VDCClient = VDC Client
1. VDCClient sends 1311 ISOMsgs to VDCGW
2. VDCGW sends these 1311 ISOMsgs to BankGW
3. BankGW responses 1310 ISOMsgs back to VDCGW
4. VDCGW responses these 1310 ISOMsgs back to VDCClient
 
I coded for the PGW.
Steps 1 and 2 are successful but I don't receive response messages.
Please help me.
Thank you very much.
Mohinh.doc
BankGateWay.java
VDCGateWay.java
BankDispatcher.java
Gatewaymanagement.java

Mark Salter

未讀,
2006年12月6日 凌晨4:59:072006/12/6
收件者:jpos-...@googlegroups.com
Nguyễn Sinh Thành wrote:

> BankGW = Bank Gateway
> VDCGW = VDC Gateway
> VDCClient = VDC Client
> 1. VDCClient sends 1311 ISOMsgs to VDCGW
> 2. VDCGW sends these 1311 ISOMsgs to BankGW
> 3. BankGW responses 1310 ISOMsgs back to VDCGW
> 4. VDCGW responses these 1310 ISOMsgs back to VDCClient
>
> I coded for the PGW.
> Steps 1 and 2 are successful but I don't receive response messages.

I feel it might be a bit early to claim success based upon a send...
...What does the Bank have to say about your passed on request message?

If they didn't respond, it is likely they didn't like the request
(structurally) enough to even give back a rejection response code.

Do the Bank have any form of sign-on message to identify you or to
set-up keys for later messages? If so, have these been exchanged correctly?

--
Mark

Nguyễn Sinh Thành

未讀,
2006年12月6日 晚上8:50:292006/12/6
收件者:jpos-...@googlegroups.com
Here is PGW's log files:
VDCClient.log
VDCServer.log
BankGW_VDCGW.log
VDCGW_BankGW.log
VDCClient.log
VDCServer.log
VDCGW_BankGW.log
BankGW_VDCGW.log

Nguyễn Sinh Thành

未讀,
2006年12月6日 晚上11:15:532006/12/6
收件者:jpos-...@googlegroups.com
Hi Mark.
I read your thread on http://thread.gmane.org/gmane.comp.java.jpos.devel/539/focus=540. Can you send me some sample code (client-router-to-host, simple-client-router-to-host)?
Thank you very much.

 

Mark Salter

未讀,
2006年12月6日 晚上11:54:222006/12/6
收件者:jpos-...@googlegroups.com
Nguyễn Sinh Thành wrote:
> Hi Mark.
> I read your thread
> on http://thread.gmane.org/gmane.comp.java.jpos.devel/539/focus=540. Can
> you send me some sample code (client-router-to-host,
> simple-client-router-to-host)?
I remember my frustration in this thread, not seeing the blindingly
'obvious', my wasn't I raw just that short time ago!

If you read through this thread, you will find my illustrative code was
flawed and that jpos-EE provided a much slicker solution.

Once this was discovered, I deleted the source from the files section
banishing them to the deepest depths of my trash, never to surface again.

I don't have this code any more, sorry.

--
Mark

Mark Salter

未讀,
2006年12月7日 凌晨12:17:142006/12/7
收件者:jpos-...@googlegroups.com
This is a lot of data that simply illustrates that it isn't working.

On glancing through your code it seems very confused. May I suggest you
take a copy of each source file,go through it, removing all of the
commented out code.

I think your problem might be a very simple one...

Can you change the form of your String comparison from :-

if (mti == "1300")...

into :-

if (mti.equals("1300")) ...

Although if this theory is correct, the message "Unknown MTI" should be
appearing in the log.

Also can you add the line:-


Logger.log(new LogEvent(this, "BankDispatcher", "Processing"));

as the first line in the BankDispatcher.java process(ISOSource source,
ISOMsg m) method. Just to check we are getting there.

--
Mark

ThanhNS

未讀,
2006年12月20日 凌晨1:43:052006/12/20
收件者:jPOS Users
Hi all.
I'm building a payment gateway (PGW). I have some problems.
The PGW illustrated following:
----------------- 3 2 -----------------
--------------------
| BankGW | ------------------------ | VDCGW | <--------------------|
Oracle DB |
----------------- -----------------
--------------------
| 4
/\
|
|
| 1
|
-------------------
|
| VDCClient |
------------------------------
-------------------
BankGW = Bank Gateway
VDCGW = VDC Gateway
VDCClient = VDC Client
1. VDCClient reads Oracle DB (ex. VDCMSG table contains fields' ISOMsg)
and converts to 1311 ISOMsg, then sends 1311 ISOMsgs to VDCGW.
2. VDCGW sends these 1311 ISOMsgs to BankGW.
3. BankGW responses 1310 ISOMsgs back to VDCGW.
4. VDCGW responses these 1310 ISOMsgs back to VDCClient.

Steps 1 to 4 are successful.
Now I want to insert transactions information (step 3) into database:
After BankGW sends back to VDCGW, it has to insert fields' ISOMsg into
OracleDB (ex. BankMSG).

Mark Salter

未讀,
2006年12月20日 上午8:04:202006/12/20
收件者:jPOS Users
ThanhNS wrote:

> Steps 1 to 4 are successful.

Fantastic, what did you change to get it working, anything you can
share here?

> Now I want to insert transactions information (step 3) into database:
> After BankGW sends back to VDCGW, it has to insert fields' ISOMsg into
> OracleDB (ex. BankMSG).

Be careful what data you save from the messages. There are strict
rules around any storage transaction specific data.

Don't save anything specific to the Card and you might be ok.

What specifically do you need help in achieving?

--
Mark

ThanhNS

未讀,
2006年12月20日 晚上9:16:242006/12/20
收件者:jPOS Users
Thank Mark.

Mark Salter viết:


> ThanhNS wrote:
>
> > Steps 1 to 4 are successful.
> Fantastic, what did you change to get it working, anything you can
> share here?
>

Fantastic? In BankDispatcher I add code piece following:
GWServer = BankGateway.GWServer;
channel = GWServer.getLastConnectedISOChannel();
channel.send(m);

In VDCDispatcher I add code piece following:
ISORequest r = new ISORequest(m);
VDCGateway.gwMux.queue(r);
ISOMsg response = r.getResponse(timeout);
if (response != null)
source.send(response);

> > Now I want to insert transactions information (step 3) into database:
> > After BankGW sends back to VDCGW, it has to insert fields' ISOMsg into
> > OracleDB (ex. BankMSG).
> Be careful what data you save from the messages. There are strict
> rules around any storage transaction specific data.
>
> Don't save anything specific to the Card and you might be ok.
>
> What specifically do you need help in achieving?
>
> --
> Mark

Example, response 1310 has fields: MTI, processingcode,
datetime_transaction, trace_audit_number, datetime_local_transaction,
functioncode, acquiring_institution_id_code,
forwarding_institution_id_code, panextend.
I want to insert these fields into BankMSG table(msgid, MTI,
processingcode, datetime_transaction, trace_audit_number,
datetime_local_transaction, functioncode,
acquiring_institution_id_code, forwarding_institution_id_code,
panextend).

ThanhNS

未讀,
2006年12月20日 晚上9:31:002006/12/20
收件者:jPOS Users
Dear Mark.
I wrote a class (FormatMag) to help me formating messages from,
inserting messages into database. In this class, I have a method
*insertBankMsg(ISOMsg m)* to insert message m into DB.

In BankDispatcher I add code piece following:
GWServer = BankGateway.GWServer;
channel = GWServer.getLastConnectedISOChannel();
channel.send(m);

FormatMsg.insertBankMsg(m);

But in BankMsg table, number of messages is less than number of sent
back messages.
Can you suggest me?
Thank you very much.

Mark Salter

未讀,
2006年12月21日 凌晨3:44:152006/12/21
收件者:jPOS Users

ThanhNS wrote:

It is hard to guess...

... but you need to determine which messages are missing to start the
investigation in why your expected numbers do not match the actual.

What key are you using for each record, could you be getting records be
overwritten?
Can your insertBankMsg(m) method fail, and if it does does it let you
know?
Are you seeing (logging something) if any Exceptions are being thrown?

--
Mark

Nguyễn Sinh Thành

未讀,
2006年12月21日 凌晨4:44:132006/12/21
收件者:jpos-...@googlegroups.com


On 12/21/06, Mark Salter <marks...@dsl.pipex.com> wrote:


ThanhNS wrote:

> Dear Mark.
> I wrote a class (FormatMag) to help me formating messages from,
> inserting messages into database. In this class, I have a method
> *insertBankMsg(ISOMsg m)* to insert message m into DB.
>
> In BankDispatcher I add code piece following:
> GWServer = BankGateway.GWServer ;
> channel = GWServer.getLastConnectedISOChannel();
> channel.send(m);
> FormatMsg.insertBankMsg(m);
>
> But in BankMsg table, number of messages is less than number of sent
> back messages.
> Can you suggest me?
It is hard to guess...

... but you need to determine which messages are missing to start the
investigation in why your expected numbers do not match the actual.

What key are you using for each record, could you be getting records be
overwritten?
 
primary key that I used is auto increment.

 
Can your insertBankMsg(m) method fail, and if it does does it let you
know?
Are you seeing (logging something) if any Exceptions are being thrown?

--
Mark
 
No exception is thrown.
 
Here is code for insertBankMsg(ISOMsg m):
public void insertBankMsg(ISOMsg m) {
        //        System.out.println("Processing Insert to BANKMSG Table");
        String mti = null;
        String pan = null;
        String processingcode = null;
        String amount = null;
        String auditnumber = null;
        String localdt = null;
        String datesettlement = null;
        String posdatacode = null;
        String functioncode = null;
        String acquirerid = null;
        String fiidcode = null;
        String panextend = null;
        String actioncode = null;
        String userdata = null;
        String originaldata = null;
        String supplierid = null;
        String status = null;
 
        try {
            mti = m.getMTI();
            processingcode = m.getString(3);
            auditnumber = m.getString(11);
            localdt = m.getString(12);
            functioncode = m.getString (24);
            acquirerid = m.getString(32);
            fiidcode = m.getString(33);
            panextend = m.getString(34);
            status = "1";
 
            CallableStatement cstmt = conn.prepareCall(
                    "{call PKG_BANKMSG.ins_bank_msg_connection(?, ?, ?, ?, ?, ?, ?, ?, ?)}");
            cstmt.setInt(1, Integer.parseInt(mti));
            cstmt.setInt(2, Integer.parseInt(processingcode));
            cstmt.setInt(3, Integer.parseInt(auditnumber));
            cstmt.setString(4, localdt);
            cstmt.setInt(5, Integer.parseInt (functioncode));
            cstmt.setInt(6, Integer.parseInt(acquirerid));
            cstmt.setInt(7, Integer.parseInt(fiidcode));
            cstmt.setString(8, panextend);
            cstmt.setInt(9, Integer.parseInt (status));
            cstmt.executeUpdate();
        } catch (ISOException ex) {
        } catch (SQLException ex) {
            /** @todo Handle this exception */
        }
    }

Mark Salter

未讀,
2006年12月21日 清晨6:06:382006/12/21
收件者:jPOS Users

Nguyễn Sinh Thành wrote:

System.out.println("ISOException caught...");
ex.printStackTrace(System.out);


> } catch (SQLException ex) {
> /** @todo Handle this exception */

System.out.println("ISOException caught...");
ex.printStackTrace(System.out);
> }
> }
>
Exceptions could be being thrown, your code is silently absorbing any
that do occur.

Add a call to logging or as a quick fix, write a message to System.out
within each of your catch sections.

--
Mark

chhil

未讀,
2006年12月21日 晚上10:10:122006/12/21
收件者:jpos-...@googlegroups.com
Just a thought...would it be better to try writing the message to the db befoe sending it which may be a blocking call and fail. Plus if the send fails there will always be a record of the message in the db which you could either have in memory or read from the db to perform appropriate reversal or any form of logic...

-chhil

On 12/21/06, Mark Salter <marks...@dsl.pipex.com> wrote:
>             cstmt.setInt (2, Integer.parseInt(processingcode));

ThanhNS

未讀,
2006年12月21日 晚上11:03:372006/12/21
收件者:jPOS Users
Thank Mark.
Exceptions are thrown following:
-----------------------------------------------------------
SQLException caught...
java.sql.SQLException: ORA-01000: maximum open cursors exceeded
ORA-06512: at "BANKPGW.PKG_BANKMSG", line 16
ORA-06512: at line 1

at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742)
at
oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:211)
at
oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1159)
at
oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)
at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3367)
at
oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:4244)
at
com.vss1.ebillgateway.bank.FormatMsg.insertBankMsg(FormatMsg.java:484)
=====> cstmt.executeUpdate();
at
com.vss1.ebillgateway.BankDispatcher.process(BankDispatcher.java:116)
=====> formatMsg.insertBankMsg(m);
at org.jpos.iso.ISOServer$Session.run(ISOServer.java:126)
at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:100)
-------------------------------------------------------
I always received 299 inserted messages.

Nguyễn Sinh Thành

未讀,
2006年12月21日 晚上11:09:462006/12/21
收件者:jPOS Users
Here is packages that I used:
 
PKG_COMMON:
create or replace PACKAGE "PKG_COMMON" AS
TYPE CUR_TYPE IS REF CURSOR ;
END;
 
PKG_BANKMSG:
create or replace PACKAGE "PKG_BANKMSG" AS
 
procedure ins_bank_msg_connection(
        vMTI in number,
        vProcessingCode in number,
        vAuditNumber in number,
        vLocalDT in varchar2,
        vFunctionCode in number,
        vAcquirerId in number,
        vFIIDCode in number,
        vPANExtend in varchar2,
        vStatus in number
);
END;
 
PKG_BANKMSG BODY:
create or replace PACKAGE BODY "PKG_BANKMSG" AS
 
procedure ins_bank_msg_connection(
        vMTI in number,
        vProcessingCode in number,
        vAuditNumber in number,
        vLocalDT in varchar2,
        vFunctionCode in number,
        vAcquirerId in number,
        vFIIDCode in number,
        vPANExtend in varchar2,
        vStatus in number
)
is
begin
INSERT INTO BANKMSG(MSGID, MTI, PROCESSINGCODE, AUDITNUMBER, LOCALDT, FUNCTIONCODE, ACQUIRERID, FIIDCODE, PANEXTEND, STATUS)
VALUES(BANKMSGID.nextVal, vMTI, vProcessingCode, vAuditNumber, vLocalDT, vFunctionCode, vAcquirerId, vFIIDCode, vPANExtend, vStatus);
commit;
end ins_bank_msg_connection;
END;

ThanhNS

未讀,
2006年12月21日 晚上11:34:242006/12/21
收件者:jPOS Users
I solved the problem.
I don't close CallableStatement --> maximum open cursors exceeded

回覆所有人
回覆作者
轉寄
0 則新訊息