Loading initial instance in a HTTP POST

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Loading initial instance in a HTTP POST

Nobry
Hello,

I need to continue an instance in Form Runner with the instance data stored in another server.

Following the instruction at http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties/configuration-properties-form-runner#TOC-Initial-instance-posted-to-the-New-
I can POST using a form in a test webpage to Form Runner and get my instance.

The problem is that I also need to send a header attribute, so I try to POST the same data using Java code but it doesn't work, I'm getting various error message like "Base64 input must be a multiple of four characters" or "Invalid byte value '2'", or just a blank form with the default instance.

I have checked the Base64 conversion on the client side or on the server side before sending it to Orbeon using the test webpage and it works.

In short: I can't resume/modify a form using Java code and with the data on another server I need to use the header forwarding feature in Form Runner.
Reply | Threaded
Open this post in threaded view
|

Re: Loading initial instance in a HTTP POST

Erik Bruchez
Administrator
Could it be that spaces or line breaks in the Base64-encoded value do
not exactly match what Orbeon Forms expect?

-Erik

On Fri, Dec 9, 2011 at 12:01 PM, Nobry <[hidden email]> wrote:

> Hello,
>
> I need to continue an instance in Form Runner with the instance data stored
> in another server.
>
> Following the instruction at
> http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties/configuration-properties-form-runner#TOC-Initial-instance-posted-to-the-New-
> I can POST using a form in a test webpage to Form Runner and get my
> instance.
>
> The problem is that I also need to send a header attribute, so I try to POST
> the same data using Java code but it doesn't work, I'm getting various error
> message like "Base64 input must be a multiple of four characters" or
> "Invalid byte value '2'", or just a blank form with the default instance.
>
> I have checked the Base64 conversion on the client side or on the server
> side before sending it to Orbeon using the test webpage and it works.
>
> In short: I can't resume/modify a form using Java code and with the data on
> another server I need to use the header forwarding feature in Form Runner.
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Loading-initial-instance-in-a-HTTP-POST-tp4178031p4178031.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Loading initial instance in a HTTP POST

Nobry
Thanks for the reply.

I found the problem and it was not exactly about the line break:

When I tried coding in Base64 on the client side:
- The implementation I found give me problems when encoding accents, giving me the "Invalid byte value"

On the server side:
- Encoding in chunk would add \n\r at the end, this doesn't seem to be good, \n only works in my test form
- An implementation of Base64 encoding doesn't seem to give me the right encoded data, I'm now using the GWT implementation.
- I was missing another encoding before sending to Orbeon: url-encoding.

This last point was the problem in my case.

Nobry.
Reply | Threaded
Open this post in threaded view
|

Re: Loading initial instance in a HTTP POST

Nobry
Err, what I meant by using the GWT implementation of Base64 encoding, I meant NOT using it.
Something didn't fit with it, but the Apache commons-codec did work. That's what I'm using.