Forum Discussion

RobWithers's avatar
RobWithers
Occasional Contributor
12 years ago

stripping default '?' from soap requests

Is there a way to turn this off?

Thanks,
Rob

3 Replies

  • Liberty_Informa's avatar
    Liberty_Informa
    Regular Contributor
    Go To File -> Preferences and select checkbox highlighted in the below picture. However I am not sure how can we completely turn off (?) from the payload.
  • RobWithers's avatar
    RobWithers
    Occasional Contributor
    So I am looking into using the DOMBuilder to parse the xml then process the nodes, removing the '?'. All of this works. However, when I attempt to set the "Request" back into the testStep ("WsdlTestRequestStep"), it does not stick.

    Here's my code:

    for(testStep in testRunner.getTestCase().getTestStepList()) {
    if(testStep.getClass().getSimpleName().equalsIgnoreCase("WsdlTestRequestStep")) {
    myRequest = testStep.getPropertyValue("Request")
    reader = new StringReader(myRequest)
    doc = DOMBuilder.parse(reader)
    root = doc.documentElement
    use(DOMCategory) {
    items = root.'**'.findAll{ it.text() == '?' }
    items.each{ item ->
    item.value = ''
    }
    }
    myRequest = XmlUtil.serialize(root)
    log.info(myRequest)
    testStep.setPropertyValue("Request", myRequest)
    }
    }


    How can I set the request of a testStep with my new xml?

    Thanks,
    Rob
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hey Rob,

    Sorry for the slow response. Normally we don't actually support groovy, but I tried anyway and didn't manage to reproduce this issue. When using your groovy code snippet, I found that it correctly saves the request and actually uses the new, stripped request. (However, it does seem to break requests that use more than one parameter, deleting all parameters except for the last one).

    Is this still an issue for you? Let me know and I'll see if I can help.

    Regards,

    Arian
    SmartBear Sweden