Re: CInclude POST (again)
Boisvert, Éric wrote: gee thanks for the fix. being a defensive programmer , I changed the code to private String GetXmlRequest(Document doc) { String req = this.DomToString(doc); if (req.indexOf("xmlns") == -1) { // not namespace declaration found Node n = doc.getFirstChild(); req.replaceFirst(n.getLocalName(),n.getLocalName() + " " + ns); } else return req; } Seems like you probably don't want the "else". As is, you should get a compilation error because GetXmlRequest() will not return anything when the if condition is true. Lars - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: CInclude POST (again)
gee thanks for the fix. being a defensive programmer , I changed the code to private String GetXmlRequest(Document doc) { String req = this.DomToString(doc); if (req.indexOf("xmlns") == -1) { // not namespace declaration found Node n = doc.getFirstChild(); req.replaceFirst(n.getLocalName(),n.getLocalName() + " " + ns); } else return req; } I have 2.1.6 and 2.1.8 implementations running. -Message d'origine- De : Stewart, Gary [mailto:[EMAIL PROTECTED] Envoyé : 7 décembre, 2005 07:08 À : users@cocoon.apache.org Objet : RE: CInclude POST (again) > -Original Message- > From: Boisvert, Éric [mailto:[EMAIL PROTECTED] > Sent: 06 December 2005 17:17 > To: users@cocoon.apache.org > Subject: RE: CInclude POST (again) > > > find attached the source code, keep in mind that's I'm not a > expert Java > programmer (I'm more on C# and Delphi). The component has > been designed to > send POST query to WFS (Web Feature Service) servers, which > are typically > small XML Query versus potentially very large XML Responses. > This is an > issue in the code because the incoming XML is converted to a > DOM and then to > a string (to fix a bug in DOM serializer that 'forgets' to serialize > namespaces), I must manually reinsert the namespaces > declaration in the > incoming XML. > > I've added a bit more comments in the source code, for your either > documentation or comic relief. > > I assume you are familliar with compiling+installing Cocoon > components. > Also, this component is provided as is, and I cannot garantee it will > function properly under stress conditions.. So if your business it the > control Airplane traffic or controling a nuclear reactor, I > suggest you have > this checked by a REAL java programmer. :P If it was in nuclear reactors the Java licence agreement explicitly states: "You acknowledge that Licensed Software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility." so nuclear facility programmers shouldn't be using Java let alone cocoon or custom transformers on top of that :D. I think XMLUtils.serializeNode might have been changed in 2.1.8 (the revision date shows 2005-11-13) and serialization now seems to return the namespace because at first I was getting a namespace already declared exception so I changed GetXmlRequest to the very short; I could give you a diff but it's only this function that I've changed: private String GetXmlRequest(Document doc) { String req = this.DomToString(doc); return req; } Thank you very much for the code; it has proved very useful. I'd still be interested in confirming whether CInclude's patch has been put through correctly but this certainly seems like the best route (it stops me needing to create CInclude wrappers as well). Thanks again for the code and the help, Gary * The information contained in this message may be confidential or legally privileged and is intended for the addressee only, If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: CInclude POST (again)
> -Original Message- > From: Boisvert, Éric [mailto:[EMAIL PROTECTED] > Sent: 06 December 2005 17:17 > To: users@cocoon.apache.org > Subject: RE: CInclude POST (again) > > > find attached the source code, keep in mind that's I'm not a > expert Java > programmer (I'm more on C# and Delphi). The component has > been designed to > send POST query to WFS (Web Feature Service) servers, which > are typically > small XML Query versus potentially very large XML Responses. > This is an > issue in the code because the incoming XML is converted to a > DOM and then to > a string (to fix a bug in DOM serializer that 'forgets' to serialize > namespaces), I must manually reinsert the namespaces > declaration in the > incoming XML. > > I've added a bit more comments in the source code, for your either > documentation or comic relief. > > I assume you are familliar with compiling+installing Cocoon > components. > Also, this component is provided as is, and I cannot garantee it will > function properly under stress conditions.. So if your business it the > control Airplane traffic or controling a nuclear reactor, I > suggest you have > this checked by a REAL java programmer. :P If it was in nuclear reactors the Java licence agreement explicitly states: "You acknowledge that Licensed Software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility." so nuclear facility programmers shouldn't be using Java let alone cocoon or custom transformers on top of that :D. I think XMLUtils.serializeNode might have been changed in 2.1.8 (the revision date shows 2005-11-13) and serialization now seems to return the namespace because at first I was getting a namespace already declared exception so I changed GetXmlRequest to the very short; I could give you a diff but it's only this function that I've changed: private String GetXmlRequest(Document doc) { String req = this.DomToString(doc); return req; } Thank you very much for the code; it has proved very useful. I'd still be interested in confirming whether CInclude's patch has been put through correctly but this certainly seems like the best route (it stops me needing to create CInclude wrappers as well). Thanks again for the code and the help, Gary * The information contained in this message may be confidential or legally privileged and is intended for the addressee only, If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: CInclude POST (again)
find attached the source code, keep in mind that's I'm not a expert Java programmer (I'm more on C# and Delphi). The component has been designed to send POST query to WFS (Web Feature Service) servers, which are typically small XML Query versus potentially very large XML Responses. This is an issue in the code because the incoming XML is converted to a DOM and then to a string (to fix a bug in DOM serializer that 'forgets' to serialize namespaces), I must manually reinsert the namespaces declaration in the incoming XML. I've added a bit more comments in the source code, for your either documentation or comic relief. I assume you are familliar with compiling+installing Cocoon components. Also, this component is provided as is, and I cannot garantee it will function properly under stress conditions.. So if your business it the control Airplane traffic or controling a nuclear reactor, I suggest you have this checked by a REAL java programmer. :P Cheers -Message d'origine- De : Stewart, Gary [mailto:[EMAIL PROTECTED] Envoyé : 6 décembre, 2005 11:42 À : users@cocoon.apache.org Objet : RE: CInclude POST (again) > -Original Message- > From: Boisvert, Éric [mailto:[EMAIL PROTECTED] > Sent: 06 December 2005 15:39 > To: users@cocoon.apache.org > Subject: RE: CInclude POST (again) > > > Gary.. I gave up with this cinclude/POST business - lost an > incredible > amount of time trying to make it work to no avail. I created my own > component (as a transformer). it throws whaterver xml it > gets to a remote > server and send the response down the pipeline. > > are you (or anyone) interested ? > > Eric > I was just talking to someone about doing the same thing :). I'd be very interested in a transformer that did a POST. I've replied to the thread rather than you just to note interests on the mailing list (if there was enough interests for it to be added to the build). Thanks, Gary * The information contained in this message may be confidential or legally privileged and is intended for the addressee only, If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] PostClient.java Description: Binary data - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: CInclude POST (again)
> -Original Message- > From: Boisvert, Éric [mailto:[EMAIL PROTECTED] > Sent: 06 December 2005 15:39 > To: users@cocoon.apache.org > Subject: RE: CInclude POST (again) > > > Gary.. I gave up with this cinclude/POST business - lost an > incredible > amount of time trying to make it work to no avail. I created my own > component (as a transformer). it throws whaterver xml it > gets to a remote > server and send the response down the pipeline. > > are you (or anyone) interested ? > > Eric > I was just talking to someone about doing the same thing :). I'd be very interested in a transformer that did a POST. I've replied to the thread rather than you just to note interests on the mailing list (if there was enough interests for it to be added to the build). Thanks, Gary * The information contained in this message may be confidential or legally privileged and is intended for the addressee only, If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: CInclude POST (again)
Gary.. I gave up with this cinclude/POST business - lost an incredible amount of time trying to make it work to no avail. I created my own component (as a transformer). it throws whaterver xml it gets to a remote server and send the response down the pipeline. are you (or anyone) interested ? Eric -Message d'origine- De : Stewart, Gary [mailto:[EMAIL PROTECTED] Envoyé : 6 décembre, 2005 08:31 À : users@cocoon.apache.org Objet : CInclude POST (again) Hi there, I'm still having problems getting CInclude POST in 2.1.8 to work. I've been investigating a little further though and thought the extra information might help. I've checked the server and the response works ok to another system doing the post so it isn't at that end. My cinclude post looks something like: http://apache.org/cocoon/include/1.0";> http://10.231.27.63/sql_templates/ method POST text (/lsa:Address) If I set ignoreError to true I get an empty root node () if it is false I get: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed. context:/http://10.231.27.63/sql_templates/ - 1:37 which I'm not sure why it is appearing as a root node if it is. I've tried it on a fresh build and my slightly modified build (I thought that might be what was causing issues but it doesn't seem to be the case). If anyone has seen 2.1.8 CInclude POST work that would be useful and any suggestions on this problem would be greatly appreciated. Thanks, Gary * The information contained in this message may be confidential or legally privileged and is intended for the addressee only, If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CInclude POST (again)
Hi there, I'm still having problems getting CInclude POST in 2.1.8 to work. I've been investigating a little further though and thought the extra information might help. I've checked the server and the response works ok to another system doing the post so it isn't at that end. My cinclude post looks something like: http://apache.org/cocoon/include/1.0";> http://10.231.27.63/sql_templates/ method POST text (/lsa:Address) If I set ignoreError to true I get an empty root node () if it is false I get: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed. context:/http://10.231.27.63/sql_templates/ - 1:37 which I'm not sure why it is appearing as a root node if it is. I've tried it on a fresh build and my slightly modified build (I thought that might be what was causing issues but it doesn't seem to be the case). If anyone has seen 2.1.8 CInclude POST work that would be useful and any suggestions on this problem would be greatly appreciated. Thanks, Gary * The information contained in this message may be confidential or legally privileged and is intended for the addressee only, If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorised use, disclosure, copying or alteration of this message is strictly forbidden. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]