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!