You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Viet Hoang <vh...@gmail.com> on 2012/02/22 17:46:54 UTC

Unsubscribe

Unsubscribe
On Feb 22, 2012 2:55 AM, "Shuaib Siddiqui" <sh...@gmail.com> wrote:

> Hi,
>
> My goal is to implement a service that takes in different values for an
> ethernet interface (e.g., ip address, name, etc) as input and make
> respective changes in the kernel of the target machine. It will be a POST
> REST method and for testing purpose, I am using Firefox REST client to send
> POST request. Thats how I am doing it:
>
> *Request Header:
>
>                        Content-Type text/xml
>
> Request Body:
>
> <ns1:setInterface xmlns:ns1="http://localhost:9090/axis2/service_openapi<http://localhost:9090/axis2/quagga_openapi>
> ">
>   <interface>
>     <name>eth0</name>
>     <ip>
>       <address>192.168.0.1</address>
>       <prefixlen>24</prefixlen>
>     </ip>
>   </interface>
> </ns1:setInterface>*
>
> This request should invoke the setInterface service and after extracting
> the value of, i.e., <name>, <address> and <prefixlen> build up a stream and
> send packet to server application which will talk with kernel to do the
> required changes.
>
> For this given Request body, the following code,
>
> *        axiom_element_t *element = NULL;
>         element = (axiom_element_t *) axiom_node_get_data_element(node,
> env);
>         axis2_char_t *function_str = axiom_element_get_localname(element,
> env);
>         printf("function string is %s \n", function_str);*
>
> results in printing setInterface on axis2 server console. How do I further
> traverse through such a structure ? I tried using built-in functions like
> *axiom_node_get_first_element(node, env);
> axiom_node_get_first_child(node, env);*
> But I am not able to traverse properly and extract the values. Does anyone
> have any good pointers to an example which explains this ?
>
> Furthermore, in this given Request body, is <interface> element of node
> <setInterface> or its child ? Similarly, <interface> has <name> and <ip>
> (as its child or elements?), and <ip> has <address> and <prefixlen>. How do
> we interpret this XML structure in AXIS2/C terminology ?
>
> Once again my question could be totally naive but XML and AXIS2/C are all
> very new to me and I really want to understand this.
>
> Thanks for your time!
>
> Regards,
>
> S.S