Forum Discussion
tpowers
15 years agoOccasional Contributor
Might either of you have suggestions for reading properties from a request formatted like this?
This is the way it comes from the client.... I cannot alter it (other than the ns name).
Currently I have this which returns null...
Any help is greatly appreciated...
-Tim
MODIFIED POST
Thanks to M McDonald for the solution to my issue above, I needed to declare a 'temp' ns above for use in the script.
This is the way it comes from the client.... I cannot alter it (other than the ns name).
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<RunScript xmlns="http://tempuri.org/">
<optionObject>
<EntityID>5</EntityID>
<Facility>98</Facility>
<Forms>.....
Currently I have this which returns null...
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder( mockRequest.requestContent )
context.EntityID = holder.getNodeValue( "//EntityID")
context.EntityID = holder.getNodeValue( "//Facility")
Any help is greatly appreciated...
-Tim
MODIFIED POST
Thanks to M McDonald for the solution to my issue above, I needed to declare a 'temp' ns above for use in the script.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( xml )
holder.declareNamespace( 'ns', 'http://tempuri.org/') //add this declaration
log.info holder.getNodeValue( "//ns:Facility") //add 'ns' prefix
log.info holder.getNodeValue( "//ns:EntityID")
Related Content
- 3 years agoIuliaVascan
- 2 years agoBouzouki
Recent Discussions
- 5 days agoemoya