OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Call server via HTTP and pass POST parameter(s)

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
schwangereskamel
Newbie
Newbie


Joined: 23 Jan 2007
Posts: 3
Location: Karlsruhe, Germany

PostPosted: Tue Jan 23, 2007 10:08 am    Post subject: Call server via HTTP and pass POST parameter(s) Reply with quote

Hi all,

I've been searching for some time now and I couldn't find a solution, neither here nor anywhere.
What I want to do is to pass POST parameters to a java servlet. What I tried so far is something like this:

Code:

  mediaDesc(0).Name = "PostString"
  mediaDesc(0).Value = "t=" + paramString
  mediaDesc(1).Name = "FilterName"
  mediaDesc(1).Value = "text"

  oDoc1 = StarDesktop.LoadComponentFromUrl("http://www.someurl.com/test?", "frameName", 63, mediaDesc)


However, I seem to be getting it wrong when it comes to the correct passing/formatting of the POST parameters. I tried PostData instead of PostString as well in combination with Danny's Byte/String conversion methods, but couldn't get that to work either.

Has anybody done that before and can help?
Thanks!

Tom
Back to top
View user's profile Send private message
TerryE
Super User
Super User


Joined: 16 Jul 2006
Posts: 550
Location: UK

PostPosted: Sat Jan 27, 2007 4:08 pm    Post subject: Reply with quote

According the XComponentLoader interface the Parameter Arguments
    These arguments specify component or filter specific behavior.

    For example, "ReadOnly" with a boolean value specifies whether the document is opened read-only. "FilterName" specifies the component type to create and the filter to use, for example: "Text - CSV". For more information see ::com::sun::star::document::MediaDescriptor .
In other words they aren't for what you are trying to do. Most servlets will process both POST and GET parameters.
_________________
Terry
WinXPSP3, OOo 2.4.1, Ubunto 8.04 for development
Also try the Official OOo Community Forum where I mainly post now.
Back to top
View user's profile Send private message Visit poster's website
schwangereskamel
Newbie
Newbie


Joined: 23 Jan 2007
Posts: 3
Location: Karlsruhe, Germany

PostPosted: Mon Jan 29, 2007 12:23 am    Post subject: Reply with quote

Thanks for the reply, Terry.

TerryE wrote:

For more information see ::com::sun::star::document::MediaDescriptor . In other words they aren't for what you are trying to do. Most servlets will process both POST and GET parameters.


I had already looked at the site you gave me, and at http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_1_5_1_1_MediaDescriptor
and if the PostData and PostString properties are not for what I am trying to do (passing parameters to a processing script on a web server), then what else should they be for? And what else would allow me to get the desired effect?

Cheers
Tom
Back to top
View user's profile Send private message
TerryE
Super User
Super User


Joined: 16 Jul 2006
Posts: 550
Location: UK

PostPosted: Mon Jan 29, 2007 1:52 am    Post subject: Reply with quote

Sorry you were right. I didn't read down far enough. If you want to know how the parameters postdata and poststring are used then have a look at the source code of the bit of OOo which executes this function: http://www.go-ooo.org/lxr/source/framework/framework/source/loadenv/loadenv.cxx#394
and maybe http://www.go-ooo.org/lxr/source/oi/ie/source/ctrl/idisp.cxx
but from these it looks as if it is expecting a straight post string sequence as you suggest. My only suggestion now is if you have access to your own webserver to create a simple script which echos back the post values and that way you can double check what is happening with this parse. Sorry that I can't be more help
_________________
Terry
WinXPSP3, OOo 2.4.1, Ubunto 8.04 for development
Also try the Official OOo Community Forum where I mainly post now.
Back to top
View user's profile Send private message Visit poster's website
schwangereskamel
Newbie
Newbie


Joined: 23 Jan 2007
Posts: 3
Location: Karlsruhe, Germany

PostPosted: Mon Jan 29, 2007 2:45 am    Post subject: Reply with quote

Thanks Terry, I'll check it out.
Back to top
View user's profile Send private message
Shine.P
General User
General User


Joined: 02 Jul 2009
Posts: 13

PostPosted: Wed Jul 08, 2009 6:22 am    Post subject: Reply with quote

Hi I am trying the same!
Any luck with this?
I want to post a lot of data in string to to servlet which is a URL!

Please help!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group