Re: Bug in axis2c xml parsing?
Subra A Narayanan wrote: Hello folks, I use the following code to parse an incoming ws request. I am posting only snippets of the code for sake of brevity **CODE BEGIN*** axutil_qname_t *Qname = axutil_qname_create(env, "Price", MY_NAMESPACE_URI, MY_NAMESPACE_PREFIX); axiom_node_t *myNode = NULL; axiom_element_t *myElement = NULL; myElement = axiom_element_get_first_child_with_qname(rootElement, env, Qname, rootNode, &myNode); if (myNode) { ... ... ... return AXIS2_SUCCESS; } else { AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Error!!"); return AXIS2_FAILURE; } **CODE END** If I have a node like this, it just works fine (here 'MyOperation' is the root node from above) 250 but if I have a node like this the control goes in to the else condition and it returns AXIS2_FAILURE I would think this shouldn't be happening since we do have a 'Price' node although it is empty. Is this by design or have I found a bug? Looks like this is a bug. What is the Axis2/C version that you are using and also the parser that you are using? If possible, please raise a Jira with the test program so that I can have a further look into this. Samisa... Thanks, Subra -- Samisa Abeysinghe : WSO2 WSF/PHP "http://wso2.org/projects/wsf/php?WSO2 Web Services Framework%2FPHP - Open source PHP extention for providing and consuming Web services in PHP"; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug in axis2c xml parsing?
Hi Subra, I've checked your code but it worked in both two types of xml's.Please check your variables MY_NAMESPACE_PREFIX and MY_NAMESPACE_URI.You have to give the appropriate prefix to get the child by the Qname. This is my code: char* MY_NAMESPACE_URI = "http://x.com";; char* MY_NAMESPACE_PREFIX = "ns1"; document = axiom_stax_builder_get_document(builder, environment); axiom_node_t * rootNode = NULL; axiom_element_t* rootElement = NULL; rootNode = axiom_document_get_root_element(document, environment); axutil_qname_t *Qname = axutil_qname_create(environment, "Price", MY_NAMESPACE_URI, MY_NAMESPACE_PREFIX); axiom_node_t *myNode = NULL; axiom_element_t *myElement = NULL; myElement = axiom_element_get_first_child_with_qname(rootElement, environment, Qname, rootNode, &myNode); if (myNode) { printf("inside if"); return AXIS2_SUCCESS; } else { AXIS2_LOG_DEBUG(environment->log, AXIS2_LOG_SI, "Error!!"); printf("inside else"); return AXIS2_FAILURE; } -- Here the xml file --- http://x.com";> --- Regs lahiru On Thu, 2007-10-18 at 16:02 -0400, Subra A Narayanan wrote: > Hello folks, > > I use the following code to parse an incoming ws request. I am posting > only snippets of the code for sake of brevity > > **CODE > BEGIN*** > > axutil_qname_t *Qname = axutil_qname_create(env, "Price", > MY_NAMESPACE_URI, MY_NAMESPACE_PREFIX); > axiom_node_t *myNode = NULL; > axiom_element_t *myElement = NULL; > myElement = axiom_element_get_first_child_with_qname(rootElement, > env, Qname, rootNode, &myNode); > > if (myNode) > { > ... > ... > ... > return AXIS2_SUCCESS; > } > else > { > AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Error!!"); > return AXIS2_FAILURE; > } > > **CODE > END** > > If I have a node like this, it just works fine (here 'MyOperation' is > the root node from above) > > >250 > > > > but if I have a node like this > > > > > > the control goes in to the else condition and it returns AXIS2_FAILURE > > I would think this shouldn't be happening since we do have a 'Price' > node although it is empty. > > Is this by design or have I found a bug? > > > Thanks, > Subra - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug in axis2c xml parsing?
Please raise an issue in JIRA. Regs Lahiru On Thu, 2007-10-18 at 16:02 -0400, Subra A Narayanan wrote: > Hello folks, > > I use the following code to parse an incoming ws request. I am posting > only snippets of the code for sake of brevity > > **CODE > BEGIN*** > > axutil_qname_t *Qname = axutil_qname_create(env, "Price", > MY_NAMESPACE_URI, MY_NAMESPACE_PREFIX); > axiom_node_t *myNode = NULL; > axiom_element_t *myElement = NULL; > myElement = axiom_element_get_first_child_with_qname(rootElement, > env, Qname, rootNode, &myNode); > > if (myNode) > { > ... > ... > ... > return AXIS2_SUCCESS; > } > else > { > AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Error!!"); > return AXIS2_FAILURE; > } > > **CODE > END** > > If I have a node like this, it just works fine (here 'MyOperation' is > the root node from above) > > >250 > > > > but if I have a node like this > > > > > > the control goes in to the else condition and it returns AXIS2_FAILURE > > I would think this shouldn't be happening since we do have a 'Price' > node although it is empty. > > Is this by design or have I found a bug? > > > Thanks, > Subra - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Bug in axis2c xml parsing?
Hello folks, I use the following code to parse an incoming ws request. I am posting only snippets of the code for sake of brevity **CODE BEGIN*** axutil_qname_t *Qname = axutil_qname_create(env, "Price", MY_NAMESPACE_URI, MY_NAMESPACE_PREFIX); axiom_node_t *myNode = NULL; axiom_element_t *myElement = NULL; myElement = axiom_element_get_first_child_with_qname(rootElement, env, Qname, rootNode, &myNode); if (myNode) { ... ... ... return AXIS2_SUCCESS; } else { AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Error!!"); return AXIS2_FAILURE; } **CODE END** If I have a node like this, it just works fine (here 'MyOperation' is the root node from above) 250 but if I have a node like this the control goes in to the else condition and it returns AXIS2_FAILURE I would think this shouldn't be happening since we do have a 'Price' node although it is empty. Is this by design or have I found a bug? Thanks, Subra