Re: How to wrap a text/plain response to xforms:submission so it becomes XML
Posted by
Erik Bruchez on
Dec 18, 2010; 1:35am
URL: https://discuss.orbeon.com/How-to-wrap-a-text-plain-response-to-xforms-submission-so-it-becomes-XML-tp3093245p3093346.html
Mahender,
The way oxf:xforms-submission works is that if an error occurs, the
same instance that was passed in is returned.
You can't use targetref="/", because that would attempt to store text
at the root of an XML document, which is not allowed. Also, do I
understand right that in some cases, XML is returned, and in others,
text that is not XML?
You could try something like this:
<xforms:action ev:event="xforms-submit-error">
<xforms:insert context="/" origin="xxforms:element('text')"/>
<xforms:setvalue ref="/*" value="event('response-body')"/>
</xforms:action
-Erik
On Fri, Dec 17, 2010 at 2:58 PM, Mahender Didwania
<
[hidden email]> wrote:
> Hi,
>
> I work with an XML DB which, for certain operations, returns non-XML text/plain responses. Those operations are invoked using xforms submissions processor and I get this error in the logs:
>
> ERROR XFormsServer - xforms-submit-error - setting throwable {throwable: "org.orbeon.oxf.xforms.submission.XFormsSubmissionException: (processing instance replacement): Body received with non-XML media type for replace="instance": text/plain
> null, line -1, column -1: Body received with non-XML media type for replace="instance": text/plain
>
> Also, as a side-effect, the document which was submitted using xforms:submissions is populated in the response. I actually want to send the text/plain status response I receive from XML DB as the pipeline output.
>
> I tried replace="text" targetref="/" on the submission but that does not help.
>
> Any pointers on how to make xforms submissions processor happy with non-XML responses?
>
> Thanks,
> Mahender.
>
>
> --
> 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