Service Virtualization

Expand all | Collapse all

How to specify binary Request Delimiters

Jump to Best Answer
  • 1.  How to specify binary Request Delimiters

    Posted 05-17-2017 06:02 AM

    Hi all,

    We have TCP protocol with messages delimiter by binary patterns delimiters.

    Messages are terminated with 2 consecutive bytes (in hexa): 0xFF 0xEF

     

    How to specify (synthax...) this in the VSI Recorder "Characters:" field ?

     TCP Request delimiter

     

    I didn't find such concrete example in the documentation for binary delimiters.

     

    Thanks.

     

    Best Regards

    Philippe.



  • 2.  Re: How to specify binary Request Delimiters

    Posted 05-17-2017 07:40 PM

    Since you are dealing with binary formats (outside the range of ASCII characters), you will most likely need to create a custom TCP delimiter.  Sorry, I do not have an example TCP delimiter class to share but this link might help in getting an understanding of the format:  How to create a custom request/response delimiter in CA DevTest  

     

    Out of curiosity, does the incoming request payload contain a 4 byte record descriptor word (RDW) that gives the length of the request payload? If so, your custom delimiter can find the length of the payload by parsing the RDW.

    e.g, using a LIST of the bytes (ba),

    byte[] length = new byte[4];
    length[0] = 0x00; // if mainframe ba[0] probablycontains a 0x80 so make it 0x00
    length[1] = ba[1];
    length[2] = ba[2];
    length[3] = ba[3];

    int theRcdLength = java.nio.ByteBuffer.wrap( length ).getInt();

     

    Or, if looping over the byte list, you could do some conversion to compare for the 0xFF and 0xEF.  

    e.g.,  

    if ( bytes.get(i).intValue() == 0xff ) {

        mEndOfRequest = i + 2;
        mStartOfNextRequest = 1;
        return true;
    }



  • 3.  Re: How to specify binary Request Delimiters

    Posted 05-18-2017 04:31 AM

    Thanks Joel.

     So I understand that I cannot specify binary Request Delimiters from the Recorder dialog, only ASCII.

     To answer your curiosity, No, in my case the incoming payload (unfortunately) doesn't contain a header with the request payload length, it is the 2 bytes  binary sequence which mark the end of incoming request payload.

     

    Do have a clue why Request Delimiters are restricted to ASCII character in the Recorder UI ? I don't see any technical limitation stepping from parsing char to binary ( an ASCII char is a binary ...).

    Do you think it makes sense I create an Idea for this evolution ? 



  • 4.  Re: How to specify binary Request Delimiters
    Best Answer

    Posted 05-18-2017 10:46 AM

    Yes, correct. So far as I know, there is no way to express a binary delimiter in the OOTB recorder delimiter panel.  The How To link provides a sample you can model off if you need to roll your own delimiter.

     

    You should always take advantage of the option to add your idea. There may be others in the community that need similar capabilities.  If you add an idea, have your colleagues review and vote on the idea to increase visibility with the product team. 



  • 5.  Re: How to specify binary Request Delimiters

    Posted 05-23-2017 08:33 AM