AXIS 2C COMPATIBILITY WITH SOAP UI TOOL

prasad1's picture
Hi everyone I request you all to help me with this issue I am facing now with axiom. I have developed a simple web service in axis2C using axiom which receives an XML request in the below format. qauser hiqauser This request I am sending from the SOAPUI2.5 tool.the problem occurs when the web service is trying to extract the data from the username tag present in the above request. In my server side I get the axiom node as below: qauser hiqauser I have given below the logic i used for extracting the username element uname =(axiom_text_t *)axiom_node_get_data_element(uname_node, env); After this line I get my uname variable (which is of type axiom_text_t*) to contain "qauser" Then I wrote the code to extract the text value from the text element as below uname_str = axiom_text_get_value(uname,env); But the function doesn't return me the text value qauser.It returns me junk characters.I have verified the nodetype of the uname_node which is AXIOM_TEXT. I have attached the whole webservice operation code below for your reference.Pease let me know if there are any other axiom functions should i use to extract the data. axiom_textt_t *uname = NULL; axiom_text_t *pwd = NULL; axiom_node_t *uname_node = NULL; axiom_node_t *pwd_node = NULL; axiom_node_t *return_node = NULL; const axis2_char_t *uname_str = NULL; const axis2_char_t *pwd_str = NULL; axis2_char_t *res = NULL; axiom_namespace_t *ns1 = NULL; axiom_types_t typ; AXIS2_ENV_CHECK(env, NULL); res = axiom_node_to_string(node,env); printf("incoming node is %s",res); if (node) { uname_node = axiom_node_get_first_child(node, env); typ = axiom_node_get_node_type(uname_node, env); printf("value of node type is %d",typ); if (uname_node && axiom_node_get_node_type(uname_node, env) == AXIOM_TEXT) { printf("i am inserver"); uname =(axiom_text_t *)axiom_node_get_data_element(uname_node, env); uname_str = axiom_text_get_value(uname,env); printf(" value of username is %s",uname_str); if (uname && axiom_text_get_value(uname , env)) { uname_str = axiom_text_get_value(uname , env); printf(" value of username is %s",uname_str); } }
uthaiyashankar's picture

Hi, Can you try the

Hi, Can you try the following,   axiom_element_t *uname = NULL; axis2_char_t *uname_str = NULL; uname =(axiom_element_t*)axiom_node_get_data_element(uname_node,env); uname_str = axiom_element_get_text(uname, env, uname_node);
prasad1's picture

Hi Thank you very much for

Hi Thank you very much for the response.I have already tried the code you have given but it doesn't work . This time it returns me a null value.This is because the node type of the uname_node is AXIOM_TEXT. Another strange thing i would like to share with you is that this parsing error occurs only when I send the request from the soap UI 2.5 tool. As per the axiom samples , I have created a client application for this web service and when i invoke the service from the client(a stand alone exe) , I am able to parse the data at the server side.Also when the request is sent from the client application, the uname_node is of type AXIOM_ELEMENT and your code snippet works fine to extract the username. Is there anyway by which I can send the request from soap UI tool as an AXIOM_ELEMENT ? Any other suggestions are also most welcome.
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)