SimpleFileAccess fails with HTTP link

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

SimpleFileAccess fails with HTTP link

Post by Mr.Dandy »

Hello forum,

It seems that SimpleFileAccess service don't support HTTP link.

Code: Select all

Sub Main
	Dim oSFA As Object
	Dim url$
	oSFA = CreateUnoService("com.sun.star.ucb.SimpleFileAccess")

	url = "https://forum.openoffice.org/fr/forum/index.php"
	MsgBox(url & " return: " & oSFA.exists(url)) 
End Sub
This code returns always False with AOO 4.1.0. :(

Just before open a bugzilla report, somebody can try this code and confirm?
Thanks
OpenOffice 4.1.12 - Windows 10
mauriciobaeza
Posts: 56
Joined: Thu Apr 22, 2010 5:03 am

Re: SimpleFileAccess fails with HTTP link

Post by mauriciobaeza »

In my system work fine...
Attachments
forum.png
______________________________________________
Everything not given is lost
AOO 4.1 / LibO 4.3 on ArchLinux with Gnome3
Please, I do not answer private questions, you use the forum
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: SimpleFileAccess fails with HTTP link

Post by Mr.Dandy »

mauriciobaeza wrote:In my system work fine...
Which version:
In your signature, you wrote:AOO 3.4 / LibO 4 on ArchLinux with Gnome3
OpenOffice 4.1.12 - Windows 10
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: SimpleFileAccess fails with HTTP link

Post by B Marcelly »

Works for me also.
Returns True after several seconds.
Returns True after several seconds.
Ecran001.png (3.04 KiB) Viewed 3956 times
Apache OpenOffice 4.1.1 MS-Windows 7 Home SP1
Bernard

OpenOffice.org 1.1.5 / Apache OpenOffice 4.1.1 / LibreOffice 5.0.5
MS-Windows 7 Home SP1
mauriciobaeza
Posts: 56
Joined: Thu Apr 22, 2010 5:03 am

Re: SimpleFileAccess fails with HTTP link

Post by mauriciobaeza »

Update my signature...

If you use Win Server, review permitions out from AOO...
______________________________________________
Everything not given is lost
AOO 4.1 / LibO 4.3 on ArchLinux with Gnome3
Please, I do not answer private questions, you use the forum
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: SimpleFileAccess fails with HTTP link

Post by Mr.Dandy »

mauriciobaeza wrote:Update my signature...
But...
In your signature, you wrote:AOO 4.1
4.1.0 or 4.1.1?
OpenOffice 4.1.12 - Windows 10
mauriciobaeza
Posts: 56
Joined: Thu Apr 22, 2010 5:03 am

Re: SimpleFileAccess fails with HTTP link

Post by mauriciobaeza »

Whats is the question? my version of AOO or your problem?

The lines code, work fine always in AOO
______________________________________________
Everything not given is lost
AOO 4.1 / LibO 4.3 on ArchLinux with Gnome3
Please, I do not answer private questions, you use the forum
rudolfo
Volunteer
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: SimpleFileAccess fails with HTTP link

Post by rudolfo »

It works for me with AOO 3.4.1 on Windows 8.

But only if I turn the Proxy settings in the Tools-Options-Internet Off. The default is to use the system settings which are the settings that are configured for Internet Explorer. Especially Proxy and https tends to cause problems in my case.
  • So check your proxy configuration
  • Use a simple http (not https) URL. https usually requires addtional requests to check the certification authority chain of the SSL certificate. In the browser it often happens that you are asked to confirm a certificate (if it is expired or has other issues). If something similar happens in the UNO method OpenOffice won't be able to present a popup to the user and has to stop the processing at this point.
  • Swapping to http is only a temporary test to see if it makes a difference.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
User avatar
Mr.Dandy
Posts: 427
Joined: Tue Dec 11, 2012 4:22 pm

Re: SimpleFileAccess fails with HTTP link

Post by Mr.Dandy »

mauriciobaeza wrote:Whats is the question? my version of AOO or your problem?
My question is: what is your exact version?
For me, this code don't work with AOO 4.1.0

For the moment, all answers have been done with 4.1.1 or old 3.x.
OpenOffice 4.1.12 - Windows 10
rudolfo
Volunteer
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: SimpleFileAccess fails with HTTP link

Post by rudolfo »

Mr.Dandy wrote:My question is: what is your exact version?
For me, this code don't work with AOO 4.1.0

For the moment, all answers have been done with 4.1.1 or old 3.x.
Unfortunately we are not living in an ideal world and it seems that noone here in this forum uses the exact same version as you do. You can either wait until someone with the exact same version drops by into this thread or you can start working with what you have now.

The starting point is: The SimpleFileAccess works for all others, but it doesn't work for you. Now your assumption is that this is related with the specific version of OpenOffice that you are using. But there are several other potential culprits (protocol, proxy, local configuration, firewalls, etc.).
We have never checked that the network configuration that we and you are using are the same. It doesn't make sense to suspect an OpenOffice version problem if these other potential problem areas haven't been investigated.
The http protocol is human readable. Instead of speculation the next step should be to fire up a network sniffer like tcpdump or wireshark and check on the ethernet interface what OpenOffice is doing with the SimpleFileAccess and remote locations. Granted this gets more difficult if the traffic is SSL encrypted for a https URL, but you should still see, if there is only one packet as response or a sequence of response packets.

And if the problem is related with your version of OpenOffice you will have to provide multiple samples for https and http for a meaningful bug report. So your effort won't be lost if you start investigating this now.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
binba
Posts: 2
Joined: Sat Dec 12, 2009 1:24 am

Re: SimpleFileAccess fails with HTTP link

Post by binba »

Well it absolutely doesn't work for me, here in the 2019 "future". Tried with both OOO 4.1.5 and 4.1.6 (Mac OS X 64bit 10.13.5).

The problem is that the title isn't accurate - SimpleFileAccess works with HTTP links, it fails with HTTPS links.
It gives the lovely error:
An exception occured
Type: com.sun.star.ucb.InteractiveNetworkReadException
Message: .

Basically it can't handle SSL handshakes, which are essential for modern communications.
Insert > Link to External Data fails in just the same way.

In comparison, the same libraries in LibreOffice (6.3.1.2) handle HTTPS. (Albeit struggle with certificate exceptions and such.)
NeoOffice 3.0.1 on Mac OS X PPC 10.5.8
Post Reply