servicestack,xamarin.forms,C#,Xamarin,servicestack,Xamarin.forms" /> servicestack,xamarin.forms,C#,Xamarin,servicestack,Xamarin.forms" />

C# Xamarin中的ServiceStack

C# Xamarin中的ServiceStack,c#,xamarin,servicestack,xamarin.forms,C#,Xamarin,servicestack,Xamarin.forms,我对最近的更新有一个werid问题。我正在使用Visual Studio Enterprise 2015和XF 2.3 我使用的是服务栈,一切都很好,但故事就这样开始了 我有一个带有服务堆栈的REST API,应用程序就是客户端,但当我请求一个方法时,无论它使用POST还是GET API响应是否正确,但当它进入应用程序时,它会使用自定义属性类型变为空。我知道这是正确的,因为API上的日志是这样说的,我知道它是通过WireShark到达应用程序的 如果我在windows窗体中运行相同的代码(客户机

我对最近的更新有一个werid问题。我正在使用Visual Studio Enterprise 2015和XF 2.3

我使用的是服务栈,一切都很好,但故事就这样开始了

我有一个带有服务堆栈的REST API,应用程序就是客户端,但当我请求一个方法时,无论它使用POST还是GET API响应是否正确,但当它进入应用程序时,它会使用自定义属性类型变为空。我知道这是正确的,因为API上的日志是这样说的,我知道它是通过WireShark到达应用程序的

如果我在windows窗体中运行相同的代码(客户机方法),它可以像spected一样工作,但在Xamarin.forms上运行它不会

问题发生在我创建的自定义类型上,但当我使用泛型类型时

public class DataProperty
{
    protected string base64Value;

    public DataProperty();

    public string Value { get; }

    public byte[] Get();
    public DataProperty Set(byte[] data);

    public static implicit operator DataProperty(byte[] data);
    public static implicit operator byte[] (DataProperty PropertyValue);
}

public class DataProperty<T> : DataProperty
{
    public DataProperty();

    public DataProperty<T> Set(byte[] data);

    public static implicit operator DataProperty<T>(byte[] data);
    public static implicit operator byte[] (DataProperty<T> PropertyValue);
}
我正在使用 Visual Studio 2015版本14.0.25123.00更新2 Xamarin 4.1.1.3(34a92cd) Android 6.1.1.1(7db2aac) Xamarion.iOS 9.8.1.4(3cf8aae)


有什么想法吗?

我仍然不确定如何使用
JsonServiceClient
填充它?或者您正在使用帮助器方法之一?您是否可以提供您在应用程序中使用的代码,其中您的对象在WinForms中成功填充,而不是在Xamarin表单中填充?另外,您能否提供您正在使用的POCO的具体版本?查看
DataProperty
类,看起来您自己正在处理序列化/反序列化?感谢您的回复@layric,我编辑了显示客户端的问题。问题出现在我从VS2013升级到VS2015之后,后端与客户端停止工作之前相同,请告诉我如何告诉您POCO版本。再次感谢!顺便说一句,我们有使用服务堆栈的后端许可证。
[0:] {
  "Token": {
    "Value": "WFE1Au5DoIb0sEttlD3h08Xg+E+KwrZ5tFusJqP1TsSY6D6PACjcBAiub+ydX84Wa95Gu318ziDXssUnwe0fWE0L/0A6h5IcLEYk8xGxKdW3ooehjrOR/7KwEypZRcmVI6oKX75id21npQDJZP8Y4U18gBeJuuKjpckeL8b54U8="
  },
  "Id": {
    "Value": ""
  },
  "AId": {
    "Value": ""
  },
  "Iden": {
    "Value": ""
  },
  "ACID": 1522,
  "ResponseStatus": null
}

//SessionToken is a DataProperty
//Id is DataProperty<long>
//AId is DataProperty<double>
//Iden is DataProperty<string>
//ACID is long
//ResponseStatus is a service stack property not filled.
        MyMethodRequest request = new MyMethodRequest();
        using (JsonServiceClient client = new JsonServiceClient(serviceURL))
        {
            try
            {
                var result = await client.PostAsync(request);

                Debug.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));
                return true;
            }
            catch (Exception e)
            {
                Debug.WriteLine("Error:[" + e.Message + "]");
                return false;
            }
        }