Bug 148341 - Webservice in Macro not working reliably (More then 1 request per macro call)
Summary: Webservice in Macro not working reliably (More then 1 request per macro call)
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.3.2.2 release
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-03 21:18 UTC by VHawk
Modified: 2023-01-22 03:28 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description VHawk 2022-04-03 21:18:10 UTC
Description:
When trying to use the Webservice in a macro it sends the http request to the server multiple times which causes an error because of the many requests. Even though the first response would be sufficient, it takes the last response, the error message. 

Example code: 

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/Universal/servlet/FlexStatementService.SendRequest?t=280014687756071353099584&q=664945&v=3"))
print svc.callFunction(“FILTERXML”, array(XML_String, “/FlexStatementResponse/Status” ))
end sub

When the link is used in any browser it returns an xml with Status = Success, in the macro above it always returns fail, error 1018 (which is too many requests in short time period) 

Steps to Reproduce:
1.Execute the code, if the status is "fail", you reproduced the bug: 

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/Universal/servlet/FlexStatementService.SendRequest?t=280014687756071353099584&q=664945&v=3"))
print svc.callFunction(“FILTERXML”, array(XML_String, “/FlexStatementResponse/Status” ))
end sub


2.
3.

Actual Results:
Response from Server: <FlexStatementResponse timestamp="03 April, 2022 05:16 PM EDT">
<Status>Warn</Status>
<ErrorCode>1018</ErrorCode>
<ErrorMessage>Too many requests have been made from this token. Please try again shortly.</ErrorMessage>
</FlexStatementResponse>


Expected Results:
<FlexQueryResponse queryName="minimum" type="AF">
<FlexStatements count="1">
<FlexStatement accountId="U4234234" fromDate="20220401" toDate="20220401" period="LastBusinessDay" whenGenerated="20220403;091110">
<AccountInformation currency="EUR"/>
</FlexStatement>
</FlexStatements>
</FlexQueryResponse>


Reproducible: Always


User Profile Reset: Yes



Additional Info:
You can try this yourself by clicking this link and open in the browser. If you refresh once, you get the right result, if you refresh quickly you get the fail. 

https://ndcdyn.interactivebrokers.com/Universal/servlet/FlexStatementService.SendRequest?t=280014687756071353099584&q=664945&v=3"
Comment 2 Andreas Heinisch 2022-05-04 19:13:29 UTC
I cannot fully test this, since I have no token for the website. I always succeed to get a the expected answer. Could that be fixed with https://gerrit.libreoffice.org/c/core/+/133275?
Comment 3 QA Administrators 2022-12-22 03:36:21 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2023-01-22 03:28:38 UTC
Dear VHawk,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp