Forum Discussion
SmartBear_Suppo
Alumni
16 years agoHi!
nice idea! I've made some fixes to the underlying API so that you can now do the following to "rewrite" a GET request into a POST counterpart:
This effectively transforms the GET request into a corresponding POST with corresponding Query parameters being inserted as strings in the the SOAP message. Maybe you can use this for your purposes?
Will be in upcoming nightly build..
regards!
/Ole
eviware.com
nice idea! I've made some fixes to the underlying API so that you can now do the following to "rewrite" a GET request into a POST counterpart:
def req = mockRequest
if( req.httpRequest.method != "GET" )
return
def content = req.getRequestContent()
log.info "onRequest request content = " + content
def username = req.httpRequest.getParameter( "username" )
def password = req.httpRequest.getParameter( "password" )
def xml = '''<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.example.org/sample/">
<soapenv:Header/>
<soapenv:Body>
<sam:login>
<username>''' + username + '''</username>
<password>''' + password + '''</password>
</sam:login>
</soapenv:Body>
</soapenv:Envelope>'''
req.httpRequest.method = "POST"
req.setRequestContent(xml)
req.soapAction="http://www.example.org/sample/login"
log.info req.requestContent
This effectively transforms the GET request into a corresponding POST with corresponding Query parameters being inserted as strings in the the SOAP message. Maybe you can use this for your purposes?
Will be in upcoming nightly build..
regards!
/Ole
eviware.com