axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Karseras" <akarse...@gmail.com>
Subject Re: Clean-up and Freeing (and nnexpected close-tags being created)
Date Thu, 04 Sep 2008 13:43:47 GMT
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
>>
>>
>

Mime
View raw message