Hi, I believe on the record I am the second person after Matthew
Graham posting a question related to the OXFException Body received with non-XML media type for
replace="instance": text/html [1], even through the
causes mighty be different. The problem is in navigating from one page’s vew (xhtml) to other
page’s model (xpl), I kept receiving following logged error about the
submitted XForms instance: 2006-09-21 00:15:45,524 DEBUG processor.XFormsServer -
XForms - setting request body: <?xml version="1.0"
encoding="UTF-8"?><status
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:f="http://orbeon.org/function" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xforms="http://www.w3.org/2002/xforms"><action>get-app-data</action><selected-id>R100236321</selected-id></status> 2006-09-21 00:15:45,586 INFO webapp.ProcessorService -
/lts-poc/query-app-data - Received request 2006-09-21 00:15:45,664 INFO webapp.ProcessorService -
/lts-poc/query-app-data - Timing: 78 - Cache hits: 189, fault: 51, adds: 48,
success rate: 78% 2006-09-21 00:15:45,680 DEBUG processor.XFormsServer - XForms - submit error
throwable: org.orbeon.oxf.common.OXFException: Body received with non-XML media
type for replace="instance": text/html at
org.orbeon.oxf.xforms.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:548) …. The request body has been proved well-formed if cut-and-paste
to and then checked by an XML Editor, such as Oxygen. I wonder if that error is only specific to OPS 3.5M1, but I haven’t
restored the OPS back to 3.0.1 for comparison. Have anyone got a clue? Regards, Spenser Kao [1] http://mail-archive.objectweb.org/ops-users/2006-09/msg00083.html -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Spenser,
> I believe on the record I am the second person after Matthew Graham > posting a question related to the OXFException *Body received with > non-XML media type for replace="instance": text/html* [1], even through > the causes mighty be different. > > The problem is in navigating from one page’s vew (xhtml) to other page’s > model (xpl), I kept receiving following logged error about the submitted > XForms instance: > > 2006-09-21 00:15:45,524 DEBUG processor.XFormsServer - XForms - setting > request body: *<?xml version="1.0" encoding="UTF-8"?><status > xmlns="http://www.w3.org/1999/xhtml" > xmlns:xi="http://www.w3.org/2001/XInclude" > xmlns:f="http://orbeon.org/function" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xforms="http://www.w3.org/2002/xforms"><action>get-app-data</action><selected-id>R100236321</selected-id></status>* > > 2006-09-21 00:15:45,586 INFO webapp.ProcessorService - > /lts-poc/query-app-data - Received request > > 2006-09-21 00:15:45,664 INFO webapp.ProcessorService - > /lts-poc/query-app-data - Timing: 78 - Cache hits: 189, fault: 51, adds: > 48, success rate: 78% > > 2006-09-21 00:15:45,680 DEBUG processor.XFormsServer - *XForms - submit > error throwable: org.orbeon.oxf.common.OXFException: Body received with > non-XML media type for replace="instance": text/html* > > at > org.orbeon.oxf.xforms.XFormsModelSubmission.performDefaultAction(XFormsModelSubmission.java:548) > > …. > > > > The request body has been proved well-formed if cut-and-paste to and > then checked by an XML Editor, such as Oxygen. > > > > I wonder if that error is only specific to OPS 3.5M1, but I haven’t > restored the OPS back to 3.0.1 for comparison. > > Have anyone got a clue? find if your request is well-formed, but what does your response contain, and, more importantly, what Content-Type header does it produce? -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Erik,
Two Questions here: 1. What's the default content-type of <xforms:submission>? Is it text/html? 2. In one of my test cases, I use a) <xforms:bind> to bind a selected-id that's derived from index() of a table, b) <xforms:submit> to setvalue with that selected-id, followed by the execution of c) <xforms:submission>. Strangely, I found that the submitted selected-id won't be the most update value, but previous one. Meaning that only after the submission is executed (with the old value), the selected-id will get updated. Is there such a synchronization issue? Or is there some optional attribute needs to be set for <xforms:submission> or <xforms:submit> to avoid the problem? Regards, Spenser -----Original Message----- From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez Sent: Thursday, 21 September 2006 1:39 AM To: [hidden email] Subject: Re: [ops-users] OXFException: Body received with non-XML media type for replace="instance": text/html Spenser, > I believe on the record I am the second person after Matthew Graham > posting a question related to the OXFException *Body received with > non-XML media type for replace="instance": text/html* [1], even through > the causes mighty be different. > > The problem is in navigating from one page's vew (xhtml) to other page's > model (xpl), I kept receiving following logged error about the submitted > XForms instance: > > 2006-09-21 00:15:45,524 DEBUG processor.XFormsServer - XForms - setting > request body: *<?xml version="1.0" encoding="UTF-8"?><status > xmlns="http://www.w3.org/1999/xhtml" > xmlns:xi="http://www.w3.org/2001/XInclude" > xmlns:f="http://orbeon.org/function" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events" > > > 2006-09-21 00:15:45,586 INFO webapp.ProcessorService - > /lts-poc/query-app-data - Received request > > 2006-09-21 00:15:45,664 INFO webapp.ProcessorService - > /lts-poc/query-app-data - Timing: 78 - Cache hits: 189, fault: 51, adds: > 48, success rate: 78% > > 2006-09-21 00:15:45,680 DEBUG processor.XFormsServer - *XForms - submit > error throwable: org.orbeon.oxf.common.OXFException: Body received with > non-XML media type for replace="instance": text/html* > > at > > > .. > > > > The request body has been proved well-formed if cut-and-paste to and > then checked by an XML Editor, such as Oxygen. > > > > I wonder if that error is only specific to OPS 3.5M1, but I haven't > restored the OPS back to 3.0.1 for comparison. > > Have anyone got a clue? find if your request is well-formed, but what does your response contain, and, more importantly, what Content-Type header does it produce? -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Spenser,
have you tried to turn on the xforms debug in config/log4j.xml? I find this quite usefull. See previous posting by me for detailed howto: http://mail-archive.objectweb.org/ops-users/index.html http://mail-archive.objectweb.org/ops-users/2006-09/msg00057.html Hope that helps. Henrik On 9/21/06, Spenser Kao <[hidden email]> wrote: Hi Erik, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Spenser Kao
Sepnser,
1. I believe the default content type for a submit is text/xml. 2. Here is an example (I'm not using bind, but I believe that is not relevant to your problem): <xforms:instance id="selection"> <aspic:selections> <!-- using xslt to initialize the instance at page load only --> <xsl:for-each select="/aspic:queries/aspic:query"> <aspic:selection> <xsl:copy-of select="."/> <xsl:copy-of select="/aspic:queries/aspic:knowledgebase[1]"/> <aspic:answer aspic:findanswer="false" /> </aspic:selection> </xsl:for-each> </aspic:selections> </xforms:instance> </xforms:instance> <xforms:submission id="execute-query-submission" method="post" ref="instance('selection')" action="/query/execute" replace="instance"/> <!-- For Asynchronous updates only ( i.e. update data with no page refresh). --> <!-- Otherwise, just leave it out --> <xforms:trigger appearance="xxforms:link"> <xforms:label>Show Result</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('selection')/aspic:selection[index('queries-repeat')]/aspic: answer/@aspic:findanswer">true</xforms:setvalue> <xforms:send submission="execute-query-submission"/> </xforms:action> </xforms:trigger> Hope that helps. Henrik On 9/21/06, Spenser Kao <[hidden email]> wrote:
Hi Erik, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Spenser Kao
Spenser Kao wrote:
> Hi Erik, > > Two Questions here: > > 1. What's the default content-type of <xforms:submission>? Is it text/html? The body is XML, so we use "application/xml" (also per the spec). > 2. In one of my test cases, I use a) <xforms:bind> to bind a selected-id > that's derived from index() of a table, b) <xforms:submit> to setvalue with > that selected-id, followed by the execution of c) <xforms:submission>. > Strangely, I found that the submitted selected-id won't be the most update > value, but previous one. Meaning that only after the submission is executed > (with the old value), the selected-id will get updated. > Is there such a synchronization issue? Or is there some optional attribute > needs to be set for <xforms:submission> or <xforms:submit> to avoid the > problem? This is an issue we have been discussing at the W3C (more specifically, that of applying MIPs before submission). Until we implement the latest WG decisions (this will officially be in XForms 1.1), you can manually call xforms:recalculate before calling xforms:send. Note that this is easier to do with xforms:trigger than xforms:submit. So instead of writing: <xforms:submit submission="my-submission"> <xforms:label>Submit</xforms:label> </xforms:submit> Try: <xforms:trigger> <xforms:label>Submit</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:recalculate/> <xforms:send submission="my-submission"/> </xforms:action> </xforms:submit> -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Erik,
First, <xforms:recalculate> has done trick, once I added it into the already used <xforsm:trigger>, thank you. Secondly, allow me to revisit the OXFException error message. What's the real meaning of that error message, what has it tried to suggest? As the result of the submission would be carried over to an xpl file thru navigation, the OXFException message must suggest that the submission result content has to be xml content, am I correct? If that's the case, then what's wrong with the request body content, which is shown in the log file - it got the <?xml ..?> header and well-formed : <?xml version="1.0" encoding="UTF-8"?> <status xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:f="http://orbeon.org/function" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms"> <action>get-app-data</action> <selected-id>R100236321</selected-id> </status> Or actually the OXFException error suggests otherwise? I have tried various content types in the <xforms:submission> element: default(or application/xml), text/html or even text/plain, all pointed to the same error. Clue please? Regards, Spenser -----Original Message----- From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez Sent: Friday, 22 September 2006 2:30 AM To: [hidden email] Subject: Re: [ops-users] OXFException: Body received with non-XML media type for replace="instance": text/html Spenser Kao wrote: > Hi Erik, > > Two Questions here: > > 1. What's the default content-type of <xforms:submission>? Is it text/html? The body is XML, so we use "application/xml" (also per the spec). > 2. In one of my test cases, I use a) <xforms:bind> to bind a selected-id > that's derived from index() of a table, b) <xforms:submit> to setvalue with > that selected-id, followed by the execution of c) <xforms:submission>. > Strangely, I found that the submitted selected-id won't be the most update > value, but previous one. Meaning that only after the submission is executed > (with the old value), the selected-id will get updated. > Is there such a synchronization issue? Or is there some optional attribute > needs to be set for <xforms:submission> or <xforms:submit> to avoid the > problem? This is an issue we have been discussing at the W3C (more specifically, that of applying MIPs before submission). Until we implement the latest WG decisions (this will officially be in XForms 1.1), you can manually call xforms:recalculate before calling xforms:send. Note that this is easier to do with xforms:trigger than xforms:submit. So instead of writing: <xforms:submit submission="my-submission"> <xforms:label>Submit</xforms:label> </xforms:submit> Try: <xforms:trigger> <xforms:label>Submit</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:recalculate/> <xforms:send submission="my-submission"/> </xforms:action> </xforms:submit> -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Erik,
Further update you my finding on this regard. By specifically looking for the message containing keywords "XForms - setting request body", I notice there are two categories of its kind: those start with <?xml ... ?> XML declaration, and those without. The latter category message always follow those XForms NG demo codes I tested with successful XForms instance traversing; while the former one is my XForms NG-based app that is experiencing the OXFException error. I am still trying to figure out where the xml declaration is coming from. Please see my setting for modelling, including binding, and triggering below. BTW, does <xforms:submission> support omit-xml-declaration attribute? No, neither W3C XForms 1.1 spec http://www.w3.org/TR/xforms11/ nor XForms references http://www.orbeon.com/ops/doc/reference-xforms-ng made such discussion. Regards, Spenser <xforms:model> <xforms:instance id="app-ids-instance"> <xi:include href="input:data"/> </xforms:instance> <xforms:instance id="status"> <status xmlns=""> <action/> <selected-app-id/> <selected-index/> </status> </xforms:instance> <xforms:submission id="search-app-data" ref="instance('status')" method="post" action="/lts-poc/query-app-data" instance="status" replace="instance"> </xforms:submission> <xforms:bind nodeset="instance('status')"> <xforms:bind nodeset="selected-index" calculate="index('app-id-repeat')" constraint=". >= 1" required="true()"/> <xforms:bind nodeset="selected-app-id" calculate="instance('app-ids-instance')//Application_ID[index('app-id-repeat ')]/ID" required="true()"/> </xforms:bind> </xforms:model> <xforms:repeat nodeset="//Application_ID" id="app-id-repeat"> <tr> <td align="right"> <xforms:output mediatype="application/xml" value="position()"/> </td> <td align="center"> <xforms:output mediatype="application/xml" ref="ID"/> </td> <td align="center"> <xforms:group ref="instance('status')"> <xforms:trigger appearance="xxforms:link"> <xforms:label>View</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="action">get-app-data</xforms:setvalue> <xforms:setvalue ref="selected-app-index"/> <xforms:setvalue ref="selected-app-id"/> <xforms:recalculate/> <xforms:send submission="search-app-data"/> </xforms:action> </xforms:trigger> </xforms:group> </td> </tr> </xforms:repeat> Regards, Spenser -----Original Message----- From: Spenser Kao [mailto:[hidden email]] Sent: Friday, 22 September 2006 6:31 AM To: [hidden email] Cc: 'Mike Thanos'; 'Lou'; 'Brad Heaton' Subject: RE: [ops-users] OXFException: Body received with non-XML media type for replace="instance": text/html Hi Erik, First, <xforms:recalculate> has done trick, once I added it into the already used <xforsm:trigger>, thank you. Secondly, allow me to revisit the OXFException error message. What's the real meaning of that error message, what has it tried to suggest? As the result of the submission would be carried over to an xpl file thru navigation, the OXFException message must suggest that the submission result content has to be xml content, am I correct? If that's the case, then what's wrong with the request body content, which is shown in the log file - it got the <?xml ..?> header and well-formed : <?xml version="1.0" encoding="UTF-8"?> <status xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:f="http://orbeon.org/function" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms"> <action>get-app-data</action> <selected-id>R100236321</selected-id> </status> Or actually the OXFException error suggests otherwise? I have tried various content types in the <xforms:submission> element: default(or application/xml), text/html or even text/plain, all pointed to the same error. Clue please? Regards, Spenser -----Original Message----- From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez Sent: Friday, 22 September 2006 2:30 AM To: [hidden email] Subject: Re: [ops-users] OXFException: Body received with non-XML media type for replace="instance": text/html Spenser Kao wrote: > Hi Erik, > > Two Questions here: > > 1. What's the default content-type of <xforms:submission>? Is it text/html? The body is XML, so we use "application/xml" (also per the spec). > 2. In one of my test cases, I use a) <xforms:bind> to bind a selected-id > that's derived from index() of a table, b) <xforms:submit> to setvalue with > that selected-id, followed by the execution of c) <xforms:submission>. > Strangely, I found that the submitted selected-id won't be the most update > value, but previous one. Meaning that only after the submission is executed > (with the old value), the selected-id will get updated. > Is there such a synchronization issue? Or is there some optional attribute > needs to be set for <xforms:submission> or <xforms:submit> to avoid the > problem? This is an issue we have been discussing at the W3C (more specifically, that of applying MIPs before submission). Until we implement the latest WG decisions (this will officially be in XForms 1.1), you can manually call xforms:recalculate before calling xforms:send. Note that this is easier to do with xforms:trigger than xforms:submit. So instead of writing: <xforms:submit submission="my-submission"> <xforms:label>Submit</xforms:label> </xforms:submit> Try: <xforms:trigger> <xforms:label>Submit</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:recalculate/> <xforms:send submission="my-submission"/> </xforms:action> </xforms:submit> -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Spenser Kao
Spenser,
> First, <xforms:recalculate> has done trick, once I added it into the already > used <xforsm:trigger>, thank you. Great! > Secondly, allow me to revisit the OXFException error message. > What's the real meaning of that error message, what has it tried to suggest? > > As the result of the submission would be carried over to an xpl file thru > navigation, the OXFException message must suggest that the submission result > content has to be xml content, am I correct? > > If that's the case, then what's wrong with the request body content, which > is shown in the log file - it got the <?xml ..?> header and well-formed : Your body content appears to be fine. The issue is with the media type specified by the HTTP *response* Content-Type header. In your case, the XML document returned in the HTTP response, which is otherwise fine, is *returned* with an incorrect *Content-Type* header which tells the XForms engine that the body of the response is not XML, but HTML. Hence the exception. This has nothing to do with the mediatype that you set on xforms:submission, as that mediatype controls the HTTP Content-Type header of the *request*, not the *response*. What you need to look at is why whoever produces your HTTP response specifies Content-Type header with value text/html instead of one that specifies a header with value application/xml. -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Spenser Kao
Spenser,
> Further update you my finding on this regard. > > By specifically looking for the message containing keywords "XForms - > setting request body", I notice there are two categories of its kind: those > start with <?xml ... ?> XML declaration, and those without. Interesting. > The latter category message always follow those XForms NG demo codes I > tested with successful XForms instance traversing; while the former one is > my XForms NG-based app that is experiencing the OXFException error. I am > still trying to figure out where the xml declaration is coming from. Please > see my setting for modelling, including binding, and triggering below. > > BTW, does <xforms:submission> support omit-xml-declaration attribute? No, > neither W3C XForms 1.1 spec http://www.w3.org/TR/xforms11/ nor XForms > references http://www.orbeon.com/ops/doc/reference-xforms-ng made such > discussion. XForms does support this: http://www.w3.org/TR/xforms/slice3.html#structure-model-submission OPS implements omit-xml-declaration, but I don't think that should impact your issue, since again the issue you are experiencing is not on the XForms side but on the side of whoever produces the HTTP response. -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |