0

So now I'm building a ISO8583 Payment Gateway application. This application is a client-server application that can act as a client or server. In this case, I'm handling the client side of the application.

At first, I connected the (client)app to a external server. I was sending inquiry message and it ran well (returning success message). Then, i'm trying to run this app as both client and server (run 2 apps and set my ip as ip host), one as client and the other one as a server. I'm sending inquiry message and it keeps returning response code 67 (other error). Meanwhile it's succeed when I run the app as client only.

I don't know if it helps but here's the inquiry method

 /// <summary>
    /// Send Inquiry Message
    /// </summary>
    private void SendInquiryMessage()
    {
        var requestMsg = new Iso8583Message(200);
        DateTime transmissionDate = DateTime.Now;
        requestMsg.Fields.Add(7, string.Format("{0}{1}",
            string.Format("{0:00}{1:00}", transmissionDate.Month, transmissionDate.Day),
            string.Format("{0:00}{1:00}{2:00}", transmissionDate.Hour,
                transmissionDate.Minute, transmissionDate.Second)));
        requestMsg.Fields.Add(11, _sequencer.Increment().ToString());
        requestMsg.Fields.Add((int)ISO8583ProtocolFields.PROCESSING_CODE, "341019");
        requestMsg.Fields.Add((int)ISO8583ProtocolFields.ADDITIONAL_DATA_61, "5271720012002010802012");

        #region Send 0200
        SendRequestHandlerCtrl sndCtrl = _client.SendExpectingResponse(requestMsg, 1000, true, null);
        sndCtrl.WaitCompletion(); // Wait send completion.
        if (!sndCtrl.Successful)
        {
            Console.WriteLine(string.Format("Client: unsuccessful request # {0} ({1}.",
                _sequencer.CurrentValue(), sndCtrl.Message));
            if (sndCtrl.Error != null)
                Console.WriteLine(sndCtrl.Error);
        }
        else
        {
            sndCtrl.Request.WaitResponse();

            if (sndCtrl.Request.IsExpired)
                _expiredRequests++;
            else
                _requestsCnt++;
        }

        latestInquiryMessage = sndCtrl.Request.ReceivedMessage as Iso8583Message;

        Console.WriteLine(latestInquiryMessage.Fields[39].Value);

        #endregion

    }

Anyone know what the problem is? What I could possibly miss?

Thank you!

paulfah
  • 113
  • 1
  • 3
  • 16

1 Answers1

0

I don't know which specific ISO-8583 implementation you are attempting to write to but a couple guesses based on what I do see or do not see and what your actual question is. It seems especially odd that it works when it communicating with the remote server as client but not as both. Where is your communications configuration?

This points to your TCP/IP configuration and my guess is that you are attempting to listen and communicate on perhaps the same port so are not truly completing the TCP/IP handshake. While I believe you technically can listen on a port and communicate out it for a different process I think it unnecessarily complicates things.

So my guess is that what is happening and is your problem is that you are attempting to communicate with yourself, are maybe not getting fully connected and instead of saying "91 - Issuer Not Available" or "96 - System error" it is giving you the odd "67 other error" as it may not have been able to actually send it.

Do you have trace, or have you watched the connectivity with netstat -a 1 or even better Wireshark if you do not have trace to verify that you are getting fully established?

CRSouser
  • 658
  • 9
  • 25