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 Mark Webb <el...@gmail.com> on 2008/10/21 17:56:03 UTC

simple response parsing question

I have a web service client written in Axis2C and am getting the
response back properly.  The response is just a long value.  Here is
the XML I receive back:

<ns2:initResponse
xmlns:ns2="http://service.web.blah/"><return>1234</return></ns2:initResponse>

I am using the method axiom_node_get_first_child(node, env) to get the
value node.  I print out the node and get:

<return>1234</return>

Problem is that I cannot figure out how to parse out the '1234'.  I
have looked at the examples but cannot get my code to work.  Here is
where I am at:

printf("NODE = %s\n", axiom_node_to_string( return_val_node, env ));
<----  This prints out "<return>1234</return>"
firstNodeText = (axiom_text_t
*)axiom_node_get_data_element(return_val_node, env);
firstNodeString = axiom_text_get_value(firstNodeText, env);
printf("Return Value = %s\n", firstNodeString);

Return value is always printed as (null).

--- Thanks
Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: simple response parsing question

Posted by Mark Webb <el...@gmail.com>.
Perfect!

Thank you.


On Tue, Oct 21, 2008 at 1:46 PM, Supun Kamburugamuva <su...@gmail.com> wrote:
> This will help you.
>
> http://ws.apache.org/axis2/c/docs/om_tutorial.html
>
> Supun.
>
> On Tue, Oct 21, 2008 at 8:56 PM, Mark Webb <el...@gmail.com> wrote:
>>
>> I have a web service client written in Axis2C and am getting the
>> response back properly.  The response is just a long value.  Here is
>> the XML I receive back:
>>
>> <ns2:initResponse
>>
>> xmlns:ns2="http://service.web.blah/"><return>1234</return></ns2:initResponse>
>>
>> I am using the method axiom_node_get_first_child(node, env) to get the
>> value node.  I print out the node and get:
>>
>> <return>1234</return>
>>
>> Problem is that I cannot figure out how to parse out the '1234'.  I
>> have looked at the examples but cannot get my code to work.  Here is
>> where I am at:
>>
>> printf("NODE = %s\n", axiom_node_to_string( return_val_node, env ));
>> <----  This prints out "<return>1234</return>"
>> firstNodeText = (axiom_text_t
>> *)axiom_node_get_data_element(return_val_node, env);
>> firstNodeString = axiom_text_get_value(firstNodeText, env);
>> printf("Return Value = %s\n", firstNodeString);
>>
>> Return value is always printed as (null).
>>
>> --- Thanks
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>
>
>
>
> --
> Software Engineer, WSO2 Inc
> http://wso2.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: simple response parsing question

Posted by Rajika Kumarasiri <ra...@gmail.com>.
On Tue, Oct 21, 2008 at 11:35 PM, Tony Hoyt <gm...@yahoo.com> wrote:

> I glanced at that tutorial myself, and I notice a few things.  It seems to
> me the tutorial is out of date and in some cases, the sample code is missing
> language.  Code Listing 10 is missing several of the C operations, "if" and
> "return".  I seem to recall that some of the code listings used depreciated
> function calls, but I 'll have to scan the examples more to find them.
>
> All in all, has anyone generated an updated tutorial for using Axiom?


Patches are welcome!

-Rajika

>
>
> "Opportunities multiply as they are seized." - Sun Tzu
>
>
> --- On Tue, 10/21/08, Supun Kamburugamuva <su...@gmail.com> wrote:
>
> > From: Supun Kamburugamuva <su...@gmail.com>
> > Subject: Re: simple response parsing question
> > To: "Apache AXIS C User List" <ax...@ws.apache.org>
> > Date: Tuesday, October 21, 2008, 1:46 PM
> > This will help you.
> >
> > http://ws.apache.org/axis2/c/docs/om_tutorial.html
> >
> > Supun.
> >
> > On Tue, Oct 21, 2008 at 8:56 PM, Mark Webb
> > <el...@gmail.com> wrote:
> >
> > > I have a web service client written in Axis2C and am
> > getting the
> > > response back properly.  The response is just a long
> > value.  Here is
> > > the XML I receive back:
> > >
> > > <ns2:initResponse
> > > xmlns:ns2="http://service.web.blah/
> > >
> > "><return>1234</return></ns2:initResponse>
> > >
> > > I am using the method axiom_node_get_first_child(node,
> > env) to get the
> > > value node.  I print out the node and get:
> > >
> > > <return>1234</return>
> > >
> > > Problem is that I cannot figure out how to parse out
> > the '1234'.  I
> > > have looked at the examples but cannot get my code to
> > work.  Here is
> > > where I am at:
> > >
> > > printf("NODE = %s\n",
> > axiom_node_to_string( return_val_node, env ));
> > > <----  This prints out
> > "<return>1234</return>"
> > > firstNodeText = (axiom_text_t
> > > *)axiom_node_get_data_element(return_val_node, env);
> > > firstNodeString = axiom_text_get_value(firstNodeText,
> > env);
> > > printf("Return Value = %s\n",
> > firstNodeString);
> > >
> > > Return value is always printed as (null).
> > >
> > > --- Thanks
> > > Mark
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-c-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail:
> > axis-c-user-help@ws.apache.org
> > >
> > >
> >
> >
> > --
> > Software Engineer, WSO2 Inc
> > http://wso2.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>


-- 
http://wso2.org/
http://llvm.org/
http://www.osdev.org/

Re: simple response parsing question

Posted by Tony Hoyt <gm...@yahoo.com>.
I glanced at that tutorial myself, and I notice a few things.  It seems to me the tutorial is out of date and in some cases, the sample code is missing language.  Code Listing 10 is missing several of the C operations, "if" and "return".  I seem to recall that some of the code listings used depreciated function calls, but I 'll have to scan the examples more to find them.

All in all, has anyone generated an updated tutorial for using Axiom?

"Opportunities multiply as they are seized." - Sun Tzu


--- On Tue, 10/21/08, Supun Kamburugamuva <su...@gmail.com> wrote:

> From: Supun Kamburugamuva <su...@gmail.com>
> Subject: Re: simple response parsing question
> To: "Apache AXIS C User List" <ax...@ws.apache.org>
> Date: Tuesday, October 21, 2008, 1:46 PM
> This will help you.
> 
> http://ws.apache.org/axis2/c/docs/om_tutorial.html
> 
> Supun.
> 
> On Tue, Oct 21, 2008 at 8:56 PM, Mark Webb
> <el...@gmail.com> wrote:
> 
> > I have a web service client written in Axis2C and am
> getting the
> > response back properly.  The response is just a long
> value.  Here is
> > the XML I receive back:
> >
> > <ns2:initResponse
> > xmlns:ns2="http://service.web.blah/
> >
> "><return>1234</return></ns2:initResponse>
> >
> > I am using the method axiom_node_get_first_child(node,
> env) to get the
> > value node.  I print out the node and get:
> >
> > <return>1234</return>
> >
> > Problem is that I cannot figure out how to parse out
> the '1234'.  I
> > have looked at the examples but cannot get my code to
> work.  Here is
> > where I am at:
> >
> > printf("NODE = %s\n",
> axiom_node_to_string( return_val_node, env ));
> > <----  This prints out
> "<return>1234</return>"
> > firstNodeText = (axiom_text_t
> > *)axiom_node_get_data_element(return_val_node, env);
> > firstNodeString = axiom_text_get_value(firstNodeText,
> env);
> > printf("Return Value = %s\n",
> firstNodeString);
> >
> > Return value is always printed as (null).
> >
> > --- Thanks
> > Mark
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-c-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> axis-c-user-help@ws.apache.org
> >
> >
> 
> 
> -- 
> Software Engineer, WSO2 Inc
> http://wso2.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: simple response parsing question

Posted by Supun Kamburugamuva <su...@gmail.com>.
This will help you.

http://ws.apache.org/axis2/c/docs/om_tutorial.html

Supun.

On Tue, Oct 21, 2008 at 8:56 PM, Mark Webb <el...@gmail.com> wrote:

> I have a web service client written in Axis2C and am getting the
> response back properly.  The response is just a long value.  Here is
> the XML I receive back:
>
> <ns2:initResponse
> xmlns:ns2="http://service.web.blah/
> "><return>1234</return></ns2:initResponse>
>
> I am using the method axiom_node_get_first_child(node, env) to get the
> value node.  I print out the node and get:
>
> <return>1234</return>
>
> Problem is that I cannot figure out how to parse out the '1234'.  I
> have looked at the examples but cannot get my code to work.  Here is
> where I am at:
>
> printf("NODE = %s\n", axiom_node_to_string( return_val_node, env ));
> <----  This prints out "<return>1234</return>"
> firstNodeText = (axiom_text_t
> *)axiom_node_get_data_element(return_val_node, env);
> firstNodeString = axiom_text_get_value(firstNodeText, env);
> printf("Return Value = %s\n", firstNodeString);
>
> Return value is always printed as (null).
>
> --- Thanks
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>


-- 
Software Engineer, WSO2 Inc
http://wso2.org