Bug 131516 - Use of WEBSERVICE function raises an "Illegal argument" exception
Summary: Use of WEBSERVICE function raises an "Illegal argument" exception
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.2.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2020-03-23 23:14 UTC by Fede
Modified: 2021-09-03 13:46 UTC (History)
3 users (show)

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 Fede 2020-03-23 23:14:21 UTC
Hi, this is the issue #115710 that seems to be back.  

Testing code:

Feel free to refer to https://bugs.documentfoundation.org/show_bug.cgi?id=115710 for more details on the original issue.

Thanks.
Comment 1 Buovjaga 2020-06-19 13:25:05 UTC
I tried with

Sub Main
svc = createUnoService( "com.sun.star.sheet.FunctionAccess" ) 'Create a service to use Calc functions
XML_String = svc.callFunction("WEBSERVICE",array("http://www.lipsum.com/feed/xml?amount=2&what=paras&start=Yes"))
Lipsum = svc.callFunction("FILTERXML", array(XML_String, "/feed/lipsum" ))
Print Lipsum
End Sub

and it works fine for me.

Maybe there is some glitch in your system.

Arch Linux 64-bit
Version: 6.4.4.2
Build ID: 6.4.4-1
CPU threads: 8; OS: Linux 5.6; UI render: default; VCL: kf5; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Comment 2 Eyeillus 2021-03-20 23:50:25 UTC
I get this, too - but it only gives me an error when I go to https addresses, not http.  I don't think it's limited to macros, either - I get an error when I use https in WEBSERVICE in a spreadsheet, and not when I use http in WEBSERVICE in a spreadsheet.

An example in macro-land:

```
result = svc.callFunction("WEBSERVICE",Array("http://google.com"))
ThisComponent.Sheets(0).getCellRangeByName("$A$1").setString(result)
result = svc.callFunction("WEBSERVICE",Array("https://google.com")) rem ERROR
ThisComponent.Sheets(0).getCellRangeByName("$A$2").setString(result)
```

I get an error on the second WEBSERVICE call, but the first finishes correctly.  The error is:
```
BASIC runtime error.
An exception occurred
Type: com.sun.star.lang.IllegalArgumentException
Message: /home/buildslave/source/libo-core/sc/source/ui/unoobj/funcuno.cxx
```
...which isn't *super* helpful.


Anyway, that might explain why Fede got the error and Buovjaga didn't.
Comment 3 Eyeillus 2021-03-20 23:59:41 UTC
And oh, sorry, versions:
Debian 10, 64-bit
LibreOffice 7.1.1.2
Kernel: Linux version 4.19.0-6-amd64
Comment 4 Buovjaga 2021-03-21 07:57:51 UTC
(In reply to Eyeillus from comment #2)
> Anyway, that might explain why Fede got the error and Buovjaga didn't.

Well, I used the http example from the original description of bug 115710, but comment 11 in it used https.

Let's set OS to All as Nikolai in the older report was using macOS
Comment 5 Eike Rathke 2021-09-03 12:55:11 UTC
Fwiw, works perfectly when entered in Calc:
=WEBSERVICE("https://www.lipsum.com/feed/xml?amount=2&what=paras&start=Yes")

and also as macro as in comment 1, with http and https.

Both 7.1.5 and 7.2.z

Suggest closing this.