[api-dev] Re: using connection and https

2011-06-09 Thread Stephan Bergmann
On Wed, May 25, 2011 at 5:46 PM, Fernand Vanrie s...@pmgroup.be wrote:

 Thanks again, BTW do you know who can give me more info about OO - SSL
 connections ?


Kai, you probably can tell whether OOo is able to make https connections
today, right?  I simply don't remember what the current status is.

-Stephan
-- 
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help


[api-dev] Re: using connection and https

2011-06-09 Thread Fernand Vanrie

Stephan,

it can: using the UCB, but i am still confused about the posting part 
of it


have a look at the forum 
http://www.oooforum.org/forum/viewtopic.phtml?t=88980


Greetz

Fernand
On Wed, May 25, 2011 at 5:46 PM, Fernand Vanrie s...@pmgroup.be 
mailto:s...@pmgroup.be wrote:


Thanks again, BTW do you know who can give me more info about OO -
SSL connections ?


Kai, you probably can tell whether OOo is able to make https 
connections today, right?  I simply don't remember what the current 
status is.


-Stephan


--
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help


[api-dev] Re: using connection and https

2011-06-09 Thread Stephan Bergmann
Ah, sorry, didn't read the thread very carefully (just catching up with mail
after vacation).

-Stephan
-- 
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help


[api-dev] Re: using connection and https

2011-05-25 Thread Christian Lohmaier
Hi Fernand, *,

On Wed, May 25, 2011 at 9:24 AM, Fernand Vanrie s...@pmgroup.be wrote:

 I trie to connect to Googleapis using OO and https ?

 Code:
 oConnector = createUnoService(com.sun.star.connection.Connector)
 oConnection = oConnector.connect(socket,host=www.googleapis.com,port=80)

first: don't know whether it is  supported by OOo like this, but your
example has several general problems, so here we go...

If you want to use ssl, then you should try with the default ssl-port (443)

 oConnection.write( StringToByteArray( GET
 https://www.googleapis.com/tasks/v1/lists/MDk5Nzc1MDY0NzQyMTk4NjEyMzM6MDow/tasks/MDk5Nzc1MDY0NzQyMTk4NjEyMzM6MDo4?pp=1key=

And http GET doesn't include the hostname, just the path. Specify the
host in the Host parameter.

https://www.googleapis.com/tasks/v1/lists/MDk5Nzc1MDY0NzQyMTk4NjEyMzM6MDow/tasks/MDk5Nzc1MDY0NzQyMTk4NjEyMzM6MDo4?pp=1key={YOUR_API_KEY}

and you're not supposed to write it twice either, but maybe I'm
getting things wrong here.
And obviously YOUR_API_KEY is to be replaced by your API key.

it's
GET /path/to?param=valueparam2=value2 HTTP/1.1
Host: www.myhost.com
Connection: close

(well, connection: close as it is the only request, you can also just
use http 1.0 request that only have one request at a time anyway)

ciao
Christian
-- 
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help


[api-dev] Re: using connection and https

2011-05-25 Thread Fernand Vanrie

Christian ,

Thanks for your valuable help.

After i succeeded to use the OO connection stuff to use Google 
Translations i was tempted to use the newest Google Tasks API too.


Using port 443  i get no respons at all ?
I left my API_Key out for security reasons.
But

In my working code for Translations i used
GET http://ajax.googleapis.com/

so i am a bit confused about the syntax to make HHTP requests :-)

sub GoogleTranslate
cCR = Chr(13)
cLF = Chr(10)
oConnector = createUnoService(com.sun.star.connection.Connector)
oConnection = 
oConnector.connect(socket,host=www.googleapis.com,port=80) 
'je%20suis%20au%20l'intérieur%20du%20magazin

sToTranslate = voetbal
sSourceLang = nl
sTargetLang = en
oConnection.write( StringToByteArray( GET 
http://ajax.googleapis.com/ajax/services/language/translate?v=1.0q=; 
sToTranslate  langpair=  sSourceLang  |  sTargetlang  + cCR + 
cLF+ cCR +cLF ) )

oConnection.flush()
aByteArray  = Array()
nBytesRead = oConnection.read(aByteArray, 1000)
 oPipe= createUNOService (com.sun.star.io.Pipe) ' heeft zowel een 
In als OUtput stream

oTextInp = createUNOService (com.sun.star.io.TextInputStream) 'kan lezen
oTextOut = createUNOService (com.sun.star.io.TextOutputStream)' kan 
schrijven

oTextInp.setInputStream(opipe) 'maakt dat pipe kan lezen
otextOut.setOutputStream(opipe) 'maakt dat pipe kan schrijven
otextout.setencoding(ISO-8859-1)
otextOut.writestring(ByteArrayToString(aByteArray)) 'schrijft de string 
naar Pipe

s = oTextinp.readstring(Array(}), true)
msgbox(s)
end sub


Hi Fernand, *,

On Wed, May 25, 2011 at 9:24 AM, Fernand Vanries...@pmgroup.be  wrote:

I trie to connect to Googleapis using OO and https ?

Code:
oConnector = createUnoService(com.sun.star.connection.Connector)
oConnection = oConnector.connect(socket,host=www.googleapis.com,port=80)

first: don't know whether it is  supported by OOo like this, but your
example has several general problems, so here we go...

If you want to use ssl, then you should try with the default ssl-port (443)


oConnection.write( StringToByteArray( GET
https://www.googleapis.com/tasks/v1/lists/MDk5Nzc1MDY0NzQyMTk4NjEyMzM6MDow/tasks/MDk5Nzc1MDY0NzQyMTk4NjEyMzM6MDo4?pp=1key=

And http GET doesn't include the hostname, just the path. Specify the
host in the Host parameter.

https://www.googleapis.com/tasks/v1/lists/MDk5Nzc1MDY0NzQyMTk4NjEyMzM6MDow/tasks/MDk5Nzc1MDY0NzQyMTk4NjEyMzM6MDo4?pp=1key={YOUR_API_KEY}

and you're not supposed to write it twice either, but maybe I'm
getting things wrong here.
And obviously YOUR_API_KEY is to be replaced by your API key.

it's
GET /path/to?param=valueparam2=value2 HTTP/1.1
Host: www.myhost.com
Connection: close

(well, connection: close as it is the only request, you can also just
use http 1.0 request that only have one request at a time anyway)

ciao
Christian


--
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help


[api-dev] Re: using connection and https

2011-05-25 Thread Christian Lohmaier
On Wed, May 25, 2011 at 4:01 PM, Fernand Vanrie s...@pmgroup.be wrote:
 Christian ,

 Thanks for your valuable help.

 After i succeeded to use the OO connection stuff to use Google Translations
 i was tempted to use the newest Google Tasks API too.

 Using port 443  i get no respons at all ?

As written before: I don't know whether this is the correct way to set
up a ssl connection. I kind of doubt that it handles that
automatically.

 I left my API_Key out for security reasons.
 But

 In my working code for Translations i used
 GET http://ajax.googleapis.com/

 so i am a bit confused about the syntax to make HHTP requests :-)

yes, absolute URL is valid, but rather only when talking to a proxy.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2
The most common form of Request-URI is that used to identify a
resource on an origin server or gateway. In this case the absolute
path of the URI MUST be transmitted (see section 3.2.1, abs_path) as
the Request-URI, and the network location of the URI (authority) MUST
be transmitted in a Host header field. For example, a client wishing
to retrieve the resource above directly from the origin server would
create a TCP connection to port 80 of the host www.w3.org and send
the lines:

note the use of MUST - when talking to the origin directly, you (if
you want to comply with the protocol) MUST use the absolute path, and
not the full URL

ciao
Christian
-- 
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help


[api-dev] Re: using connection and https

2011-05-25 Thread Fernand Vanrie

Christian ,

Thanks again, BTW do you know who can give me more info about OO - SSL 
connections ?


Greetz

Fernand

On Wed, May 25, 2011 at 4:01 PM, Fernand Vanries...@pmgroup.be  wrote:

Christian ,

Thanks for your valuable help.

After i succeeded to use the OO connection stuff to use Google Translations
i was tempted to use the newest Google Tasks API too.

Using port 443  i get no respons at all ?

As written before: I don't know whether this is the correct way to set
up a ssl connection. I kind of doubt that it handles that
automatically.


I left my API_Key out for security reasons.
But

In my working code for Translations i used
GET http://ajax.googleapis.com/

so i am a bit confused about the syntax to make HHTP requests :-)

yes, absolute URL is valid, but rather only when talking to a proxy.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2
The most common form of Request-URI is that used to identify a
resource on an origin server or gateway. In this case the absolute
path of the URI MUST be transmitted (see section 3.2.1, abs_path) as
the Request-URI, and the network location of the URI (authority) MUST
be transmitted in a Host header field. For example, a client wishing
to retrieve the resource above directly from the origin server would
create a TCP connection to port 80 of the host www.w3.org and send
the lines:

note the use of MUST - when talking to the origin directly, you (if
you want to comply with the protocol) MUST use the absolute path, and
not the full URL

ciao
Christian


--
-
To unsubscribe send email to dev-unsubscr...@api.openoffice.org
For additional commands send email to sy...@api.openoffice.org
with Subject: help