<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ClassCastExceptions with JSON response in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ClassCastExceptions-with-JSON-response/m-p/76186#M47573</link>
    <description>&lt;P&gt;By applying a regex and adding a replace all, we managed to fix the issue and were able to parse the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;JSONDeserializer&amp;lt;Map&amp;lt;String&lt;SPAN&gt;, &lt;/SPAN&gt;Object&amp;gt;&amp;gt; js = &lt;SPAN&gt;new &lt;/SPAN&gt;JSONDeserializer&amp;lt;&amp;gt;()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;pspResponseMap = js.deserialize(response.replaceAll(&lt;SPAN&gt;"[&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;p{C}]"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;)&lt;SPAN&gt;, &lt;/SPAN&gt;Map.&lt;SPAN&gt;class&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 May 2021 05:31:07 GMT</pubDate>
    <dc:creator>GeordieMc</dc:creator>
    <dc:date>2021-05-07T05:31:07Z</dc:date>
    <item>
      <title>ClassCastExceptions with JSON response</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ClassCastExceptions-with-JSON-response/m-p/76042#M47471</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if anyone has experienced ClassCastException when trying to prase a JSON response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using Postman to run some end to end testing and thought I was getting nothing in the response, but on closer inspection a JSON message is being returned, bit it is throwing a ClassCastException.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've taken the response and used it to define some test cases to iron out any exceptions, but whenever I try end-to-end testing it throws it again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 06:30:10 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ClassCastExceptions-with-JSON-response/m-p/76042#M47471</guid>
      <dc:creator>GeordieMc</dc:creator>
      <dc:date>2021-04-29T06:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: ClassCastExceptions with JSON response</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ClassCastExceptions-with-JSON-response/m-p/76062#M47484</link>
      <description>&lt;P&gt;I found the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The JSON responses&amp;nbsp;starts with "ZWNBSP" character (zero width no-break space) in the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 11:01:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ClassCastExceptions-with-JSON-response/m-p/76062#M47484</guid>
      <dc:creator>GeordieMc</dc:creator>
      <dc:date>2021-04-30T11:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: ClassCastExceptions with JSON response</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ClassCastExceptions-with-JSON-response/m-p/76186#M47573</link>
      <description>&lt;P&gt;By applying a regex and adding a replace all, we managed to fix the issue and were able to parse the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;JSONDeserializer&amp;lt;Map&amp;lt;String&lt;SPAN&gt;, &lt;/SPAN&gt;Object&amp;gt;&amp;gt; js = &lt;SPAN&gt;new &lt;/SPAN&gt;JSONDeserializer&amp;lt;&amp;gt;()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;pspResponseMap = js.deserialize(response.replaceAll(&lt;SPAN&gt;"[&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;p{C}]"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;)&lt;SPAN&gt;, &lt;/SPAN&gt;Map.&lt;SPAN&gt;class&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 05:31:07 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ClassCastExceptions-with-JSON-response/m-p/76186#M47573</guid>
      <dc:creator>GeordieMc</dc:creator>
      <dc:date>2021-05-07T05:31:07Z</dc:date>
    </item>
  </channel>
</rss>

