We have a middleware REST service that is taking an XML response from one endpoint and passing it as a parameter to another.
This works in Karate using the following syntax:
Given url endpointURL
And param requestInput = '<?xml version="1.0" ?> <sampleResponseXML> <sampleField>COLA</sampleField> </sampleResponseXML>'
When method get
Then status 200
This gives the proper expected response.
I am looking to read the xml parameter from a file but it seems the escape parameters get messy and I have been unsuccessful with this. The endpoint is created with several extra escape characters and not formatted properly. Is there any method to possibly accomplish this?
Given url endpointURL
And param requestInput = read('param.xml')
When method get
Then status 200