Forum Discussion

npdavenport's avatar
npdavenport
New Contributor
13 years ago

Writing to Request Panel

I have a situation where I am generating the xml in my soap request dynamically because the data being received is dynamic through a data source. I created a java library so I could make use of reusable code across my projects. My xml is being generated as a string. While I could just write the result into a test case property and then use the property in the request panel, I want to display the entire generated xml in the request panel instead. Doing this will give the end use the ability to see the request easily if/when they so desire. After searching I am still unable to figure out how to clear the auto generated xml from the wsdl and replace it with my own xml. Thanks in advance!

4 Replies

  • Thank you for the link. Unfortunately that is not helpful. That is how I am currently doing it. What I really want is the request panel to show the xml, not the property; this allows the user to see the xml as normal except it is generated from the library rather than by SoapUI.

    Instead of:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" >
    <soap:Header/>
    <soap:Body>
    ${#TestCase#certifyXML}
    </soap:Body>
    </soap:Envelope>

    I want the entire xml that I am generating to appear in this panel.

    I think I am close with using new com.eviware.soapui.support.GroovyUtils(context) and setting the request context: context.requestContent. However, I can't figure out how to communicate directly with the specific test case and update the request.
  • Got it. I can access the request property through this: testRunner.getTestCase().getTestStepByName("TestStepName").getProperty('Request').setValue(xmlValue)