| View previous topic :: View next topic |
| Author |
Message |
schwangereskamel Newbie

Joined: 23 Jan 2007 Posts: 3 Location: Karlsruhe, Germany
|
Posted: Tue Jan 23, 2007 10:08 am Post subject: Call server via HTTP and pass POST parameter(s) |
|
|
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 |
|
 |
TerryE Super User

Joined: 16 Jul 2006 Posts: 550 Location: UK
|
Posted: Sat Jan 27, 2007 4:08 pm Post subject: |
|
|
According the XComponentLoader interface the Parameter ArgumentsThese 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 |
|
 |
schwangereskamel Newbie

Joined: 23 Jan 2007 Posts: 3 Location: Karlsruhe, Germany
|
Posted: Mon Jan 29, 2007 12:23 am Post subject: |
|
|
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 |
|
 |
TerryE Super User

Joined: 16 Jul 2006 Posts: 550 Location: UK
|
Posted: Mon Jan 29, 2007 1:52 am Post subject: |
|
|
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 |
|
 |
schwangereskamel Newbie

Joined: 23 Jan 2007 Posts: 3 Location: Karlsruhe, Germany
|
Posted: Mon Jan 29, 2007 2:45 am Post subject: |
|
|
| Thanks Terry, I'll check it out. |
|
| Back to top |
|
 |
Shine.P General User

Joined: 02 Jul 2009 Posts: 13
|
Posted: Wed Jul 08, 2009 6:22 am Post subject: |
|
|
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 |
|
 |
|