Guest User

Untitled

a guest
Dec 24th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.28 KB | None | 0 0
  1.             def responseXml = post( body: postBody )
  2.            
  3.             println "Response Body: ${responseXml.text}"   
  4.         // nothing
  5.             println "Response: ${responseXml}"         
  6.         //Response: 53051001id.successPASSresult.matchID LocatedWhen did .. etc...
  7.         //  this is essentially the XML response, but with no tags
  8.             println "Response.response: ${responseXml.response}"
  9.         // nothing
  10.  
  11.             assert responseXml instanceof groovy.util.slurpersupport.NodeChild
  12.         // true
  13.  
  14.             responseXml.response.questions.question.each { println "Question: ${it.prompt}"
  15.         // nothing.. this is the proper node hierarchy
  16.  
  17.             def output = new StreamingMarkupBuilder().bind { mkp.yield responseXml }
  18.             println output as String
  19.         // outputs the XML as originally received, with tags
  20.  
  21. // why can't I parse it???
  22.  
  23.             println "Response Type: ${responseXml.class.type.name}"
  24.         // nothing
  25.             println "Response Type: ${responseXml.type}"
  26.         // nothing
  27.             println "Response Type: ${responseXml.type.name}"
  28.         // nothing
  29.             println "Response Type: ${responseXml.class.type.name}"
  30.         // nothing
  31.             println "Response Type: ${responseXml.class}"
  32.         // nothing
  33.         // ... for gods sake how do i just get the type?
  34. }
Add Comment
Please, Sign In to add comment