Return-Path: Delivered-To: apmail-axis-c-user-archive@www.apache.org Received: (qmail 35131 invoked from network); 4 Feb 2011 10:53:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Feb 2011 10:53:49 -0000 Received: (qmail 59966 invoked by uid 500); 4 Feb 2011 10:53:49 -0000 Delivered-To: apmail-axis-c-user-archive@axis.apache.org Received: (qmail 59825 invoked by uid 500); 4 Feb 2011 10:53:46 -0000 Mailing-List: contact c-user-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache AXIS C User List" Delivered-To: mailing list c-user@axis.apache.org Received: (qmail 59813 invoked by uid 99); 4 Feb 2011 10:53:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Feb 2011 10:53:45 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [213.174.32.96] (HELO mailout01.ims-firmen.de) (213.174.32.96) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Feb 2011 10:53:36 +0000 Received: from [192.168.1.112] (helo=mailin03.ims-firmen.de) by mailout01.ims-firmen.de with esmtp (Exim 4.72) (envelope-from ) id 1PlJHv-0007KU-MS for c-user@axis.apache.org; Fri, 04 Feb 2011 11:53:15 +0100 Received: from [144.41.253.148] (helo=[10.0.0.53]) by mailin03.ims-firmen.de with esmtpa (Exim 4.72) (envelope-from ) id 1PlJHv-0005pz-Fc for c-user@axis.apache.org; Fri, 04 Feb 2011 11:53:15 +0100 Subject: Re: XML reader/writer buffer size problem? From: Thomas Gentsch To: Apache AXIS C User List In-Reply-To: <1296390072.2333.37.camel@parsley> References: <1276465246.2264.5.camel@parsley> <1276465624.2264.8.camel@parsley> <4C15A7EA.40706@wso2.com> <1276500772.2268.8.camel@parsley> <4C15FAE2.9000306@wso2.com> <1276850673.2221.62.camel@parsley> <1276854782.2221.74.camel@parsley> <1278673353.2367.24.camel@parsley> <1296129803.2333.124.camel@parsley> <1296130561.2333.126.camel@parsley> <1296146857.6873.28.camel@parsley> <4D41A3AB.1090702@wso2.com> <1296150199.6873.35.camel@parsley> <1296390072.2333.37.camel@parsley> Content-Type: text/plain; charset="UTF-8" Date: Fri, 04 Feb 2011 11:53:14 +0100 Message-ID: <1296816794.2274.134.camel@parsley> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi all, sorry, I have to re-open this, the corrupted XML was my fault (while editing the test data). Basically it still does not work. In my real prog I have added some more printouts (also in Axis code): axiom_node_t * SOAPServer::invokeFunc(const axutil_env_t * env, axiom_node_t * n) { DataObjectPtr req = sdoFromAxiom(n); DataObjectPtr resp = doTheWork(req); printf("TGE: SDO Resp:\n"); dumpSDO(resp); axiom_node_t * ax = sdoToAxiom(resp); printf("TGE: Axiom Resp:\n"); dumpAxiom(ax); return ax; } Now what I see is that the incoming request gets transformed from Axiom to SDO nicely, will be processed, and I also see the response SDO "resp" as complete printed out (dumpSDO). Then, in sdoToAxiom() I convert the response SDO back to an Axiom node (as stated earlier, using the SDO AxiomHelper) and print it to stdout (see below). Here I have added a printout into the guththila XML writer and can see that *all* tags are properly written. Now something funny happens: In dumpAxiom() I originally had this: axiom_xml_writer_t * w = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, AXIS2_XML_PARSER_TYPE_BUFFER); axiom_output_t * om_output = axiom_output_create(env, w); axiom_node_serialize(n, env, om_output); axis2_char_t * buf = (axis2_char_t *) axiom_xml_writer_get_xml(w, env); fprintf(f, "\nData: '%s'\n", buf); which yields a truncated output string: Data: '24 Hi all, > > sorry, not Axis' fault ... the input.xml is wrong. Hard to spot, but > there was an opening tag missing. > However > - still unclear why the two writer types behave that differently ?? > - the error message in the log might be a bit better (my input.xml > consists of *one* line of a length of 460000 chars, hence line 1 :-) > maybe a char offset might have helped) > I'll update Jira ... > > Rgds, > tge > > On Thu, 2011-01-27 at 18:43 +0100, Thomas Gentsch wrote: > > Hi Damitha, > > > > if you refer to AXIS2C-448 - I have that in. > > > > Besides of that I haven't found anything :-| (searching for > > axiom_xml_reader or axiom_xml_writer) > > I'll dig more but into it but of course I could save that effort of > > somebody else had an idea :-) > > > > Also, might be interesting to run that against 1.7 ... > > > > Rgds + thx, > > tge > > > > On Thu, 2011-01-27 at 22:26 +0530, Damitha Kumarage wrote: > > > Hi Thomas, > > > I remember similar problem appeared in a previous thread. Could you > > > please search in mail archives? > > > > > > Thanks, > > > Damitha > > > Thomas Gentsch wrote: > > > > Just opened AXIS2C-1534 and attached the test progs + data. > > > > Any help is appreciated!! > > > > Rgds, > > > > tge > > > > > > > > On Thu, 2011-01-27 at 13:16 +0100, Thomas Gentsch wrote: > > > > > > > >> Minor correction in the code below (I merged two functions) ... > > > >> > > > >> On Thu, 2011-01-27 at 13:03 +0100, Thomas Gentsch wrote: > > > >> > > > >>> Hi all, > > > >>> > > > >>> I'm still with Axis2c 1.6 and have a problem (de)serializing an XML > > > >>> string. Is there anything know about such a problem (haven't found > > > >>> anything in Jira)? > > > >>> > > > >>> The essential piece is a string buffer containing an XML structure, > > > >>> which is created from a Tuscany SDO. Then that string buffer gets > > > >>> converted to an Axiom Node (using the Tuscany AxiomHelper) to be > > > >>> returned to the calling Axis2c client. Normally this works nicely, but > > > >>> if the XML is very long (in my example 484460 bytes), it gets truncated. > > > >>> > > > >>> I can see the string buffer "str" (below) as still intact. Then, > > > >>> essentially the following happens: > > > >>> =========== > > > >>> AxiomHelper::toAxiomNode() > > > >>> { > > > >>> ... > > > >>> axiom_xml_reader_t * reader = > > > >>> axiom_xml_reader_create_for_memory( > > > >>> the_env, (void*)str, strlen(str), > > > >>> (const axis2_char_t *)"UTF-8", AXIS2_XML_PARSER_TYPE_BUFFER); > > > >>> axiom_stax_builder_t* builder = > > > >>> axiom_stax_builder_create(the_env, reader); > > > >>> axiom_document_t* document = > > > >>> axiom_stax_builder_get_document(builder, the_env); > > > >>> axiom_node_t* root_node = > > > >>> axiom_document_get_root_element(document, the_env); > > > >>> axiom_document_build_all(document, the_env); > > > >>> > > > >> The code above is function1 and returns "document". > > > >> Below is function2 dealing with that document. > > > >> > > > >> > > > >>> axiom_node_t* root_node = > > > >>> axiom_document_get_root_element(doc, the_env); > > > >>> return root_node; > > > >>> } > > > >>> > > > >>> Now I have the Axiom node "n" and dump it (just for testing): > > > >>> > > > >>> axiom_xml_writer_t * w = axiom_xml_writer_create_for_memory(env, > > > >>> NULL, AXIS2_TRUE, 0, AXIS2_XML_PARSER_TYPE_BUFFER); > > > >>> axiom_output_t * om_output = axiom_output_create(env, w); > > > >>> axiom_node_serialize(n, env, om_output); > > > >>> axis2_char_t * buf = (axis2_char_t *) axiom_xml_writer_get_xml(w, env); > > > >>> > > > >>> fprintf(f, "\nData: '%s'\n", buf); > > > >>> ============= > > > >>> > > > >>> and the output is truncated to 17253 bytes ending with some control > > > >>> characters. > > > >>> As said, that code has been working for months/years now w/o any > > > >>> problems, so I believe that it is OK in general and I rather suspect the > > > >>> Axis2c XML handling in conjunction with large buffers ... > > > >>> > > > >>> I'll extract the pieces into a standalone testprog for easier > > > >>> troubleshooting - but still: Any ideas? > > > >>> > > > >>> Many thx!!! > > > >>> tge > > > >>> > > > >>> > > > >> > --------------------------------------------------------------------- To unsubscribe, e-mail: c-user-unsubscribe@axis.apache.org For additional commands, e-mail: c-user-help@axis.apache.org