HTTP Request / Webservice too many requests / too fast?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Hawki
Posts: 3
Joined: Sun Apr 03, 2022 12:55 am

HTTP Request / Webservice too many requests / too fast?

Post by Hawki »

edit: sorry, now i have the correct version in the signature. The problem still persists but is different now.

Hello community,

I need to request data from a url with an xml response but from within a macro. I have found nothing but the webservice - see example code below. Perhaps you have an alternative solution to the webservice? If not:

URL in question: https://ndcdyn.interactivebrokers.com/U ... 664945&v=3

sub main
svc = createUnoService( “com.sun.star.sheet.FunctionAccess” ) 'Create a service to use Calc functions
XML_String = svc.callFunction(“WEBSERVICE”,array(“https://ndcdyn.interactivebrokers.com/U ... 664945&v=3”))
print XML_String
sub end

If I use it in a browser I receive a success response - however if I use it in the macro I get a fail with Error 1018, this error means “too many requests”. The server on the other side is quite “lenient” and allows requests every few seconds, but the Webservice seems to request very often even though it is one function call. Does anyone know what to do here?

Is it possible to limit the webservice request to try once and then have some code to wait a progressive period of time until the next request is sent?

Thank you very much in advance
Last edited by Hawki on Sun Apr 03, 2022 5:57 pm, edited 2 times in total.
MacOS 10.4 / Libreoffice 7.3
ms777
Volunteer
Posts: 177
Joined: Mon Oct 08, 2007 1:33 am

Re: How to use Webservice in Open Office / LibreOffice

Post by ms777 »

Hi,

neither the SimpleFileAccess service nor the WEBSERVICE function allow to specify a User Agent. This is required, however, by your web service.

I suggest doing the access of the webservice in a JavaScript or Python macro. Maybe viewtopic.php?f=45&t=66914 can give you some hints

The OpenOffice UI is still in stoneage. There is no collapsing or autocomplete

Good luck,

ms777

P.S. Please update to a recent version of ApacheOpenOffice or LibreOffice. 2.4 is quite outdated
Hawki
Posts: 3
Joined: Sun Apr 03, 2022 12:55 am

Re: How to use Webservice in Open Office / LibreOffice

Post by Hawki »

edit: the answer I found does not really work..
Last edited by Hawki on Sun Apr 03, 2022 5:58 pm, edited 1 time in total.
MacOS 10.4 / Libreoffice 7.3
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to use Webservice in Open Office / LibreOffice

Post by Villeroy »

Nobody can give valuable answers if you lie about your office version. You are using LibreOffice 6 or 7 otherwise you would not have any WEBSERVICE function. That function can be used directly on sheet without stupid Basic code.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: HTTP Request / Webservice too many requests / too fast?

Post by Villeroy »

t107490.ods
(23.82 KiB) Downloaded 126 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Hawki
Posts: 3
Joined: Sun Apr 03, 2022 12:55 am

Re: HTTP Request / Webservice too many requests / too fast?

Post by Hawki »

This one does not work unfortunately, I get the same error and on top I need to have it in the macro as I will have to use this result to make another call...
MacOS 10.4 / Libreoffice 7.3
User avatar
RoryOF
Moderator
Posts: 34613
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: HTTP Request / Webservice too many requests / too fast?

Post by RoryOF »

Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Mountaineer
Posts: 316
Joined: Sun Sep 06, 2020 8:27 am

Re: HTTP Request / Webservice too many requests / too fast?

Post by Mountaineer »

and solved at ask by using external curl instead of WEBSERVICE.
OpenOffice 3.1 on Windows Vista
Bidouille
Volunteer
Posts: 577
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: HTTP Request / Webservice too many requests / too fast?

Post by Bidouille »

Hawki wrote:If I use it in a browser I receive a success response
No, with Firefox, I got same error:
Capture.PNG
Post Reply