Creating Form Using Persistence REST API Error 400.

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

Creating Form Using Persistence REST API Error 400.

Joel Oates
This post was updated on .
Hello!

We have been using the Orbeon persistence API to create forms using
templates we have created.

Firstly, I am creating a template, and publishing it. I then am trying to
use the API to create a form using that template. My template details are as
follow.

Application Name: Test_Form
Form: Test_Form

The content of the template is just a simple input. Now I want to create a
new form with that template with the following

Method: PUT
URL:
http://localhost:8080/orbeon/fr/service/persistence/crud/Test_Form/Test_Form/data/123/data.xml
Content-Type: application/xml

Body:

<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      fr:data-format-version="4.0.0">
   <section-1>
        <control-1/>
   </section-1>
</form>

When I do this I get an error 400 back. The funny thing here is that this
same call used to work.. I don't get any errors in the logs, I just get a
400 back.

I have tried wiping my database (Drop Database and recreating it)
Doing a very simple example (The on above)

Any idea on whats going on here?

Thanks,
Joel.

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+unsubscribe@googlegroups.com.
To post to this group, send email to orbeon@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1559001108127-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Creating Form Using Persistence REST API Error 400.

Joel Oates
I have found the issue here, It was to do with my versioning header,

I had 'Orbeon-Form-Definition-Version: 2 (Copied from the Documentation)
Instead I should have had Orbeon-Form-Definition-Version: 2

The reason this would have worked the first time, is because there was no
other forms (I guess?)

Thanks Anyway!

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1559003795176-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Creating Form Using Persistence REST API Error 400.

Alessandro  Vernet
Administrator
Hi Joel,

I'm glad it's working for you now. But for those finding this thread, what
was the change to the header? (In your message, you're saying "I had X.
Instead I should have had X", but X is the same in both cases.)

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1559150176197-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet