Search code examples
xmlorbeon

Performing submissions on Orbeon 4.9


Having some trouble performing submissions after upgrading to Orbeon 4.9.

The following submission was used as example:

<xf:submission action="http://localhost:7001/orbeon49/getValuesServlet"
id="OPEN_DOCUMENT"
method="post"
ref="instance('fr-form-instance')"
replace="instance">
</xf:submission>

And to call the submission, this code was used:

<xf:action ev:event="xforms-ready">
     <xf:send submission="OPEN_DOCUMENT"/>
</xf:action>

The submission is supposed to call a servlet which resides within the Orbeon application application that responds with an XML that updates the instance XML. In version 4.9 the servlet is never called and the submission fails. In version 4.6 this was working fine.

I reverted to version 4.7 just to try if a higher version than 4.6 makes a difference and it worked fine on 4.7 as well.

So, does this mean that the way we need to call submissions on 4.9 has changed?


Solution

  • This is likely due to the implementation of internal requests. Orbeon Forms, since 4.7, considers requests to itself as internal, and does not use an actual HTTP connection. However this will not work to call a servlet which is within the Orbeon web app.

    Orbeon Forms guesses internal requests by creating an absolute URL, and then checking whether it matches a path to itself, such as http://localhost:8080/orbeon/

    You could trick it to still cause that servlet by using an absolute URL such as, maybe http://127.0.0.1:8080/orbeon/.