Forum Discussion
Richie
Apologies for the delay.
What I want to get is the Request which contains the Soap Envelope inside is the Soap Body and inside this is the payload message Its the payload message inside the Soap Body I want to save off to a file.
I have tried the following...
def req = new XmlHolder(messageExchange.requestContent)
def req = new XmlHolder(mockRequest.requestContent)
def req = new XmlHolder(context.request)
def req = new XmlSlurper(messageExchange.requestContent)
def req = new XmlSlurper(mockRequest.requestContent)
def req = new XmlSlurper(context.request)
...but I get either an error or null returned.
Richie
OK, an update.
I have been able to get hold of the Request i.e. the SOAP Envelope using the following...
def request = mockRequest.getRequestContent()
Now I need to extract the payload inside the SOAP Body. That's what I need help on now.
- richie4 years agoCommunity HeroHey Admins,
I think i've found a fix for this.
I will post later, however, forgive me but im gonna ask the question again just to be sure. You want the payload from the soapbody but from the request NOT the response returned from the mock service? How are you building the request body initially? I'm just wondering why you want request when youre building the request body....??
Ta
Rich- Admins4 years agoOccasional Contributor
I can confirm I want the Payload inside the SOAP Body for the Request. I have a application that sends the Request to the Mock Service and as part of my Unit Testing I want to compare the Payload with my expected results.
- richie4 years agoCommunity HeroHey Admins,
Are you still looking to extract the payload from the soapbody container tag once the request has been submitted?
Apologies, i couldnt find this post to answer. I did put a bit of groovy together (essentially using the replaceAll() method).
If you still need this i'll chuck that groovy together....its not pretty and is just a sequential strip out of the xml content you dont want....but it does do what you asked for.....if i understood correctly!
Ta
Rich
Related Content
Recent Discussions
- 17 hours agoKLWallace
- 7 days agoruchisingh