Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 60810 invoked from network); 5 Sep 2008 18:31:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2008 18:31:02 -0000 Received: (qmail 61267 invoked by uid 500); 5 Sep 2008 18:31:00 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 60984 invoked by uid 500); 5 Sep 2008 18:31:00 -0000 Mailing-List: contact axis-c-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C User List" Reply-To: "Apache AXIS C User List" Delivered-To: mailing list axis-c-user@ws.apache.org Received: (qmail 60973 invoked by uid 99); 5 Sep 2008 18:31:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 11:31:00 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dimuthuc@gmail.com designates 209.85.142.189 as permitted sender) Received: from [209.85.142.189] (HELO ti-out-0910.google.com) (209.85.142.189) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 18:29:58 +0000 Received: by ti-out-0910.google.com with SMTP id y6so356346tia.18 for ; Fri, 05 Sep 2008 11:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=9AjLPaxCu3xipNWaKlvel8zKH/99G+049AWIn0M2ceA=; b=Y3Q7C/vCw/GKR+WMNxoDSKxDnqtXCFQqTf0o7fTb9DZPKRIHBkfuGts1T57YDZJvJs EqPoM/OGyojQCqCoxNX4bnr/BoiVmHUi3mm+KxSXwAxN6A37ctHrrcKVOYb2iy8EuqaO mCjggL5ix8EZfihhUanQUO0CyBm5SaiKM8pmk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=b4l6OZ1870sfF1jPpket8HxOnA5lQ9jLDUCWizt63js/ZHAZzVnKrF7XXg4HZRPKui spN8oc6JKbKLKGQIt1i4Ex/WRmK+J0prOficRfldKorsDZq1SYxTVp9tRriXyMPNEogh 3BL2rQ82xQo+oJyoL6Y40ian2vE620IfXjnrs= Received: by 10.110.57.6 with SMTP id f6mr15329767tia.38.1220639410676; Fri, 05 Sep 2008 11:30:10 -0700 (PDT) Received: by 10.110.10.6 with HTTP; Fri, 5 Sep 2008 11:30:10 -0700 (PDT) Message-ID: Date: Sat, 6 Sep 2008 00:00:10 +0530 From: "Dimuthu Gamage" To: "Apache AXIS C User List" Subject: Re: Clean-up and Freeing (and nnexpected close-tags being created) In-Reply-To: <508748c80809040643n5dd5bb59h3f9633c29a61cebe@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_141376_3972007.1220639410668" References: <508748c80809030855p2b81daf9k9c4a3c95956b883b@mail.gmail.com> <48BF3473.2010809@wso2.com> <508748c80809040452q6659b191j647386497181d35@mail.gmail.com> <508748c80809040643n5dd5bb59h3f9633c29a61cebe@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_141376_3972007.1220639410668 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Looks like the axiom node created with axutil_string is having problem, I too got the same problem with your code, and I tried replacing axiom_element_create_str with axiom_element_create and it was working correctly. axiom_node_t *nodeA = axiom_node_create(env); /*axutil_string_t* nodeAString = axutil_string_create (env,"getParameterValues"); */ const axis2_char_t *nodeAString = "getParametervalues"; axiom_element_create(env, NULL, nodeAString, ns, &nodeA); ..... I think axutil_string or use of axutil_string inside axiom is having a bug. Can you please raise an issue on this at https://issues.apache.org/jira/browse/AXIS2C Thanks Dimuthu On Thu, Sep 4, 2008 at 7:13 PM, Andy Karseras wrote: > The following code illustrates the problem... > > void myClient::testMethod() > { > const axis2_char_t *prefix = "cwmp"; > const axis2_char_t *uri = "urn:dslforum-org:cwmp-1-0"; > > axiom_namespace_t *ns = axiom_namespace_create(env, uri, prefix); > axiom_namespace_t *empty_ns = axiom_namespace_create(env, uri, > ""); > > axiom_node_t *nodeA = axiom_node_create(env); > axutil_string_t* nodeAString = axutil_string_create > (env,"getParameterValues"); > axiom_element_create_str(env, NULL, nodeAString, ns, &nodeA); > > axiom_node_t *nodeB = axiom_node_create(env); > axutil_string_t* nodeBString = axutil_string_create > (env,"ParameterNames"); > axiom_element_create_str(env, nodeA, nodeBString, empty_ns, > &nodeB); > > axiom_node_t *nameNode = axiom_node_create(env); > axutil_string_t* nameString = axutil_string_create (env, "Name"); > axiom_element_create_str(env, nodeB, nameString, empty_ns, > &nameNode); > > axiom_element_t *ele = (axiom_element_t > *)axiom_node_get_data_element( nameNode, env); > axiom_element_set_text( ele, env, "blah", nameNode); > > cout << axiom_node_to_string(nodeA,env) << endl; > > axiom_node_free_tree(nodeA, env); > } > > The method is called multiple times with a sleep interval in between and > creates the output below. > Note the ParameterNames tag for the last two iterations. > > xmlns:cwmp="urn:dslforum-org:cwmp-1-0">blah > xmlns:cwmp="urn:dslforum-org:cwmp-1-0">blah > xmlns:cwmp="urn:dslforum-org:cwmp-1-0">blah > * > * > blah > * > * > blah > > Is this expected due to my incorrect use of the APIs or is this a bug ? > > Many thanks. > > > > > > On Thu, Sep 4, 2008 at 7:52 AM, Andy Karseras wrote: > >> Thanks for your reply. >> >> It seems that the problem occurs even when I create a new service client >> and payload on each time I resend. Would this be expected ? >> >> >> >> >> On Wed, Sep 3, 2008 at 9:05 PM, Samisa Abeysinghe wrote: >> >>> I think this occurs because you are violating the ownership rules with >>> OM. Once the payload is passed in, the engine takes over the ownership of >>> the node and you are not supposed to do anything with the payload >>> afterwards. >>> >>> Thanks, >>> Samisa... >>> >>> Andy Karseras wrote: >>> >>>> Hi, >>>> >>>> I raised this problem in July and thought that it had been resolved (by >>>> doing proper clean-up), although it is now re-occurring. >>>> >>>> I am seeing a close tag being created when there shouldn't be. >>>> >>>> The incorrect message content is as follows... >>>> >>>> >>>> >>>> ***TempAgent. >>>> >>>> >>>> >>>> >>>> I am sending the same message multiple times to the server and the error >>>> occurs on the third iteration (3rd time the message is sent) so am assuming >>>> that I am not doing proper clean-up after each message is created and then >>>> sent. >>>> >>>> My questions as follows... >>>> a) Has anybody seen this before ? >>>> >>>> b) Will calling axiom_node_free_tree on nodeA also clean-up nodeB in the >>>> following example ? >>>> axiom_node_t *nodeB= axiom_node_get_first_child(nodeA, env); >>>> >>>> c) Will a node created to be used in axis2_svc_client_add_header, be >>>> cleaned-up by axis2_svc_client_free ? >>>> >>>> d) Is there any other info I can provide to clarify or help explain the >>>> problem ? >>>> >>>> Many thanks. >>>> >>>> >>>> Andy >>>> ------------------------------------------------------------------------ >>>> >>>> >>>> No virus found in this incoming message. >>>> Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus Database: >>>> 270.6.15/1649 - Release Date: 9/3/2008 7:15 AM >>>> >>>> >>>> >>> >>> >>> -- >>> Samisa Abeysinghe Director, Engineering; WSO2 Inc. >>> >>> http://www.wso2.com/ - "The Open Source SOA Company" >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org >>> For additional commands, e-mail: axis-c-user-help@ws.apache.org >>> >>> >> > -- Thanks, Dimuthu Gamage http://www.dimuthu.org http://www.wso2.org ------=_Part_141376_3972007.1220639410668 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi,
Looks like the axiom node created with axutil_string is having problem, I too got the same problem with your code, and I tried replacing axiom_element_create_str with axiom_element_create and it was working correctly.

        axiom_node_t *nodeA = axiom_node_create(env);
        /*axutil_string_t* nodeAString = axutil_string_create (env,"getParameterValues");   */
        const axis2_char_t *nodeAString = "getParametervalues";
        axiom_element_create(env, NULL, nodeAString, ns, &nodeA);
        .....

I think axutil_string or use of axutil_string inside axiom is having a bug. Can you please raise an issue on this at https://issues.apache.org/jira/browse/AXIS2C

Thanks
Dimuthu



On Thu, Sep 4, 2008 at 7:13 PM, Andy Karseras <akarseras@gmail.com> wrote:
The following code illustrates the problem...

    void myClient::testMethod()
    {       
        const axis2_char_t *prefix = "cwmp";
        const axis2_char_t *uri = "urn:dslforum-org:cwmp-1-0";
       
        axiom_namespace_t *ns = axiom_namespace_create(env, uri, prefix);
        axiom_namespace_t *empty_ns = axiom_namespace_create(env, uri, "");   
       
        axiom_node_t *nodeA = axiom_node_create(env);   
        axutil_string_t* nodeAString = axutil_string_create (env,"getParameterValues");   
        axiom_element_create_str(env, NULL, nodeAString, ns, &nodeA);
       
        axiom_node_t *nodeB = axiom_node_create(env);       
        axutil_string_t* nodeBString = axutil_string_create (env,"ParameterNames");               
        axiom_element_create_str(env, nodeA, nodeBString, empty_ns, &nodeB);
       
        axiom_node_t *nameNode = axiom_node_create(env);
        axutil_string_t* nameString = axutil_string_create (env, "Name");
        axiom_element_create_str(env, nodeB, nameString, empty_ns, &nameNode);
       
        axiom_element_t *ele = (axiom_element_t *)axiom_node_get_data_element( nameNode, env);           
        axiom_element_set_text( ele, env, "blah", nameNode);
                       
        cout << axiom_node_to_string(nodeA,env) << endl;
       
        axiom_node_free_tree(nodeA, env);
    }

The method is called multiple times with a sleep interval in between and creates the output below.
Note the ParameterNames tag for the last two iterations.

<cwmp:getParameterValues xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><ParameterNames><Name>blah</Name></ParameterNames></cwmp:getParameterValues>
<cwmp:getParameterValues xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><ParameterNames><Name>blah</Name></ParameterNames></cwmp:getParameterValues>
<cwmp:getParameterValues xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><ParameterNames><Name/>blah</Name></ParameterNames></cwmp:getParameterValues>
<cwmp:getParameterValues xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><ParameterNames/><Name/>blah</Name></ParameterNames></cwmp:getParameterValues>
<cwmp:getParameterValues xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><ParameterNames/><Name/>blah</Name></ParameterNames></cwmp:getParameterValues>

Is this expected due to my incorrect use of the APIs or is this a bug ?

Many thanks.





On Thu, Sep 4, 2008 at 7:52 AM, Andy Karseras <akarseras@gmail.com> wrote:
Thanks for your reply.

It seems that the problem occurs even when I create a new service client and payload on each time I resend.  Would this be expected ?




On Wed, Sep 3, 2008 at 9:05 PM, Samisa Abeysinghe <samisa@wso2.com> wrote:
I think this occurs because you are violating the ownership rules with OM. Once the payload is passed in, the engine takes over the ownership of the node and you are not supposed to do anything with the payload afterwards.

Thanks,
Samisa...

Andy Karseras wrote:
Hi,

I raised this problem in July and thought that it had been resolved (by doing proper clean-up), although it is now re-occurring.

I am seeing a close tag being created when there shouldn't be.

The incorrect message content is as follows...

<cwmp:getParameterValues xmlns:cwmp="urn:dslforum-org:cwmp-1-0">
   <ParameterNames>
       *<Name/>**TempAgent.</Name>
   </ParameterNames>
</cwmp:getParameterValues>


I am sending the same message multiple times to the server and the error occurs on the third iteration (3rd time the message is sent) so am assuming that I am not doing proper clean-up after each message is created and then sent.

My questions as follows...
a) Has anybody seen this before ?

b) Will calling axiom_node_free_tree on nodeA also clean-up nodeB in the following example ?
   axiom_node_t *nodeB= axiom_node_get_first_child(nodeA, env);

c) Will a node created to be used in axis2_svc_client_add_header, be cleaned-up by axis2_svc_client_free ?

d) Is there any other info I can provide to clarify or help explain the problem ?

Many thanks.


Andy
------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - http://www.avg.com Version: 8.0.169 / Virus Database: 270.6.15/1649 - Release Date: 9/3/2008 7:15 AM

 


--
Samisa Abeysinghe Director, Engineering; WSO2 Inc.

http://www.wso2.com/ - "The Open Source SOA Company"


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org






--
Thanks,
Dimuthu Gamage

http://www.dimuthu.org
http://www.wso2.org
------=_Part_141376_3972007.1220639410668--