how to replace encoding information in xml
Hi everyone,
I use this to replace redundancy using XML.
event>requestfilter.afterrequest
def content = context.httpResponse.responseContent
log.info content
content = content.replaceAll( "<!\\[CDATA\\[", "" )
content = content.replaceAll( "]]>", "" )
content = content.replaceAll("<\\?xml version=\"1.0\" encoding=\"iso-8859-9\"\\?>","")
log.info content
context.httpResponse.responseContent = content
Code replace CDATA but does not replace("<\\?xml version=\"1.0\" encoding=\"iso-8859-9\"\\?>","")
can you help me please...
xml response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:alisverisBaslatResponse SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="WsOtomotiv">
<return xsi:type="xsd:string"><![CDATA[<?xml version="1.0" encoding="iso-8859-9"?><XmlString><SONUC>1</SONUC><DURUM>0</DURUM><ACIKLAMA>Basarili Alisveris</ACIKLAMA><TRXNO>20061701011000001710</TRXNO><INDIRIM><YENIAVTUTAR>500,00</YENIAVTUTAR><DKID></DKID><DKAD></DKAD><DKKP></DKKP><DIPINDTUTAR>0,00</DIPINDTUTAR><URUNINDIRIMLIST><URUNINDIRIM><UKID>20200</UKID><UKAD>DIVAN</UKAD><UKKP>60</UKKP><URUNKOD>A</URUNKOD><UINDTUTAR>500,00</UINDTUTAR></URUNINDIRIM></URUNINDIRIMLIST></INDIRIM><KPAROPUAN>35,00</KPAROPUAN><TPAROPUAN>35,00</TPAROPUAN><HARCAMADURUM>1</HARCAMADURUM><IZINDURUM>1</IZINDURUM><KAYITDURUM>2</KAYITDURUM><VERDEKOD>18259294</VERDEKOD><ISYERIPUAN>0,00</ISYERIPUAN><ADSOYAD></ADSOYAD><URUNINDIRIMTARIHLIST><URUNINDIRIMTARIH><UKID>20200</UKID><UKAD>DIVAN</UKAD><BASLANGIC_TARIHI>18-01-2013</BASLANGIC_TARIHI><BITIS_TARIHI>30-12-2033</BITIS_TARIHI></URUNINDIRIMTARIH></URUNINDIRIMTARIHLIST></XmlString>]]></return>
</ns1:alisverisBaslatResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Hi hrn83au , I found your support case, looks like our Support team has a possible solution and now they are waiting on some files from you to make sure it works with your project. Please continue the investigation with the Support team and it would be great if you shared the final solution here with us too🙂 Thank you!