Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1259

AXIS2C: axutil_string: Close tag created at incorrect location

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4.0
    • None
    • util
    • 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

      Attachments

        Activity

          People

            Unassigned Unassigned
            andreaskarseras Andreas Karseras
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 168h
                168h
                Remaining:
                Remaining Estimate - 168h
                168h
                Logged:
                Time Spent - Not Specified
                Not Specified