Hi!
I have to test response XML which contains normal data and also another XML encoded in Base64. This inline XML contains data I have to check.
For example, I receive:
=====================================
<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="
http://www.example.com/">
<ns1:SendSynRequest>
<ns1:session>c0a83eda30d5ff54450fa0864f8da4efb1d2c3930f2b</ns1:session>
<ns1:reportName>NIS_NM_esamiba</ns1:reportName>
<ns1:XMLs>
<ns1:XML>
<ns1:XMLname>NMR kodi:</ns1:XMLname>
<ns1:XMLvalue>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxOSVNfTk1fZXNhbWliYSB4
bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6
bm9OYW1lc3BhY2VTY2hlbWFMb2NhdGlvbj0iTklTX05NX2VzYW1pYmFfaW5wdXQueHNkIj4NCiAg
PG5vZG9rbHVfbWFrc2F0YWppPg0KICAgIDxub2Rva2x1X21ha3NhdGFqcz4NCiAgICAgIDxubXJf
a29kcz4wOTAxODAxMDYyMDwvbm1yX2tvZHM+DQogICAgPC9ub2Rva2x1X21ha3NhdGFqcz4NCiAg
ICA8bm9kb2tsdV9tYWtzYXRhanM+DQogICAgICA8bm1yX2tvZHM+MjYxMjMzMTA1MzE8L25tcl9r
b2RzPg0KICAgIDwvbm9kb2tsdV9tYWtzYXRhanM+DQogICAgPG5vZG9rbHVfbWFrc2F0YWpzPg0K
ICAgICAgPG5tcl9rb2RzPjE2MDQ3NDExMjg1PC9ubXJfa29kcz4NCiAgICA8L25vZG9rbHVfbWFr
c2F0YWpzPg0KICA8L25vZG9rbHVfbWFrc2F0YWppPg0KPC9OSVNfTk1fZXNhbWliYT4NCg==</ns1:XMLvalue>
</ns1:XML>
</ns1:XMLs>
</ns1:SendSynRequest>
</soap:Body>
</soap:Envelope>
======================================
//inline XML decoded:
<?xml version="1.0" encoding="UTF-8"?>
<NIS_NM_esamiba xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="NIS_NM_esamiba_input.xsd">
<nodoklu_maksataji>
<nodoklu_maksatajs>
<nmr_kods>09018010620</nmr_kods>
</nodoklu_maksatajs>
<nodoklu_maksatajs>
<nmr_kods>26123310531</nmr_kods>
</nodoklu_maksatajs>
<nodoklu_maksatajs>
<nmr_kods>16047411285</nmr_kods>
</nodoklu_maksatajs>
</nodoklu_maksataji>
</NIS_NM_esamiba>
-------------------------------------------------------
I can easily check if session (or XMLname or reportName) match expected values, but I can't figure out how to check value of nmr_kods which is in encoded XML (here ir simple decoder
http://www.hcidata.info/base64.htm ).
I've tried to write Groovy script and I managed to get value in Base64, but i failed to decode and parse it.
Thanks in advance, hope this topic will be useful for people in the future.
Best regards,
Jevgenijs