Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


I'm looking for a way to post text data I get from a text field within a writer odt document.

My macro looks like this:

  sURL = "https://myserver/webservice/index.php";
  sBody = "param1=" & stextfield1

  oInput = Post(sURL, sBody)

Function Post(sURL As String, sBody As String) As Variant
  oUCB = CreateUnoService("")
  oId = oUCB.createContentIdentifier(sURL)
  oContent = oUCB.queryContent(oId)
  oDataSink = CreateUnoListener("XDataSink_", _
  oCommandEnv = CreateUnoListener("XCommandEnv_", _
  oBodyStream = CreateUnoService("")
  oTextOutput = CreateUnoService("")
  oPostArgs = CreateUnoStruct("")
  oPostArgs.Source = oBodyStream
  oPostArgs.Sink = oDataSink
  aCommand = CreateUnoStruct("")
  aCommand.Name = "post"
  aCommand.Argument = oPostArgs
  oRet = oContent.execute(aCommand, -1, oCommandEnv)
  oInput = oDataSink.getInputStream()
  Post = oInput
End Function
Dim oStream As Variant
Function XDataSink_setInputStream(oLocStream As Variant)
  oStream = oLocStream
End Function
Function XDataSink_getInputStream() As Variant
  XDataSink_getInputStream = oStream
End Function
Function XCommandEnv_getInteractionHandler()' As Variant
  XCommandEnv_getInteractionHandler = CreateUnoListener(_
      "XInteractionHandle_", "")
End Function
Function XCommandEnv_getProgressHandler()' As Variant
  XCommandEnv_getProgressHandler = CreateUnoListener(_
      "XProgressHandle_", "")
End Function
Function XInteractionHandle_handle(oRequest)
End Function
Function XProgressHandle_push(nStatus)
End Function
Function XProgressHandle_update(nStatus)
End Function
Function XProgressHandle_pop()
End Function

However, my PHP script doesn't receive the 'param1' variable despite the fact that it does receive 
a POST request.

What am I doing wrong?
Are there other methods to do this?



To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.