title: Debugging Jersey Unmarshalling Error - Bad Request syntactically incorrect
body: <p>I am building a REST Webservice with the help of Jersey on Glassfish. Now I am struggeling with my custom input Source for my searchQuerys.</p>
  
  <p>If have a search Method:</p>
  
  <pre><code>@POST
  @Path("search")
  @Consumes({"application/xml", "application/json"})
  @Produces({"application/xml", "application/json"})
  public List&lt;Index&gt; search(SearchQuery searchqry) {
     ...
  }
  </code></pre>
  
  <p>And the Class SearchQuery:</p>
  
  <pre><code>@XmlRootElement
  public class SearchQuery implements Serializable {
      private static final long serialVersionUID = 1L;
  
      public SearchQuery() {
      }
  
      public SearchQuery(float lat, float lng) {
          this.lat = lat;
          this.lng = lng;
      }
  
      public float getLat() {
          return lat;
      }
  
      public void setLat(float lat) {
          this.lat = lat;
      }
  
      public float getLng() {
          return lng;
      }
  
      public void setLng(float lng) {
          this.lng = lng;
      }
  
      private float lat;
      private float lng;
  }
  </code></pre>
  
  <p>And my call:</p>
  
  <pre><code>curl -v -X POST --data-binary "&lt;SearchQuery&gt;&lt;lat&gt;3.3&lt;/lat&gt;&lt;lng&gt;5.4&lt;/lng&gt;&lt;/SearchQuery&gt;" -H "Content-Type: application/xml" -H "Accept: application/xml" http://localhost:8080/WebApplication1/resources/index/search
  </code></pre>
  
  <p>I tried a restconsole to send the XML request, but I get the same error:</p>
  
  <blockquote>
    <p>HTTP Status 400 - Bad Request<hr/><p><b>type</b> Status
    report</p><p><b>message</b>Bad Request</p><p><b>des cription</b>The
    request sent by the client was syntactically incorrect (Bad
    Request).</p><hr/><h3>GlassFish Server Open Source Edition
    3.1.2</h3>* Closing connection #0</p>
  </blockquote>
  
  <p>I am missing something essentially or can somebody give me a hint how to debug the unmarshalling part inside the Application Server?</p>
  
  <p>I followed the guide at <a href="http://xebee.xebia.in/2011/12/30/example-of-restful-webservice-with-xml-and-json-using-maven-jaxb-jersey-tomcat-and-curl/" rel="nofollow">http://xebee.xebia.in/2011/12/30/example-of-restful-webservice-with-xml-and-json-using-maven-jaxb-jersey-tomcat-and-curl/</a>
  and tested varius combination of Annotations but no sucess :(</p>