Service Virtualization

Expand all | Collapse all

How to filter the Multi-part content in the incoming request in VS

Jump to Best Answer
  • 1.  How to filter the Multi-part content in the incoming request in VS

    Posted 11-19-2018 01:43 AM

    Hi,

     

    Did anyone come across the requirement to filter the values of the multipart contents. We a requirement where there are multiples files sent in the multipart content. One file contains the request parmeters and the same parameters are sent in the response. Here is a sample of the multipart request:I have to filter values of the file called metadataValuesInUploadFileAsAttachment.txt

     

    ------=_Part_11_1192773366.1542608795654
    Content-Type: text/plain; charset=Cp1252;
    name=metadataValuesInUploadFileAsAttachment.txt
    Content-Transfer-Encoding: binary
    Content-Disposition: form-data; name="metadataValuesInUploadFileAsAttachment.txt"; filename="metadataValuesInUploadFileAsAttachment.txt"

    {
    "Store_Information.Store_City":"",
    "Store_Information.Store_State":"",
    "Store_Information.Store_ZipCode":"046541201",
    "Store_Information.Store_GeoCode":"12312",
    "Transaction_Information.Transaction_ID":""
    }

    ------=_Part_11_1192773366.1542608795654
    Content-Type: application/pdf; name=2018_08_23_15_15_183_Doc1.pdf.pdf
    Content-Transfer-Encoding: binary
    Content-Disposition: form-data; name="2018_08_23_15_15_183_Doc1.pdf.pdf"; filename="2018_08_23_15_15_183_Doc1.pdf.pdf"

    %PDF-1.6
    %����
    7 0 obj
    <</Linearized 1/L 156493/O 9/E 152492/N 1/T 156202/H [ 461 142]>>
    endobj

    14 0 obj
    <</DecodeParms<</Columns 5/Predictor 12>>/Filter/FlateDecode/ID[<0C3A33DFC5F7EA49BFCE33B63A768D1D><80271A7B5894C947BD0DB4D4550815A0>]/Index[7 12]/Info 6 0 R/Length 60/Prev 156203/Root 8 0 R/Size 19/Type/XRef/W[1 3 1]>>stream
    h�bbd` ``b``� � � �Q
    ,� f�



  • 2.  Re: How to filter the Multi-part content in the incoming request in VS
    Best Answer

    Posted 11-19-2018 12:20 PM

    Can you try using "Create Property based on Surrounding values" Filter and then use that property in VSI response. Hope this helps, if not please open a support case.

     

    Documentation on the above filter is available at Create Property Based on Surrounding Values - DevTest Solutions - 10.3 - CA Technologies Documentation .



  • 3.  Re: How to filter the Multi-part content in the incoming request in VS

    Posted 11-19-2018 04:48 PM

    Hi Prema,

     

    Thanks for your response. It did work. Not sure why I did not think about it.

    Anyways thank you again.