Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF REST JSON collection null with Twitter
    text
    copied!<p>I'm issuing the friends/ids call like so:</p> <pre><code>GET /1.1/friends/ids.json?screen_name=blablabla HTTP/1.1 </code></pre> <p>A valid response is issued:</p> <pre><code>{"ids":[97500486,32947624,8884440,2022687,28741369,33978239,10312111,950922,7682036,21688137,7696145,15876098],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"} </code></pre> <p>My interface looks like this:</p> <pre><code>[OperationContract(Name = "ids.json")] [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate="ids.json?user_id={userId}&amp;screen_name={screenName}")] FriendsIdsResponse Ids(long? userId, string screenName); [DataContract] public class FriendsIdsResponse { public FriendsIdsResponse() { } [DataMember(Name = "ids")] public long[] Ids { get; set; } [DataMember(Name = "previous_cursor")] public int PreviousCursor { get; set; } [DataMember(Name = "next_cursor")] public int NextCursor { get; set; } } </code></pre> <p>No matter what type Ids is (long[], IList, List, etc.), it always comes back null. If I instantiate it to an empty List in ctor, it has Count==0.</p> <p><strong>UPDATE</strong> WCF configs, as requested:</p> <pre><code>&lt;system.serviceModel&gt; &lt;client&gt; &lt;endpoint contract="TA.Twitter.Service.IFriends, TA.Twitter.Interfaces" address="https://api.twitter.com/1.1/friends/" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" &gt;&lt;/endpoint&gt; &lt;/client&gt; &lt;bindings&gt; &lt;webHttpBinding&gt; &lt;binding name="WebHttpBinding" allowCookies="true"&gt; &lt;security mode="Transport"&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/webHttpBinding&gt; &lt;/bindings&gt; &lt;/system.serviceModel&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload