SimpleFileAccess fails with HTTP link

Creating a macro - Writing a Script - Using the API

SimpleFileAccess fails with HTTP link

Postby Mr.Dandy » Fri Oct 24, 2014 4:13 pm

Hello forum,

It seems that SimpleFileAccess service don't support HTTP link.
Code: Select all   Expand viewCollapse view
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.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 295
Joined: Tue Dec 11, 2012 4:22 pm

Re: SimpleFileAccess fails with HTTP link

Postby mauriciobaeza » Fri Oct 24, 2014 11:17 pm

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
mauriciobaeza
 
Posts: 56
Joined: Thu Apr 22, 2010 5:03 am

Re: SimpleFileAccess fails with HTTP link

Postby Mr.Dandy » Mon Oct 27, 2014 9:36 am

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.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 295
Joined: Tue Dec 11, 2012 4:22 pm

Re: SimpleFileAccess fails with HTTP link

Postby B Marcelly » Mon Oct 27, 2014 1:08 pm

Works for me also.
Ecran001.png
Returns True after several seconds.
Ecran001.png (3.04 KiB) Viewed 1307 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
B Marcelly
Volunteer
 
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: SimpleFileAccess fails with HTTP link

Postby mauriciobaeza » Mon Oct 27, 2014 4:51 pm

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
mauriciobaeza
 
Posts: 56
Joined: Thu Apr 22, 2010 5:03 am

Re: SimpleFileAccess fails with HTTP link

Postby Mr.Dandy » Wed Oct 29, 2014 12:43 pm

mauriciobaeza wrote:Update my signature...

But...
In your signature, you wrote:AOO 4.1

4.1.0 or 4.1.1?
OpenOffice 4.1.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 295
Joined: Tue Dec 11, 2012 4:22 pm

Re: SimpleFileAccess fails with HTTP link

Postby mauriciobaeza » Wed Oct 29, 2014 7:33 pm

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
mauriciobaeza
 
Posts: 56
Joined: Thu Apr 22, 2010 5:03 am

Re: SimpleFileAccess fails with HTTP link

Postby rudolfo » Sun Nov 02, 2014 1:54 am

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.
rudolfo
Volunteer
 
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: SimpleFileAccess fails with HTTP link

Postby Mr.Dandy » Mon Nov 03, 2014 4:23 pm

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.3 - Windows 7
User avatar
Mr.Dandy
 
Posts: 295
Joined: Tue Dec 11, 2012 4:22 pm

Re: SimpleFileAccess fails with HTTP link

Postby rudolfo » Tue Nov 04, 2014 1:33 am

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.
rudolfo
Volunteer
 
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: SimpleFileAccess fails with HTTP link

Postby binba » Wed Sep 11, 2019 9:32 pm

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
binba
 
Posts: 2
Joined: Sat Dec 12, 2009 1:24 am


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 8 guests