<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Casting from JSON to Dictionary to CDT, array entries are null</title><link>https://community.appian.com/discussions/f/rules/25151/casting-from-json-to-dictionary-to-cdt-array-entries-are-null</link><description>I have a REST service that returns JSON which is converted to Dictionary by the integration. I have CDTs I have imported from the service WSDL (so the property names exactly match the JSON names). The problem is that array properties are left null instead</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Casting from JSON to Dictionary to CDT, array entries are null</title><link>https://community.appian.com/thread/97620?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 13:47:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7d283dfd-ad2b-40c0-be03-231d0dd02f61</guid><dc:creator>stevenh6272</dc:creator><description>&lt;p&gt;The CDTs were built from the WSDL.... so it is a matter of getting DotNet to build the WSDL in a way that is compatible with Appian.&amp;nbsp; I will see what I can do for this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Casting from JSON to Dictionary to CDT, array entries are null</title><link>https://community.appian.com/thread/97619?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 13:44:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a78733cc-b29f-4e6a-8154-8b80746cbafa</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;In Appian CDTs, you would make the field &amp;quot;books&amp;quot; in the top-level CDT of type &amp;quot;Book&amp;quot; and a multiple. This will then cast perfectly from/to JSON. The in-between CDT is not necessary.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Casting from JSON to Dictionary to CDT, array entries are null</title><link>https://community.appian.com/thread/97618?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 13:40:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3383c31d-2faa-422d-a3a4-2f52f7381280</guid><dc:creator>stevenh6272</dc:creator><description>&lt;p&gt;This is apparently how DotNet handles defining list/array-based properties in the WSDL.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the service class in C#&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1657633248543v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Casting from JSON to Dictionary to CDT, array entries are null</title><link>https://community.appian.com/thread/97615?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 12:59:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2dafb274-13a6-4007-b76e-d5975501d0f8</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Hm ... this seems a bit weird. Why is there a books field which is of a type that has only one field &amp;quot;book&amp;quot; which is a list of books.&lt;/p&gt;
&lt;p&gt;I understand that the provided JSON does not cast to this structure.&lt;/p&gt;
&lt;p&gt;To understand what is going on, create a data structure using the CDT types and turn that into JSON to spot the difference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Casting from JSON to Dictionary to CDT, array entries are null</title><link>https://community.appian.com/thread/97614?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 12:52:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:991fa558-7a57-4064-9210-7daab82ffa9d</guid><dc:creator>stevenh6272</dc:creator><description>&lt;p&gt;Here are the CDTs.&amp;nbsp; These were imported from a DotNet web service&amp;#39;s WSDL.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/CDTs.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is a fragment from the WSDL that defines these.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;		&amp;lt;xs:schema elementFormDefault=&amp;quot;qualified&amp;quot; targetNamespace=&amp;quot;http://schemas.datacontract.org/2004/07/TestService&amp;quot; xmlns:xs=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:tns=&amp;quot;http://schemas.datacontract.org/2004/07/TestService&amp;quot;&amp;gt;
			&amp;lt;xs:complexType name=&amp;quot;Library&amp;quot;&amp;gt;
				&amp;lt;xs:sequence&amp;gt;
					&amp;lt;xs:element minOccurs=&amp;quot;0&amp;quot; name=&amp;quot;Books&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;tns:ArrayOfBook&amp;quot;/&amp;gt;
					&amp;lt;xs:element minOccurs=&amp;quot;0&amp;quot; name=&amp;quot;HeadLibrarian&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;xs:string&amp;quot;/&amp;gt;
					&amp;lt;xs:element minOccurs=&amp;quot;0&amp;quot; name=&amp;quot;Name&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;xs:string&amp;quot;/&amp;gt;
				&amp;lt;/xs:sequence&amp;gt;
			&amp;lt;/xs:complexType&amp;gt;
			&amp;lt;xs:element name=&amp;quot;Library&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;tns:Library&amp;quot;/&amp;gt;
			&amp;lt;xs:complexType name=&amp;quot;ArrayOfBook&amp;quot;&amp;gt;
				&amp;lt;xs:sequence&amp;gt;
					&amp;lt;xs:element minOccurs=&amp;quot;0&amp;quot; maxOccurs=&amp;quot;unbounded&amp;quot; name=&amp;quot;Book&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;tns:Book&amp;quot;/&amp;gt;
				&amp;lt;/xs:sequence&amp;gt;
			&amp;lt;/xs:complexType&amp;gt;
			&amp;lt;xs:element name=&amp;quot;ArrayOfBook&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;tns:ArrayOfBook&amp;quot;/&amp;gt;
			&amp;lt;xs:complexType name=&amp;quot;Book&amp;quot;&amp;gt;
				&amp;lt;xs:sequence&amp;gt;
					&amp;lt;xs:element minOccurs=&amp;quot;0&amp;quot; name=&amp;quot;Author&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;xs:string&amp;quot;/&amp;gt;
					&amp;lt;xs:element minOccurs=&amp;quot;0&amp;quot; name=&amp;quot;DueDate&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;xs:dateTime&amp;quot;/&amp;gt;
					&amp;lt;xs:element minOccurs=&amp;quot;0&amp;quot; name=&amp;quot;IsCheckedOut&amp;quot; type=&amp;quot;xs:boolean&amp;quot;/&amp;gt;
					&amp;lt;xs:element minOccurs=&amp;quot;0&amp;quot; name=&amp;quot;Title&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;xs:string&amp;quot;/&amp;gt;
				&amp;lt;/xs:sequence&amp;gt;
			&amp;lt;/xs:complexType&amp;gt;
			&amp;lt;xs:element name=&amp;quot;Book&amp;quot; nillable=&amp;quot;true&amp;quot; type=&amp;quot;tns:Book&amp;quot;/&amp;gt;
		&amp;lt;/xs:schema&amp;gt;
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Casting from JSON to Dictionary to CDT, array entries are null</title><link>https://community.appian.com/thread/97583?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 06:17:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b441301d-396e-4eac-8fbb-65fd5ebe5d99</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Can you post a screenshot of the CDT configuration?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Casting from JSON to Dictionary to CDT, array entries are null</title><link>https://community.appian.com/thread/97578?ContentTypeID=1</link><pubDate>Tue, 12 Jul 2022 03:23:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:29481836-10d1-446a-a82b-edf824644863</guid><dc:creator>Andrew Hickingbotham</dc:creator><description>&lt;p&gt;I&amp;#39;ve made my own CDTs and the casting works. Maybe there&amp;#39;s an issue with the CDT? I used your exact local!rawData JSON string you provided above.&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1657596223029v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>