Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.4.0
-
None
-
None
-
RedHat Linux
Description
Close tags are being created at incorrect locations for example:-
<ParameterNames/><Name/>blah</Name></ParameterNames></cwmp:getParameterValues>
The following code when called multiple times 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>
This was confirmed by Dimuthu Gamage (see e-mail below)
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