WaveyDavey
14 years agoOccasional Contributor
[Resolved] Simple Assert needed
My REST service returns this xml :
<root>
<error>200</error>
<errorText>OK</errorText>
<data>
<id>215901</id>
<core_range>844</core_range>
<core_number>1112233</core_number>
<destination>07899999999</destination>
<mapper>rest.api.AutoMap.Done</mapper>
<status>mapped</status>
<comment/>
<mapping_attempts>6</mapping_attempts>
<log><![CDATA[Auto map log = lots of stuff ]]></log>
<reset/>
</data>
<loggedIn>1</loggedIn>
<yourSession>k8vm88govpc69o7q5m00kluj41</yourSession>
</root>
How do I add an assertion that <mapping_attempts> is between 1 and 20 ? I guess I need to get the node, and cast to int, but I have no idea how !
David
<root>
<error>200</error>
<errorText>OK</errorText>
<data>
<id>215901</id>
<core_range>844</core_range>
<core_number>1112233</core_number>
<destination>07899999999</destination>
<mapper>rest.api.AutoMap.Done</mapper>
<status>mapped</status>
<comment/>
<mapping_attempts>6</mapping_attempts>
<log><![CDATA[Auto map log = lots of stuff ]]></log>
<reset/>
</data>
<loggedIn>1</loggedIn>
<yourSession>k8vm88govpc69o7q5m00kluj41</yourSession>
</root>
How do I add an assertion that <mapping_attempts> is between 1 and 20 ? I guess I need to get the node, and cast to int, but I have no idea how !
David