2013-08-21 87 views
1

我与JayRock存在问题,我间歇性地收到 缺少值错误。JayRock间歇性缺失值

我不能重新创建错误,但它每天发生在100-150次左右(成千上万的请求中)。

调查后已发现 上不能有在 HTTP请求没有[RequestBody]元素的请求。

通常,它是这样的:

[urlfield]

[RequestBody] { “ID”:1, “方法”: “getAllAirports”, “PARAMS”:[]}

[饼干]

但在它没有工作要求的情况包括:

[urlfield]

[饼干]

我使用的是默认JayRock代理,并通过使用?测试页的 请求总是工作。

有没有人遇到过这个?或有任何想法?

非常感谢,

伊恩

UPDATE: 纵观数据独有似乎在IE错误,在IE7,8,9错误和10.虽然8是迄今为止最错误,即使它的流量相当于9,小于10

回答

0

似乎是一个分析问题,从Jayrock http://jayrock.googlecode.com/hg/src/Jayrock.Json/Json/JsonTextReader.cs

private JsonToken Parse() 
    { 
     char ch = NextClean(); 

     // 
     // String 
     // 

     if (ch == '"' || ch == '\'') 
     { 
      return Yield(JsonToken.String(NextString(ch))); 
     } 

     // 
     // Object 
     // 

     if (ch == '{') 
     { 
      _reader.Back(); 
      return ParseObject(); 
     } 

     // 
     // Array 
     // 

     if (ch == '[') 
     { 
      _reader.Back(); 
      return ParseArray(); 
     } 

     // 
     // Handle unquoted text. This could be the values true, false, or 
     // null, or it can be a number. An implementation (such as this one) 
     // is allowed to also accept non-standard forms. 
     // 
     // Accumulate characters until we reach the end of the text or a 
     // formatting character. 
     // 

     StringBuilder sb = new StringBuilder(); 
     char b = ch; 

     while (ch >= ' ' && ",:]}/\\\"[{;=#".IndexOf(ch) < 0) 
     { 
      sb.Append(ch); 
      ch = _reader.Next(); 
     } 

     _reader.Back(); 

     string s = sb.ToString().Trim(); 

     if (s.Length == 0) 
      throw SyntaxError("Missing value."); 


     // 
     // Boolean 
     // 

     if (s == JsonBoolean.TrueText || s == JsonBoolean.FalseText) 
      return Yield(JsonToken.Boolean(s == JsonBoolean.TrueText)); 

     // 
     // Null 
     // 

     if (s == JsonNull.Text) 
      return Yield(JsonToken.Null()); 

     // 
     // Number 
     // 
     // Try converting it. We support the 0- and 0x- conventions. 
     // If a number cannot be produced, then the value will just 
     // be a string. Note that the 0-, 0x-, plus, and implied 
     // string conventions are non-standard, but a JSON text parser 
     // is free to accept non-JSON text forms as long as it accepts 
     // all correct JSON text forms. 
     // 

     if ((b >= '0' && b <= '9') || b == '.' || b == '-' || b == '+') 
     { 
      if (b == '0' && s.Length > 1 && s.IndexOfAny(_numNonDigitChars) < 0) 
      { 
       if (s.Length > 2 && (s[1] == 'x' || s[1] == 'X')) 
       { 
        string parsed = TryParseHex(s); 
        if (!ReferenceEquals(parsed, s)) 
         return Yield(JsonToken.Number(parsed)); 
       } 
       else 
       { 
        string parsed = TryParseOctal(s); 
        if (!ReferenceEquals(parsed, s)) 
         return Yield(JsonToken.Number(parsed)); 
       } 
      } 
      else 
      { 
       if (!JsonNumber.IsValid(s)) 
        throw SyntaxError(string.Format("The text '{0}' has the incorrect syntax for a number.", s)); 

       return Yield(JsonToken.Number(s)); 
      } 
     } 

     // 
     // Treat as String in all other cases, e.g. when unquoted. 
     // 

     return Yield(JsonToken.String(s)); 
    } 
+0

请解释问题到底在哪里,以便它可以帮助Op找到解决方案 – Abhitalks