System.Int64 is not a supported primitive type RRS feed

  • Question

  • I'm trying to use the HTTP Webservice Activity, but it fails on parsing JSON containing long INTs (Int64):

    System.ArgumentException: 'System.Int64' is not a supported primitive type.
    Parameter name: value at Microsoft.Activities.Dynamic.DynamicPrimitive..ctor(Object value)
    at Microsoft.Activities.Dynamic.JsonHelper.AsDynamicItem(JsonValue obj)
    at Microsoft.Activities.Dynamic.JsonHelper.TryCreateDynamicObject(JsonValue obj, DynamicItem& dynamicObject)
    at Microsoft.Activities.Dynamic.JsonHelper.JsonToDynamic(JsonValue obj)
    at Microsoft.Activities.Dynamic.DynamicJsonArray..ctor(JsonArray jsonArray)
    at Microsoft.Activities.Dynamic.JsonHelper.AsDynamicItem(JsonValue obj)
    at Microsoft.Activities.DynamicValue.ParseJson(String json)
    at Microsoft.Activities.Messaging.HttpActivityHelpers.TryDeserializeResponseContent(Uri uri, Byte[] bytes, HttpStatusCode statusCode, String mediaType, Type typeToDeserialize, String accept, Object& result, Exception& exception)

    Is there any chance of circumventing this? Twitter Tweet IDs are unfortunately Int64, hence I will need to be able to use Int64 if I want to parse twitter feeds:

    Sunday, March 24, 2013 4:49 PM

All replies

  • Ing64 is by default not a part of trusted surface. This post describes what does this mean and how to include specific type in the trusted surface:

    Damir Dobric

    Monday, March 25, 2013 9:57 PM
  • Very good find Damir. Thank you.

    However this doesn't seem to do the trick for SharePoint Workflows - I get the same exception after setting/creating the AllowedTypes.xml. The Exception stems from


    which in turn expects a JsonPrimitive (Microsoft.Workflow.Common.Json). As far as I can tell, using reflection, I'm out of luck with the JsonPrimitive - it doesn't have a converter from Int64 --> something meaningful. It has:

    bool, byte, sbyte, decimal, short, ushort, int,uint, long, ulong, float, double, string, char, DateTime, DateTimeOffset, TimeSpan, Uri, GUID - no Int64.

    Tuesday, March 26, 2013 8:36 AM