Incorrect HttpResponse Status when no results found [v 3.2]

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

nisseknudsen
Posts: 6
Joined: Wed Dec 07, 2016 12:10 pm

Incorrect HttpResponse Status when no results found [v 3.2]

Post by nisseknudsen » Tue Feb 28, 2017 12:13 am

Dear OPS team,

I encountered an undesired behaviour while working with the new v3.2 API.

In 3.1, when no results where found for a query (my example: applicant name = 'xckjsdlfkjsdlfkj', something that is very likely not existing), the response was 200 OK , and an empty JSON object.
That is expected behaviour, at least from my point of view.

http://ops.epo.org/3.1/rest-services/pu ... lfkjsdlfkj
Response:

Code: Select all

HTTP/1.1 200 OK
ETag:
"xxx"
X-EPO-Client-IP:
xxx
Content-Length:
355
Access-Control-Allow-Methods:
POST
Connection:
keep-alive
X-IndividualQuotaPerHour-Used:
7483
Server:
Apache
Cache-Control:
must-revalidate, max-age=86400
X-EPO-Forwarded:
[xxx]
X-Throttling-Control:
overloaded (images=green:50, inpadoc=green:30, other=green:1000, retrieval=green:50, search=green:5)
Access-Control-Allow-Headers:
Authorization
Date:
Mon, 27 Feb 2017 23:06:20 GMT
Access-Control-Allow-Origin:
*
Vary:
Accept
X-API:
ops-v3.1
X-AnonymousQuotaPerMinute-Used:
1
X-AnonymousQuotaPerDay-Used:
2684816
Content-Type:
application/json

{
  "ops:world-patent-data":  {
    "@xmlns":  {
      "ops": "http://ops.epo.org",
      "$": "http://www.epo.org/exchange",
      "xlink": "http://www.w3.org/1999/xlink"
    },
    "ops:meta":  {
      "@name": "elapsed-time",
      "@value": "5"
    },
    "ops:biblio-search":  {
      "@total-result-count": "0",
      "ops:query":  {
        "$": "pa = xckjsdlfkjsdlfkj",
        "@syntax": "CQL"
      },
      "ops:range":  {
        "@begin": "1",
        "@end": "25"
      },
      "ops:search-result":  {}
    }
  }
}

When doing the same GET request (but it is the same for the new POST method, I already tested it), I received Status 404 Entity Not Found.
This is highly irritating, because it signals to me that I tried to access and endpoint or resource which is not existing, but not a resource which is empty.

http://ops.epo.org/3.2/rest-services/pu ... lfkjsdlfkj
Response:

Code: Select all

HTTP/1.1 404 Not Found
Content-Language:
en
X-EPO-Client-IP:
xxx
Content-Length:
179
Access-Control-Allow-Methods:
POST
Connection:
keep-alive
X-IndividualQuotaPerHour-Used:
16038
Server:
Apache
X-EPO-Forwarded:
[xxx]
X-Throttling-Control:
idle (images=green:200, inpadoc=green:60, other=green:1000, retrieval=green:200, search=green:30)
X-Throttling-Control:
idle (images=green:200, inpadoc=green:60, other=green:1000, retrieval=green:200, search=green:30)
Access-Control-Allow-Headers:
Authorization
Date:
Mon, 27 Feb 2017 23:11:49 GMT
Access-Control-Allow-Origin:
*
X-API:
ops-v3.2
Content-Type:
application/xml
X-RegisteredQuotaPerWeek-Used:
134434724

<?xml version="1.0" encoding="UTF-8"?>
<fault xmlns="http://ops.epo.org">
  <code>SERVER.EntityNotFound</code>
  <message>No results found</message>
</fault>

Could you possibly try to make empty responses Status 200 again, and also include the overhead as you did before?


(Additionally, the 404 response is in application/xml, althought application/json was requested.)

Thanks a lot,
Best,

Nisse


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

Re: Incorrect HttpResponse Status when no results found [v 3

Post by EPO / OPS Support » Tue Feb 28, 2017 3:29 pm

Hi,

There really seems to be inconsistency between the two services, as you noticed yourself. We have informed our developers and ask them to have a look and both services.

I will get back to you once I know more

OPS support


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

Re: Incorrect HttpResponse Status when no results found [v 3.2]

Post by EPO / OPS Support » Fri Aug 04, 2017 8:53 am

Dear user,

This issue is going to be fixed with the next OPS maintenance release which is currently scheduled for early September.

We expect to be able to provide additional information about the new release on this Forum by the end of August.

Kind regards,

OPS Support


Mike_k43
Posts: 34
Joined: Fri Jan 06, 2017 1:34 pm

Re: Incorrect HttpResponse Status when no results found [v 3.2]

Post by Mike_k43 » Thu Sep 14, 2017 7:53 am

This is a follow up of my earlier posts concerning OPS 3.2 behaviour with null result queries. OPS Support announced an OPS maintenance release for early September and that additional information about the new release would be provided on this Forum by the end of August. We are now mid-September and neither of the two has happened. As a programmer I need to know whether the behaviour of 3.2 with null result queries will remain as it is (return "404 Not found") or whether it will be changed back to 3.1 behaviour (return "200 OK" and empty worldpatentdata object).

mike_k43


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

Re: Incorrect HttpResponse Status when no results found [v 3.2]

Post by EPO / OPS Support » Thu Sep 14, 2017 9:43 am

Hi,

Release is still planed according to the email before and we are in the testing phase in the moment, still working on some issues, so the release date had to be posponed. But the rest still remains as before, when we are sure that integration is running as it should we will inform about intent to release in Announcements of this forum and give the exact date.

We are trying to provide you with a good service and that can sometimes take more time then first planed, as I am sure you know as a programmer. But since we are in a process of testing in integration it can not take that much longer.

Regards,
OPS support


Mike_k43
Posts: 34
Joined: Fri Jan 06, 2017 1:34 pm

Re: Incorrect HttpResponse Status when no results found [v 3.2]

Post by Mike_k43 » Thu Nov 23, 2017 7:44 am

Dear OPS support:

I revert concerning this issue. The announcement of Fri Aug 04, 2017 8:53 am was that this issue would be fixed with the new release. However now, with method GET, the query
https://ops.epo.org/3.2/rest-services/p ... /[b]search[/b]/biblio?q=sap%3DUS20080027420P
still returns 404 Not Found, instead of an empty worldpatentdata object. This query should return an empty worldpatentdata object, because US priority application US20080027420P was not published.The application US20080027420P as such however exists, it is not a non-existing resource.

mike_k43


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

Re: Incorrect HttpResponse Status when no results found [v 3.2]

Post by EPO / OPS Support » Thu Nov 23, 2017 8:22 am

Hi,

No, this is not how our database works. This application is not loaded in a database (no matter if it exist or not somewhere else) so you cannot get 200 Success result if you query something that does not exist in OPS. 200 result is only admissible when you actually get your response in full. if you don't you should get one of the URL 400-s errors. So, 404 with unsuccessful query due to a document not being found (Resource not found) is exactly what the system should do.

Regards,
OPS support


Mike_k43
Posts: 34
Joined: Fri Jan 06, 2017 1:34 pm

Re: Incorrect HttpResponse Status when no results found [v 3.2]

Post by Mike_k43 » Fri Nov 24, 2017 7:41 am

Dear OPS support,

This behaviour of OPS is unsatisfactory. As already explained, my progarmming language, and presumably others too, will interpret such "404 Not found" response as a WebException, necessitating interruption of normal program flow with a try{}/catch{WebException} approach. A query returning zero found results is however not such a severe condition to necessitate such exception handling. Whenever possible I would like to avoid that. Is there a way to determine the number of expected results that a query will retrieve (which may be zero), before executing that query itself and receiving the 404 Not found exception?

mike_k43


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

Re: Incorrect HttpResponse Status when no results found [v 3.2]

Post by EPO / OPS Support » Fri Nov 24, 2017 8:20 am

Hi,

Since a very beginning of OPS this is how the system was set and that seems to be widely accepted by users so that will not change in the near future. But maybe some other users reading this thread would have practical advice for you regarding this and maybe they can share with you how they deal with responses like this one. We did set up this forum in a hope that user community will help each other with practical issues when using the web services and your post is an ideal opportunity for that. Let see if someone has some good tips to share.

Regards,
OPS support


Post Reply