Hi, I have created a custom processor which works fine with orbeon 3.6.
Body received with non-XML media type for replace="instance": text/html Looking in the orbeon code it seems that in the InstanceReplacer orbeon is expecting to receive xml (text/xml, …).
Can you please tell me what I should do to correct this? Another issue I ran into is that I used to work with relative path for my submission. I seems this is not working anymore? Am I correct? Thanks, Antoine -- 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 |
Administrator
|
Antoine,
Are you running a submission over HTTP? Then the result should have the content type set to application/xml. How is the result from that submission generated? And relative paths do work (as far as I know!). Could you create an example that shows this issue so we can run it here? Alex On Tue, Apr 27, 2010 at 8:41 AM, <[hidden email]> wrote: > Hi, > > I have created a custom processor which works fine with orbeon 3.6. > I just installed the 3.8-beta version and now I have the following error > when I try to save a form > > Body received with non-XML media type for replace="instance": text/html > > Looking in the orbeon code it seems that in the InstanceReplacer orbeon is > expecting to receive xml (text/xml, …). > I tried in my processor to set the contentType on the response but it dit > not change anything. > > Can you please tell me what I should do to correct this? > > Another issue I ran into is that I used to work with relative path for my > submission. I seems this is not working anymore? Am I correct? > > Thanks, > > Antoine > > -- > 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 > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
OK, I'll try to put this together but it will take me some time.
As I can see you have tagged the RC1 in git so I'm very excited to start working with this new version! The response sent back by our processor is generated using JAXB What we do is something like this import org.dom4j.Document; import org.dom4j.io.DocumentResult; ... public void generateData(PipelineContext context, ContentHandler contentHandler) throws Exception { DocumentResult docResult = new DocumentResult(); MarshallerFactory.getMarshaller().marshal(thisIsMyObject, docResult); LocationSAXWriter saxWriter = new LocationSAXWriter(); saxWriter.setContentHandler(contentHandler); saxWriter.write(xmlDocument.getDocument()); } For the relative path, on my submission I have <submission ... action="../../saveForm"/> When I do this I have an error in the the BaseSubmission.java (line 44) class: assert NetUtils.urlHasProtocol(resolvedActionOrResource) || resolvedActionOrResource.startsWith("/"); Thanks! Antoine -----Original Message----- From: Alessandro Vernet [mailto:[hidden email]] Sent: Friday, April 30, 2010 5:24 AM To: [hidden email] Subject: [ops-users] Re: Body received with non-XML media type for replace="instance": text/html Antoine, Are you running a submission over HTTP? Then the result should have the content type set to application/xml. How is the result from that submission generated? And relative paths do work (as far as I know!). Could you create an example that shows this issue so we can run it here? Alex On Tue, Apr 27, 2010 at 8:41 AM, <[hidden email]> wrote: > Hi, > > I have created a custom processor which works fine with orbeon 3.6. > I just installed the 3.8-beta version and now I have the following error > when I try to save a form > > Body received with non-XML media type for replace="instance": text/html > > Looking in the orbeon code it seems that in the InstanceReplacer orbeon is > expecting to receive xml (text/xml, …). > I tried in my processor to set the contentType on the response but it dit > not change anything. > > Can you please tell me what I should do to correct this? > > Another issue I ran into is that I used to work with relative path for my > submission. I seems this is not working anymore? Am I correct? > > Thanks, > > Antoine > > -- > 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 > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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 |
Administrator
|
Antoine,
Sure, it will be easier to figure this out if you can create a simple reproducible example. Regarding the Java code you quote, do you have this in your own processor, or somewhere else (e.g. servlet)? In the later case, are you also doing response.setContentType("application/xml")? Alex On Fri, Apr 30, 2010 at 8:44 AM, <[hidden email]> wrote: > OK, I'll try to put this together but it will take me some time. > As I can see you have tagged the RC1 in git so I'm very excited to start working with this new version! > > The response sent back by our processor is generated using JAXB > What we do is something like this > > > import org.dom4j.Document; > import org.dom4j.io.DocumentResult; > ... > > public void generateData(PipelineContext context, ContentHandler contentHandler) throws Exception { > DocumentResult docResult = new DocumentResult(); > MarshallerFactory.getMarshaller().marshal(thisIsMyObject, docResult); > > LocationSAXWriter saxWriter = new LocationSAXWriter(); > saxWriter.setContentHandler(contentHandler); > saxWriter.write(xmlDocument.getDocument()); > } > > For the relative path, on my submission I have <submission ... action="../../saveForm"/> > When I do this I have an error in the the BaseSubmission.java (line 44) class: > > assert NetUtils.urlHasProtocol(resolvedActionOrResource) || resolvedActionOrResource.startsWith("/"); > > Thanks! > > Antoine > > -----Original Message----- > From: Alessandro Vernet [mailto:[hidden email]] > Sent: Friday, April 30, 2010 5:24 AM > To: [hidden email] > Subject: [ops-users] Re: Body received with non-XML media type for replace="instance": text/html > > Antoine, > > Are you running a submission over HTTP? Then the result should have > the content type set to application/xml. How is the result from that > submission generated? > > And relative paths do work (as far as I know!). Could you create an > example that shows this issue so we can run it here? > > Alex > > On Tue, Apr 27, 2010 at 8:41 AM, > <[hidden email]> wrote: >> Hi, >> >> I have created a custom processor which works fine with orbeon 3.6. >> I just installed the 3.8-beta version and now I have the following error >> when I try to save a form >> >> Body received with non-XML media type for replace="instance": text/html >> >> Looking in the orbeon code it seems that in the InstanceReplacer orbeon is >> expecting to receive xml (text/xml, …). >> I tried in my processor to set the contentType on the response but it dit >> not change anything. >> >> Can you please tell me what I should do to correct this? >> >> Another issue I ran into is that I used to work with relative path for my >> submission. I seems this is not working anymore? Am I correct? >> >> Thanks, >> >> Antoine >> >> -- >> 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 >> >> > > > > -- > Orbeon Forms - Web forms, open-source, for the Enterprise - > http://www.orbeon.com/ > My Twitter: http://twitter.com/avernet > > > -- > 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 > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/avernet -- 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
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |