Request entity too large

This space is made available to users of Open Patent Services (OPS) web-service and now also to users of EPO’s bulk data subscription products such as 14. EPO worldwide bibliographic database (DOCDB), 14.11 EPO worldwide legal status database (INPADOC), 14.12 EP full text data, 14.1 EP bibliographic data (EBD)and more.

Users can ask each other questions, exchange experiences and solutions, post ideas. The moderator will use this space to announce changes or other relevant information.
Post Reply

Chris Every
Posts: 23
Joined: Mon Jun 24, 2013 10:21 am

Request entity too large

Post by Chris Every » Tue Jan 28, 2014 1:48 pm

When I do the following request with my browser:
http://ops.epo.org/3.1/rest-services/le ... S5582191.*

I get the following fault, which is perfectly OK, as I know how to deal with this.

Code: Select all

<fault>
   <code>CLIENT.AmbiguousRequest</code>
   <message>The request was ambiguous</message>
   <details>
      <cause>Ambiguous input: publication/docdb/JP.S5582191.*</cause>
      <resolution>publication/docdb/JP.S5582191.A*</resolution>
      <resolution>publication/docdb/JP.S5582191.U*</resolution>
   </details>
</fault>
But when I face the same exception whilst using Jersey-Client (a java library), this error situation is dealt differently. Jersey respects the HTTP standard error codes. As such it thinks

Code: Select all

code 413 == Request Entity Too Large
and throws an exception. When using the API Console in your Developer's Area I get the exact same behaviour.

What's the problem with this
I can react to ordinary error codes using ordinary program flow. When I get an Exception, I should react differently to that instead of using it for program flow. This is generally considered a bad practice, but currently I am forced to.

The other thing is, you are abusing the error code 413. It is intended to signal to the client that the request which has been sent to the server is too large to be processed. e.g. if I sent a POST request which is in total 20 MB of size and your server says: No this request you sent to us is too large.

So when facing a 413 I should make my request physically smaller, reducing its' byte-count. Not the response amount :)

How to deal with this
Use proper error codes. For the case that the request is ambiguous, you could have a look at error code 300 or 303. That would be ideal. You could also send a custom 5xx error code, as the server is not able to resolve the given URL to a resource.


EPO / OPS Support
Posts: 1027
Joined: Thu Feb 22, 2007 5:32 pm

Re: Request entity too large

Post by EPO / OPS Support » Tue Jan 28, 2014 4:26 pm

Dear user,

Thank you for your feedback. We will forward your forum entry to our technical team.

Kind regards,

OPS support


EPO / OPS Support
Posts: 1027
Joined: Thu Feb 22, 2007 5:32 pm

Re: Request entity too large

Post by EPO / OPS Support » Thu Jan 30, 2014 10:10 am

Dear user,

According to OPS specification (page 35) "413 CLIENT.AmbiguousRequest - The requested input was ambiguous." the Ambiguous Request error is complemented with 413 HTTP error code.

User is free to interpret combination of 413 HTTP error code and CLIENT.AmbiguousRequest OPS error code in his application to change work-flow depending on ambiguity resolution advices.

413 is a perfectly valid HTTP response code http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.

Surly Jersey can correctly handle it and even if not this looks more the problem of Jersey so you might want to try any other java library to connect to OPS.

Kind regards,

OPS support


Post Reply