Contributions
Re: Passing a value in a Groovy request and catching the response
Hey, Thanks for the response. I checked in the custom properties what the request value is and it is ${x}. So it seems that when my script runs, he does not use the values I provide. Also my script fails if I don't run the SOAP request manually first. But if I then run the script, it will always take the result of the manual SOAP request execution. It's like the script doesn't trigger a new request but just keeps working on the manually run request. My SOAP request looks like this (left the SOAP header out for privacy reasons): <soapenv:Header/> <soapenv:Body> <tran:RetrieveEquipmentModelDetail> <!--Optional:--> <tran:equipmentModelIds> <!--Zero or more repetitions:--> <equ:EquipmentModelId> <!--Optional:--> <equ:Id>${x}</equ:Id> </equ:EquipmentModelId> </tran:equipmentModelIds> </tran:RetrieveEquipmentModelDetail> </soapenv:Body> </soapenv:Envelope> My script is this: context.x = "000000000099007809" def response = context.expand( '${RetrieveEquipmentModelDetail#Response}') log.info response There is not other step involved. It's just the SOAP request and a Groovy script.3.6KViews0likes0CommentsRe: Passing a value in a Groovy request and catching the response
Didn't work yet. I turned the groovy code into this: context.x = "000000000009006087" def request = context.expand( '${RetrieveEquipmentModelDetail#Request}') log.info request.toString() def response = context.expand( '${RetrieveEquipmentModelDetail#Response}') log.info responseSAPxml.toString() The request shows that the context.x value is indeed inserted in the request. Also, I tried actually entering the value manually and running the request and then it returns the correct response but it does not happen when I do it in my code. I think the request is being sentbut in the catching of the response something goes wrong. It's always a blank reponse as if the value in the request was blank. It doesn't feel like I am catching the response from the request.3.7KViews0likes0CommentsPassing a value in a Groovy request and catching the response
Hey, I am really having trouble with this simple groovy script. I have a SOAP service that takes a single parameter and I just want to pass the parameter as a variable and catch the response. The request outputs the correct structure with the value I passed but the response is always empty. I passed the parameter in the SOAP request as ${x} and wrote some code like this : def durp = context.x = "000000000009006087" def request = context.expand( '${RetrieveEquipmentModelDetail#Request}') log.info request.toString() //log.info context.toString() def response = context.expand( '${$request#Response}') //log.info context.toString() log.info response.toString()3.8KViews1like5Comments