3

I don't understand exactly how to send data over c# socket.send( byte[]), I mean they say I need to send 0800 (Network Management Request) for an echo test, how to convert. Please I've been programming for a while but I don't understand the instructions.

Thanks

4 Answers4

5

First of all you need to have an understanding of the ISO8583 message format. For echo test messages, in the 87 revision, your MTID should be 0800 and field 70, the Network Management Information code, should be set to 301, indicating echo test.

Building an ISO message is quite tricky. (shameless plug coming up) I have released OpenIso8583.Net, a message parser/builder for .Net which can be extended into the particular flavor of ISO you are using

John Oxley
  • 14,698
  • 18
  • 53
  • 78
1

You should first understand the spec that you're working to; I expect you have something more specific than the bare ISO8583 message spec, something that is specific about the fields required and the content. The important thing is the way you build and deblock the ISO8583 fields from to and from the message based on the bitmap that specifies which fields are present.

When I've built ISO8583 test clients in C# in the past I first put together a set of classes that could build and deblock a message bitmap. Once you have that you need some code to build and deblock your messages. These will set (or test) bits in the bitmap and then extract or insert the expected fields into a byte buffer.

Once you have this working the actual sending and receiving of the byte buffer messages is trivial.

Len Holgate
  • 21,282
  • 4
  • 45
  • 92
0
            //***************additional encoders***************
            UnicodeEncoding encoderUnicode = new UnicodeEncoding();
            UTF32Encoding encoder32 = new UTF32Encoding();
            UTF7Encoding encoder7 = new UTF7Encoding();
            UTF8Encoding encoder8 = new UTF8Encoding();
            //*************end of additionals*************

            ASCIIEncoding encoder = new ASCIIEncoding();

about the parser, do some google on iso 8583, preferably of 2003

0

Looking at the spec, it would be impossible to provide a full answer here - but to get you started, you basically need to create the various messages and send them down the pipe. As the Socket class requires an array of bytes rather than a string, you can use one of the Encoding classes to get at the raw bytes of a string. If I am reading the info correctly from Wikipedia:

byte[] echo = System.Text.Encoding.ASCII.GetBytes("0100");
socket.Send(echo);

Disclaimer: I have never had to implement ISO 8583 and the reference I looked at wasn't clear if the codes were in fact simple ASCII characters (though I am betting they are). Hopefully someone more familiar with the standard will clarify or confirm that assumption.

Goyuix
  • 23,614
  • 14
  • 84
  • 128