Service Virtualization

 View Only
  • 1.  Extract the Raw swift message in the IBM Native Listen step

    Posted Oct 11, 2019 02:04 AM
    Hi Team,

    we are using DevTest v10.3.0.

    Is there a way to extract the raw swift message in IBM Native Listen step  in the VSM.

    i tried extracting the Request using the below lines:
    import com.itko.util.ParameterList;
    String Request = lisa_vse_request.getBodyText();
    testExec.setStateValue("Request",Request);

    But the Request has come in xml format though the request injected is swift message.( attached the ITR screen shots).

    Please suggest here.

    Thanks in Advance.


  • 2.  RE: Extract the Raw swift message in the IBM Native Listen step

    Broadcom Employee
    Posted Oct 11, 2019 02:22 AM
    HI Sumalatha
              You could use the following method that returns a byte[]

    getBodyBytes()

    -Sankar

    ------------------------------
    Sankar Natarajan
    Service Virtualization Product Engineering Team
    Broadcom
    ------------------------------



  • 3.  RE: Extract the Raw swift message in the IBM Native Listen step

    Posted Oct 11, 2019 02:57 AM
      |   view attached
    Hi Natarajan,

    getBodyBytes() returns a byte message as attached.

    The request injected to the VS is of swift message format something like below:
    {1:F01ANZBNZ20BXXX2122377814}{2:O1031703190913WPACNZ20DXXX00230904661909131704N}

    Requirement is to extract this swift message from IBM MQ Native step and store it to a property for further manipulation of the request.



    Thanks



  • 4.  RE: Extract the Raw swift message in the IBM Native Listen step

    Posted Oct 11, 2019 04:53 AM
    In Addition to this, if the VS is created using IBM Websphere MQ step (deprecated), by using "extract payload and properties messages" Filter in Listen step, able to filter the swift message properly.
    Attached the Screenshots for the same.

    Question is : using  IBM Native step, how can the swift message request be stored into the property in IBM Native Listen step.



  • 5.  RE: Extract the Raw swift message in the IBM Native Listen step
    Best Answer

    Posted Oct 12, 2019 09:49 AM
    Hi,

    The data protocol handlers in your Listen step will transform the body of your incoming request step by step into an XML representation of the data in your request.

    In your case the Swift DPH will transfrom the original swift message into an XML representation (with the main objective to create arguments from the resulting XML tags)

    If you want to grab the original request body then you need to do this immediately after the Transport Protocol Handler has turned the incoming request into a request object.
    So, add a Request Data Copier DPH as the very first DPH and copy the request body to a property.

    ------------------------------
    Cheers,
    Danny
    ------------------------------



  • 6.  RE: Extract the Raw swift message in the IBM Native Listen step

    Posted Oct 14, 2019 02:32 AM
    Hi Danny,

    Thank you for your suggestion. It worked.