Xamarin:ServiceStack WebServiceException'类型定义应以{'仅出现在设备上开始

时间:2015-11-16 17:21:57

标签: ios serialization xamarin servicestack

所以我几个月来一直在为我们的应用程序使用ServiceStack并且没有遇到任何问题。但是在过去的几天里,当我运行我的应用程序时,我遇到了这个奇怪的异常。但是,只有当我在物理iOS设备上运行时才会出现此错误,模拟器工作正常并且异常永远不会显示。这是我目前正在获得的例外

{ServiceStack.WebServiceException: Bad Request ---> System.Runtime.Serialization.SerializationException: Type definitions should start with a '{', expecting serialized type 'ErrorResponse', got string starting with: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"" at ServiceStack.Text.Common.DeserializeTypeRefJson.StringToType 

这是对整个例外https://gist.github.com/anonymous/cf4ee3716abf4562fe1a

的要点

我之前从未遇到过这方面的问题,我期待的对象类型是KeyValuePair<LoginTypes, Profile>类型,其中LoginTypes被定义为

public enum LoginTypes
{
    LoginSuccessful,
    AccountCreationSuccessful,
    LinkSuccessful,
    Fail,
}

Profile定义为

public class Profile
{
    public string Id { get; set; }
    public string Bio { get; set; }
    public string Email { get; set; }
    public string Uuid { get; set; }
    public string Photo { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string FacebookUUID { get; set; }
    public string LinkedinUUID { get; set; }
    public string TwitterUUID { get; set; }
    public string FacebookURL { get; set; }
    public string TwitterURL { get; set; }
    public string LinkedinURL { get; set; }
    public string DeviceToken { get; set; }
    public string Password { get; set; }
    public string PhoneNumber { get; set; }
    public string TwitterScreenName { get; set; }
    public bool IsPrivate { get; set; }
    public string JobTitle { get; set; }
    public string JobDescription { get; set; }
}

0 个答案:

没有答案