title: how to use json with jersey client to .net REST svc with weblogic?
body: <p>My local tech stack is wl 9.2, jersey 1.1.5.1. </p>
  
  <p>The remote REST svc is in ASP.net, and the response in the request body is described in a document as</p>
  
  <pre><code>{
      "Context" : 
      {
          "ID" : "0c351860a82d",        
          "Action" : "SomeAction",        
          "MessageID" : "5d220b792d7f",        
          "UriString" : "",        
          "ReferenceID" : "3ee8c695ffa5",        
          "Time" : "2009-02-11T01:37:44.52",        
          "ControlNbr" : "1.001"
      },    
      "Answer" : 
      {
          "Code" : 0,        
          "Detail" : ""
      },    
      "Exceptions" : [{
              "Code": 1,
              "Text": "Missing value ",
              "Trace": "trace from error.."
          },{
              "Code": 2,
              "Text": "Invalid input ",
              "Trace": "trace from error.."
          } ],   
      "Salt" : "196ac409",    
      "TmpKey" : "3ee8c695ffa5"
  }
  </code></pre>
  
  <p>I've tried and mapped the above to POJOs that start like this:</p>
  
  <pre><code>@XmlRootElement
  @XmlAccessorType(XmlAccessType.FIELD)
  public class SvcResponseBean {
  
      public SvcResponseBean() {}
  
      @XmlElement(name="Context")
      public ContextBean ctx;
  
      @XmlElement(name="Answer")
      public AnswerBean answ;
  
      @XmlElement(name = "Exceptions")
      public List&lt;ExceptionBean&gt; exs = new ArrayList&lt;ExceptionBean&gt;();
  
      @XmlElement(name="Salt")
      public String salt;
  
      @XmlElement(name="TmpKey")
      public String tmpKey;
  
      public void add(ExceptionBean eb) {exs.add(eb);}
  }
  </code></pre>
  
  <p>The owners of the svc can help me only so much and not much with Jersey.
  At runtime, the call</p>
  
  <pre><code>ClientResponse myClientResponse= myWebResourceBuilder.get(ClientResponse.class);
  SvcResponseBeanpsrb = myClientResponse.getEntity(SvcResponseBean.class);
  </code></pre>
  
  <p>croaks with </p>
  
  <pre><code>java.lang.Error: Error: could not match input
  at com.sun.jersey.json.impl.reader.JsonLexer.zzScanError(JsonLexer.java:468)
  at com.sun.jersey.json.impl.reader.JsonLexer.yylex(JsonLexer.java:713)
  at com.sun.jersey.json.impl.reader.JsonXmlStreamReader.nextToken(JsonXmlStreamReader.java:153)
  </code></pre>
  
  <p>Obviously, I'm not that well versed in JSON and Jersey, but I'm learning.
  Is there a way to make Jersey/JsonLexer tell me what exactly went wrong?
  I know there are a number of different types of JSON formats out there, so perhaps that's my problem?</p>
  
  <p>Any hints would be appreciated.</p>
  
  <p>karoy</p>