Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to extract values from req and paste it in res

hello, we have req res in xml format also req are changing and as per that response should change with values. we need to store req res and also as per req has no of items tags in xml same should paste in res we are using parasoft virtualize. any java code etc ?

Comments

  • Ireneusz Szmigiel
    Ireneusz Szmigiel Posts: 227 ✭✭✭
    edited September 2017

    meghana
    your question is not clear to me, however I will try to answer it. If you are asking about something else, then provide better description.
    Find XML DataBank for request:
    Right click on responder, then Add Output > Section Incoming Request > Payload > XML DataBank.
    Selected variable from request should be then available in parametrization of response.
    Also keep in mind that you have to send at least one request with expected XML to extract value from request.

  • meghana
    meghana Posts: 8

    I have copied incoming request in write file ..but as per request nodes I need ot make changes in res like suppose we have 2 items tags in req then in res also it should be same I need java code for the same

  • Ireneusz Szmigiel
    Ireneusz Szmigiel Posts: 227 ✭✭✭

    Hi meghan,
    please share your pva with us.

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited October 2017

    I do not recommend using the file system to store incoming request. Doing so is not thread safe and won't have good performance. Instead, you should chain a Data Bank tool to the incoming request. In the Response tab in the responder, you can reference Data Bank columns directly. You can also access Data Bank columns via scripting, if you were to script all or part of the response.

  • meghana
    meghana Posts: 8

    yes but we are editing whole res as per req...so its not only maping of few parameters...do we copy whole chunk from req to res ?

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    You can store an entire message in a data bank. Just select the root node for the extraction.

  • meghana
    meghana Posts: 8

    but if we extract whole element it is coming in braces and values and not in xml format

  • Ireneusz Szmigiel
    Ireneusz Szmigiel Posts: 227 ✭✭✭
    edited October 2017

    Hi meghana

    could you paste here example of request and expected data which you want to use in your response?
    How it looks like?
    What do you want to get, to be able to paste value/s in response?
    Ireneusz Szmigiel