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 ramesh Gopal <fa...@yahoo.com> on 2008/11/04 06:32:36 UTC

Some quick Axis2C help required

Hi,

I am new to Axis2C forum.
I am working on Web-Services project using Axis2C framework. Infact, the fi=
rst time I am working on Web-Services.

I have written a skeleton which will read thru an xml request and return an=
xml response.

Sample xml request:
-------------------

<operation>
<in1>1</in1>
<in2>2</in2>
</operation>

My sample code :
----------------

if (node) { --- This is the entire xml
parent_node =3D axiom_node_get_first_element(node, env); --- Here, I though=
I will get operation as the first element, but I get <in1>1</in1> ...

If this is wrong pls point out the exact function that I ought to be using.

{
if (!parent_node)
{ // throw error;
}
request_node =3D axiom_node_get_first_child(parent_node, env);
if (!request_node)
{ // throw error;
}
if (request_node && axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
M_TEXT)
{ // Get value of TEXT --- Here we get value "1"
}
}
sibling_node =3D axiom_node_get_next_sibling(parent_node, env); --- Here I =
get <in2>2</in2>, which is a sibling to <in1>1</in1>

if (!sibling_node) { // throw error ; }
request_node =3D axiom_node_get_first_child(sibling_node, env);
if (!request_node)
{ // throw error;
}
if (request_node && axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
M_TEXT)
{ // Get value of TEXT --- Here we get value "2"
}=20
}


I am running into some issues


Below is some error which I get :
---------------------------------

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208951888 (LWP 19071)]
axiom_node_free_detached_subtree (om_node=3D0x8927758, env=3D0x8920e60)
at om_node.c:105
105 next_sibling =3D child_node->next_sibling;

#0 axiom_node_free_detached_subtree (om_node=3D0x81d9758, env=3D0x81d2e60)
at om_node.c:105
#1 0x006005a2 in axiom_node_free_detached_subtree (om_node=3D0x81d96d0,=20
env=3D0x81d2e60) at om_node.c:106
#2 0x006005a2 in axiom_node_free_detached_subtree (om_node=3D0x81d9528,=20
env=3D0x81d2e60) at om_node.c:106
#3 0x006005a2 in axiom_node_free_detached_subtree (om_node=3D0x81d9478,=20
env=3D0x81d2e60) at om_node.c:106
#4 0x006005a2 in axiom_node_free_detached_subtree (om_node=3D0x81d9198,=20
env=3D0x81d2e60) at om_node.c:106
#5 0x0060026e in axiom_document_free (document=3D0x81d50b8, env=3D0x81d2e60=
)
at om_document.c:87
#6 0x00607b6e in axiom_stax_builder_free (om_builder=3D0x81d5010, env=3D0x8=
1d2e60)
at om_stax_builder.c:897
#7 0x0060e7ad in axiom_soap_builder_free (soap_builder=3D0x81d50d8,=20
env=3D0x81d2e60) at soap_builder.c:188
#8 0x0060dd25 in axiom_soap_envelope_free (soap_envelope=3D0x81d9338,=20
env=3D0x81d2e60) at soap_envelope.c:178
#9 0x0806b2be in axis2_msg_ctx_free (msg_ctx=3D0x81d45f8, env=3D0x81d2e60)
at msg_ctx.c:410
#10 0x00c60b43 in axis2_http_worker_process_request (http_worker=3D0x81d0d3=
8,=20
env=3D0x81d2e60, svr_conn=3D0x81d2e80, simple_request=3D0x81d2f48)
at http_worker.c:1952

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208378448 (LWP 18971)]
axiom_node_create (env=3D0x20202020) at om_node.c:75
75 node =3D (axiom_node_t *) AXIS2_MALLOC(env->allocator, sizeof(axiom_node=
_t));

#0 axiom_node_create (env=3D0x20202020) at om_node.c:75
#1 0x00f250fa in axiom_element_create (env=3D0x20202020, parent=3D0x0,=20
localname=3D0x4e9f8c "outparam0", ns=3D0x0, node=3D0xb7f98f30) at om_elemen=
t.c:78
#2 0x004e9a0f in build_res_text_response ()
from ..//services/ws_test_demo/libws_test_demo.so
#3 0x004e99ac in axis2_skel_ws_test_demo_test_demo ()
from ..//services/ws_test_demo/libws_test_demo.so
#4 0x20202020 in ?? ()
#5 0x20202020 in ?? ()
#6 0x20202020 in ?? ()
#7 0xb7f99000 in ?? ()
#8 0x004e9b62 in axis2_svc_skel_ws_test_demo_invoke ()
from ..//services/ws_test_demo/libws_test_demo.so


Pls let me know, if I am missing something ...

Also, pls let me know if you need more info.
I need some help on an urgent basis.

Rgds,
Ramesh


      Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/


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


Re: Some quick Axis2C help required

Posted by ramesh Gopal <fa...@yahoo.com>.

Hi All,

I have stuck with a few issues against Apache Axis2C.


1) I have deployed the service using Apache Axis, (Deploying to me is only copying the .so, .xml and .wsdl files to the services directory). I do not know if I need to do something more than this.

     Now I want to be able to view the wsdl file from the command

     http://localhost:portno/axis2/services/<service_name>?wsdl

     When I do this, I get an error ---------- "XML Parsing Error: no element found. Location: http://hostname:port/axis2/services/<service_name>?wsdl.. Line Number 1, Column 1:"

     Pls tell me what could be wrong here ? The wsdl seems to be a well-formed one. 


2)  If I have a Java / .NET/ PHP application, and they want to view the wsdl, is there some way for them to see what are the datatypes that the operation supports.
      Is viewing a wsdl file the only way.
     How would any application know from my wsdl what is their equivalent datatype mappings ?

     Also, is it necessary to use xsd types only. Can I not use the same datatypes which my language used (i.e If there is an int / integer datatypes, instead of mapping it to xsd:int;
     can we not display the datatypes as int / integer only)


Ramesh.


      Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/


Re: Some quick Axis2C help required

Posted by Manjula Peiris <ma...@wso2.com>.
Have a look at [1]. It contains axiom test programs.

https://svn.apache.org/repos/asf/webservices/axis2/trunk/c/axiom/test

-Manjula.



On Tue, 2008-11-04 at 18:09 +0530, ramesh Gopal wrote:
> Hi Ssupun,
> 
> Is this a better way as per coding standards.
> Or, the methodology I have been using is more effective.
> 
> In broader terms ,
> 
> Sample xml
> ----------
> <operation>
> <in1>1</in1>
> <in2>2</in2>
> </operation>
> 
> I will first need to get the parent element, and then all the children and loop thru it.
> 
> axiom_element_get_child_elements creates a list. And what does axiom_child_element_iterator_has_next do ?
> 
> Keeping the above mentioned xml, if you can tell me in a few lines of code, which will prevent me from running into the "Segmentation issue", it would be great.
> 
> Thanks
> Ramesh.
> 
> 
> --- On Tue, 4/11/08, Supun Kamburugamuva <su...@gmail.com> wrote:
> 
> > From: Supun Kamburugamuva <su...@gmail.com>
> > Subject: Re: Some quick Axis2C help required
> > To: "Apache AXIS C User List" <ax...@ws.apache.org>, fatuzorin2001@yahoo.com
> > Date: Tuesday, 4 November, 2008, 4:47 PM
> > Here is a code sample for using the child element iterator.
> > You can find
> > this kind of code all over the axis2/C source.
> > 
> > axiom_child_element_iterator_t *ci = NULL;
> > 
> > if ((ci = axiom_element_get_child_elements(element, env,
> > node)) != NULL)
> > {
> >         axiom_element_t *ce = NULL;
> >         axiom_node_t *cn = NULL;
> >         while(AXIS2_TRUE ==
> > axiom_child_element_iterator_has_next(ci, env))
> >         {
> >             cn = axiom_child_element_iterator_next(ci,
> > env);
> >             /* chile element do what ever you want */
> >             ce = axiom_node_get_data_element(cn, env);
> > 
> >         }
> > }
> > 
> > Supun.
> > 
> > On Tue, Nov 4, 2008 at 3:29 PM, ramesh Gopal
> > <fa...@yahoo.com>wrote:
> > 
> > >
> > >
> > > Hi Shankar,
> > >
> > > Could you give me a better solution which achieves
> > this ...
> > >
> > > Basically, I want to read all the child nodes (for a
> > node) and get the
> > > values.
> > >
> > > I have tried using axiom_element_get_child_elements or
> > > axiom_element_get_children ... but in vain, simply
> > because I do not know how
> > > to use them ..
> > >
> > > I have sent you the portion of my code, pls give me
> > your suggestions.
> > >
> > > Rgds,
> > > Ramesh.
> > >
> > >
> > > --- On Tue, 4/11/08, Uthaiyashankar
> > <sh...@wso2.com> wrote:
> > >
> > > > From: Uthaiyashankar <sh...@wso2.com>
> > > > Subject: Re: Some quick Axis2C help required
> > > > To: "Apache AXIS C User List"
> > <ax...@ws.apache.org>
> > > > Date: Tuesday, 4 November, 2008, 1:09 PM
> > > > Hi Ramesh,
> > > >
> > > > See the comments.
> > > >
> > > >
> > > > > Sample xml request:
> > > > > -------------------
> > > > >
> > > > > <operation>
> > > > > <in1>1</in1>
> > > > > <in2>2</in2>
> > > > > </operation>
> > > > >
> > > > > My sample code :
> > > > > ----------------
> > > > >
> > > > > if (node) { --- This is the entire xml
> > > > > parent_node =3D
> > axiom_node_get_first_element(node,
> > > > env); --- Here, I though=
> > > > > I will get operation as the first element,
> > but I get
> > > > <in1>1</in1> ...
> > > > >
> > > >
> > > > You have to do
> > "axiom_node_get_data_element" to
> > > > get <operation> as the
> > > > element. When you do
> > axiom_node_get_first_element, it will
> > > > return first
> > > > child whose type is om element.
> > > >
> > > >
> > > > > If this is wrong pls point out the exact
> > function that
> > > > I ought to be using.
> > > > >
> > > > > {
> > > > > if (!parent_node)
> > > > > { // throw error;
> > > > > }
> > > > > request_node =3D
> > > > axiom_node_get_first_child(parent_node, env);
> > > > > if (!request_node)
> > > > > { // throw error;
> > > > > }
> > > > > if (request_node &&
> > > > axiom_node_get_node_type(request_node, env)
> > =3D=3D AXIO=
> > > > > M_TEXT)
> > > > > { // Get value of TEXT --- Here we get value
> > > > "1"
> > > > > }
> > > > > }
> > > > > sibling_node =3D
> > > > axiom_node_get_next_sibling(parent_node, env);
> > --- Here I =
> > > > > get <in2>2</in2>, which is a
> > sibling to
> > > > <in1>1</in1>
> > > > >
> > > > > if (!sibling_node) { // throw error ; }
> > > > > request_node =3D
> > > > axiom_node_get_first_child(sibling_node, env);
> > > > > if (!request_node)
> > > > > { // throw error;
> > > > > }
> > > > > if (request_node &&
> > > > axiom_node_get_node_type(request_node, env)
> > =3D=3D AXIO=
> > > > > M_TEXT)
> > > > > { // Get value of TEXT --- Here we get value
> > > > "2"
> > > > > }=20
> > > > > }
> > > > >
> > > > >
> > > > > I am running into some issues
> > > > >
> > > >
> > > >  First error is caused by
> > axiom_node_free_detached_subtree,
> > > > which I
> > > > could not find in the code you have sent. Can you
> > send the
> > > > correct code
> > > > which causes these errors?
> > > >
> > > > Regards,
> > > > Shankar
> > > >
> > > > >
> > > > > Below is some error which I get :
> > > > > ---------------------------------
> > > > >
> > > > > Program received signal SIGSEGV,
> > Segmentation fault.
> > > > > [Switching to Thread -1208951888 (LWP
> > 19071)]
> > > > > axiom_node_free_detached_subtree
> > (om_node=3D0x8927758,
> > > > env=3D0x8920e60)
> > > > > at om_node.c:105
> > > > > 105 next_sibling =3D
> > child_node->next_sibling;
> > > > >
> > > > > #0 axiom_node_free_detached_subtree
> > > > (om_node=3D0x81d9758, env=3D0x81d2e60)
> > > > > at om_node.c:105
> > > > > #1 0x006005a2 in
> > axiom_node_free_detached_subtree
> > > > (om_node=3D0x81d96d0,=20
> > > > > env=3D0x81d2e60) at om_node.c:106
> > > > > #2 0x006005a2 in
> > axiom_node_free_detached_subtree
> > > > (om_node=3D0x81d9528,=20
> > > > > env=3D0x81d2e60) at om_node.c:106
> > > > > #3 0x006005a2 in
> > axiom_node_free_detached_subtree
> > > > (om_node=3D0x81d9478,=20
> > > > > env=3D0x81d2e60) at om_node.c:106
> > > > > #4 0x006005a2 in
> > axiom_node_free_detached_subtree
> > > > (om_node=3D0x81d9198,=20
> > > > > env=3D0x81d2e60) at om_node.c:106
> > > > > #5 0x0060026e in axiom_document_free
> > > > (document=3D0x81d50b8, env=3D0x81d2e60=
> > > > > )
> > > > > at om_document.c:87
> > > > > #6 0x00607b6e in axiom_stax_builder_free
> > > > (om_builder=3D0x81d5010, env=3D0x8=
> > > > > 1d2e60)
> > > > > at om_stax_builder.c:897
> > > > > #7 0x0060e7ad in axiom_soap_builder_free
> > > > (soap_builder=3D0x81d50d8,=20
> > > > > env=3D0x81d2e60) at soap_builder.c:188
> > > > > #8 0x0060dd25 in axiom_soap_envelope_free
> > > > (soap_envelope=3D0x81d9338,=20
> > > > > env=3D0x81d2e60) at soap_envelope.c:178
> > > > > #9 0x0806b2be in axis2_msg_ctx_free
> > > > (msg_ctx=3D0x81d45f8, env=3D0x81d2e60)
> > > > > at msg_ctx.c:410
> > > > > #10 0x00c60b43 in
> > axis2_http_worker_process_request
> > > > (http_worker=3D0x81d0d3=
> > > > > 8,=20
> > > > > env=3D0x81d2e60, svr_conn=3D0x81d2e80,
> > > > simple_request=3D0x81d2f48)
> > > > > at http_worker.c:1952
> > > > >
> > > > > Program received signal SIGSEGV,
> > Segmentation fault.
> > > > > [Switching to Thread -1208378448 (LWP
> > 18971)]
> > > > > axiom_node_create (env=3D0x20202020) at
> > om_node.c:75
> > > > > 75 node =3D (axiom_node_t *)
> > > > AXIS2_MALLOC(env->allocator,
> > sizeof(axiom_node=
> > > > > _t));
> > > > >
> > > > > #0 axiom_node_create (env=3D0x20202020) at
> > > > om_node.c:75
> > > > > #1 0x00f250fa in axiom_element_create
> > > > (env=3D0x20202020, parent=3D0x0,=20
> > > > > localname=3D0x4e9f8c "outparam0",
> > ns=3D0x0,
> > > > node=3D0xb7f98f30) at om_elemen=
> > > > > t.c:78
> > > > > #2 0x004e9a0f in build_res_text_response ()
> > > > > from
> > ..//services/ws_test_demo/libws_test_demo.so
> > > > > #3 0x004e99ac in
> > axis2_skel_ws_test_demo_test_demo ()
> > > > > from
> > ..//services/ws_test_demo/libws_test_demo.so
> > > > > #4 0x20202020 in ?? ()
> > > > > #5 0x20202020 in ?? ()
> > > > > #6 0x20202020 in ?? ()
> > > > > #7 0xb7f99000 in ?? ()
> > > > > #8 0x004e9b62 in
> > axis2_svc_skel_ws_test_demo_invoke ()
> > > > > from
> > ..//services/ws_test_demo/libws_test_demo.so
> > > > >
> > > > >
> > > > > Pls let me know, if I am missing something
> > ...
> > > > >
> > > > > Also, pls let me know if you need more info.
> > > > > I need some help on an urgent basis.
> > > > >
> > > > > Rgds,
> > > > > Ramesh
> > > > >
> > > > >
> > > > >       Add more friends to your messenger and
> > enjoy! Go
> > > > to http://messenger.yahoo.com/invite/
> > > > >
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > axis-c-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail:
> > > > axis-c-user-help@ws.apache.org
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > S.Uthaiyashankar
> > > > Software Architect
> > > > WSO2 Inc.
> > > > http://wso2.com/ - "The Open Source SOA
> > Company"
> > > >
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > axis-c-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail:
> > > > axis-c-user-help@ws.apache.org
> > >
> > >
> > >       Share files, take polls, and make new friends -
> > all under one roof.
> > > Go to http://in.promos.yahoo.com/groups/
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > 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
> > Web Services with Axis2/C http://wsaxc.blospot.com
> 
> 
>       Get rid of Add-Ons in your email ID. Get yourname@rocketmail.com. Sign up now! http://in.promos.yahoo.com/address
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.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: Some quick Axis2C help required

Posted by ramesh Gopal <fa...@yahoo.com>.
Hi Ssupun,

Is this a better way as per coding standards.
Or, the methodology I have been using is more effective.

In broader terms ,

Sample xml
----------
<operation>
<in1>1</in1>
<in2>2</in2>
</operation>

I will first need to get the parent element, and then all the children and loop thru it.

axiom_element_get_child_elements creates a list. And what does axiom_child_element_iterator_has_next do ?

Keeping the above mentioned xml, if you can tell me in a few lines of code, which will prevent me from running into the "Segmentation issue", it would be great.

Thanks
Ramesh.


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

> From: Supun Kamburugamuva <su...@gmail.com>
> Subject: Re: Some quick Axis2C help required
> To: "Apache AXIS C User List" <ax...@ws.apache.org>, fatuzorin2001@yahoo.com
> Date: Tuesday, 4 November, 2008, 4:47 PM
> Here is a code sample for using the child element iterator.
> You can find
> this kind of code all over the axis2/C source.
> 
> axiom_child_element_iterator_t *ci = NULL;
> 
> if ((ci = axiom_element_get_child_elements(element, env,
> node)) != NULL)
> {
>         axiom_element_t *ce = NULL;
>         axiom_node_t *cn = NULL;
>         while(AXIS2_TRUE ==
> axiom_child_element_iterator_has_next(ci, env))
>         {
>             cn = axiom_child_element_iterator_next(ci,
> env);
>             /* chile element do what ever you want */
>             ce = axiom_node_get_data_element(cn, env);
> 
>         }
> }
> 
> Supun.
> 
> On Tue, Nov 4, 2008 at 3:29 PM, ramesh Gopal
> <fa...@yahoo.com>wrote:
> 
> >
> >
> > Hi Shankar,
> >
> > Could you give me a better solution which achieves
> this ...
> >
> > Basically, I want to read all the child nodes (for a
> node) and get the
> > values.
> >
> > I have tried using axiom_element_get_child_elements or
> > axiom_element_get_children ... but in vain, simply
> because I do not know how
> > to use them ..
> >
> > I have sent you the portion of my code, pls give me
> your suggestions.
> >
> > Rgds,
> > Ramesh.
> >
> >
> > --- On Tue, 4/11/08, Uthaiyashankar
> <sh...@wso2.com> wrote:
> >
> > > From: Uthaiyashankar <sh...@wso2.com>
> > > Subject: Re: Some quick Axis2C help required
> > > To: "Apache AXIS C User List"
> <ax...@ws.apache.org>
> > > Date: Tuesday, 4 November, 2008, 1:09 PM
> > > Hi Ramesh,
> > >
> > > See the comments.
> > >
> > >
> > > > Sample xml request:
> > > > -------------------
> > > >
> > > > <operation>
> > > > <in1>1</in1>
> > > > <in2>2</in2>
> > > > </operation>
> > > >
> > > > My sample code :
> > > > ----------------
> > > >
> > > > if (node) { --- This is the entire xml
> > > > parent_node =3D
> axiom_node_get_first_element(node,
> > > env); --- Here, I though=
> > > > I will get operation as the first element,
> but I get
> > > <in1>1</in1> ...
> > > >
> > >
> > > You have to do
> "axiom_node_get_data_element" to
> > > get <operation> as the
> > > element. When you do
> axiom_node_get_first_element, it will
> > > return first
> > > child whose type is om element.
> > >
> > >
> > > > If this is wrong pls point out the exact
> function that
> > > I ought to be using.
> > > >
> > > > {
> > > > if (!parent_node)
> > > > { // throw error;
> > > > }
> > > > request_node =3D
> > > axiom_node_get_first_child(parent_node, env);
> > > > if (!request_node)
> > > > { // throw error;
> > > > }
> > > > if (request_node &&
> > > axiom_node_get_node_type(request_node, env)
> =3D=3D AXIO=
> > > > M_TEXT)
> > > > { // Get value of TEXT --- Here we get value
> > > "1"
> > > > }
> > > > }
> > > > sibling_node =3D
> > > axiom_node_get_next_sibling(parent_node, env);
> --- Here I =
> > > > get <in2>2</in2>, which is a
> sibling to
> > > <in1>1</in1>
> > > >
> > > > if (!sibling_node) { // throw error ; }
> > > > request_node =3D
> > > axiom_node_get_first_child(sibling_node, env);
> > > > if (!request_node)
> > > > { // throw error;
> > > > }
> > > > if (request_node &&
> > > axiom_node_get_node_type(request_node, env)
> =3D=3D AXIO=
> > > > M_TEXT)
> > > > { // Get value of TEXT --- Here we get value
> > > "2"
> > > > }=20
> > > > }
> > > >
> > > >
> > > > I am running into some issues
> > > >
> > >
> > >  First error is caused by
> axiom_node_free_detached_subtree,
> > > which I
> > > could not find in the code you have sent. Can you
> send the
> > > correct code
> > > which causes these errors?
> > >
> > > Regards,
> > > Shankar
> > >
> > > >
> > > > Below is some error which I get :
> > > > ---------------------------------
> > > >
> > > > Program received signal SIGSEGV,
> Segmentation fault.
> > > > [Switching to Thread -1208951888 (LWP
> 19071)]
> > > > axiom_node_free_detached_subtree
> (om_node=3D0x8927758,
> > > env=3D0x8920e60)
> > > > at om_node.c:105
> > > > 105 next_sibling =3D
> child_node->next_sibling;
> > > >
> > > > #0 axiom_node_free_detached_subtree
> > > (om_node=3D0x81d9758, env=3D0x81d2e60)
> > > > at om_node.c:105
> > > > #1 0x006005a2 in
> axiom_node_free_detached_subtree
> > > (om_node=3D0x81d96d0,=20
> > > > env=3D0x81d2e60) at om_node.c:106
> > > > #2 0x006005a2 in
> axiom_node_free_detached_subtree
> > > (om_node=3D0x81d9528,=20
> > > > env=3D0x81d2e60) at om_node.c:106
> > > > #3 0x006005a2 in
> axiom_node_free_detached_subtree
> > > (om_node=3D0x81d9478,=20
> > > > env=3D0x81d2e60) at om_node.c:106
> > > > #4 0x006005a2 in
> axiom_node_free_detached_subtree
> > > (om_node=3D0x81d9198,=20
> > > > env=3D0x81d2e60) at om_node.c:106
> > > > #5 0x0060026e in axiom_document_free
> > > (document=3D0x81d50b8, env=3D0x81d2e60=
> > > > )
> > > > at om_document.c:87
> > > > #6 0x00607b6e in axiom_stax_builder_free
> > > (om_builder=3D0x81d5010, env=3D0x8=
> > > > 1d2e60)
> > > > at om_stax_builder.c:897
> > > > #7 0x0060e7ad in axiom_soap_builder_free
> > > (soap_builder=3D0x81d50d8,=20
> > > > env=3D0x81d2e60) at soap_builder.c:188
> > > > #8 0x0060dd25 in axiom_soap_envelope_free
> > > (soap_envelope=3D0x81d9338,=20
> > > > env=3D0x81d2e60) at soap_envelope.c:178
> > > > #9 0x0806b2be in axis2_msg_ctx_free
> > > (msg_ctx=3D0x81d45f8, env=3D0x81d2e60)
> > > > at msg_ctx.c:410
> > > > #10 0x00c60b43 in
> axis2_http_worker_process_request
> > > (http_worker=3D0x81d0d3=
> > > > 8,=20
> > > > env=3D0x81d2e60, svr_conn=3D0x81d2e80,
> > > simple_request=3D0x81d2f48)
> > > > at http_worker.c:1952
> > > >
> > > > Program received signal SIGSEGV,
> Segmentation fault.
> > > > [Switching to Thread -1208378448 (LWP
> 18971)]
> > > > axiom_node_create (env=3D0x20202020) at
> om_node.c:75
> > > > 75 node =3D (axiom_node_t *)
> > > AXIS2_MALLOC(env->allocator,
> sizeof(axiom_node=
> > > > _t));
> > > >
> > > > #0 axiom_node_create (env=3D0x20202020) at
> > > om_node.c:75
> > > > #1 0x00f250fa in axiom_element_create
> > > (env=3D0x20202020, parent=3D0x0,=20
> > > > localname=3D0x4e9f8c "outparam0",
> ns=3D0x0,
> > > node=3D0xb7f98f30) at om_elemen=
> > > > t.c:78
> > > > #2 0x004e9a0f in build_res_text_response ()
> > > > from
> ..//services/ws_test_demo/libws_test_demo.so
> > > > #3 0x004e99ac in
> axis2_skel_ws_test_demo_test_demo ()
> > > > from
> ..//services/ws_test_demo/libws_test_demo.so
> > > > #4 0x20202020 in ?? ()
> > > > #5 0x20202020 in ?? ()
> > > > #6 0x20202020 in ?? ()
> > > > #7 0xb7f99000 in ?? ()
> > > > #8 0x004e9b62 in
> axis2_svc_skel_ws_test_demo_invoke ()
> > > > from
> ..//services/ws_test_demo/libws_test_demo.so
> > > >
> > > >
> > > > Pls let me know, if I am missing something
> ...
> > > >
> > > > Also, pls let me know if you need more info.
> > > > I need some help on an urgent basis.
> > > >
> > > > Rgds,
> > > > Ramesh
> > > >
> > > >
> > > >       Add more friends to your messenger and
> enjoy! Go
> > > to http://messenger.yahoo.com/invite/
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > axis-c-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail:
> > > axis-c-user-help@ws.apache.org
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > S.Uthaiyashankar
> > > Software Architect
> > > WSO2 Inc.
> > > http://wso2.com/ - "The Open Source SOA
> Company"
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > axis-c-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail:
> > > axis-c-user-help@ws.apache.org
> >
> >
> >       Share files, take polls, and make new friends -
> all under one roof.
> > Go to http://in.promos.yahoo.com/groups/
> >
> >
> >
> ---------------------------------------------------------------------
> > 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
> Web Services with Axis2/C http://wsaxc.blospot.com


      Get rid of Add-Ons in your email ID. Get yourname@rocketmail.com. Sign up now! http://in.promos.yahoo.com/address


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


Re: Some quick Axis2C help required

Posted by Supun Kamburugamuva <su...@gmail.com>.
Here is a code sample for using the child element iterator. You can find
this kind of code all over the axis2/C source.

axiom_child_element_iterator_t *ci = NULL;

if ((ci = axiom_element_get_child_elements(element, env, node)) != NULL)
{
        axiom_element_t *ce = NULL;
        axiom_node_t *cn = NULL;
        while(AXIS2_TRUE == axiom_child_element_iterator_has_next(ci, env))
        {
            cn = axiom_child_element_iterator_next(ci, env);
            /* chile element do what ever you want */
            ce = axiom_node_get_data_element(cn, env);

        }
}

Supun.

On Tue, Nov 4, 2008 at 3:29 PM, ramesh Gopal <fa...@yahoo.com>wrote:

>
>
> Hi Shankar,
>
> Could you give me a better solution which achieves this ...
>
> Basically, I want to read all the child nodes (for a node) and get the
> values.
>
> I have tried using axiom_element_get_child_elements or
> axiom_element_get_children ... but in vain, simply because I do not know how
> to use them ..
>
> I have sent you the portion of my code, pls give me your suggestions.
>
> Rgds,
> Ramesh.
>
>
> --- On Tue, 4/11/08, Uthaiyashankar <sh...@wso2.com> wrote:
>
> > From: Uthaiyashankar <sh...@wso2.com>
> > Subject: Re: Some quick Axis2C help required
> > To: "Apache AXIS C User List" <ax...@ws.apache.org>
> > Date: Tuesday, 4 November, 2008, 1:09 PM
> > Hi Ramesh,
> >
> > See the comments.
> >
> >
> > > Sample xml request:
> > > -------------------
> > >
> > > <operation>
> > > <in1>1</in1>
> > > <in2>2</in2>
> > > </operation>
> > >
> > > My sample code :
> > > ----------------
> > >
> > > if (node) { --- This is the entire xml
> > > parent_node =3D axiom_node_get_first_element(node,
> > env); --- Here, I though=
> > > I will get operation as the first element, but I get
> > <in1>1</in1> ...
> > >
> >
> > You have to do "axiom_node_get_data_element" to
> > get <operation> as the
> > element. When you do axiom_node_get_first_element, it will
> > return first
> > child whose type is om element.
> >
> >
> > > If this is wrong pls point out the exact function that
> > I ought to be using.
> > >
> > > {
> > > if (!parent_node)
> > > { // throw error;
> > > }
> > > request_node =3D
> > axiom_node_get_first_child(parent_node, env);
> > > if (!request_node)
> > > { // throw error;
> > > }
> > > if (request_node &&
> > axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
> > > M_TEXT)
> > > { // Get value of TEXT --- Here we get value
> > "1"
> > > }
> > > }
> > > sibling_node =3D
> > axiom_node_get_next_sibling(parent_node, env); --- Here I =
> > > get <in2>2</in2>, which is a sibling to
> > <in1>1</in1>
> > >
> > > if (!sibling_node) { // throw error ; }
> > > request_node =3D
> > axiom_node_get_first_child(sibling_node, env);
> > > if (!request_node)
> > > { // throw error;
> > > }
> > > if (request_node &&
> > axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
> > > M_TEXT)
> > > { // Get value of TEXT --- Here we get value
> > "2"
> > > }=20
> > > }
> > >
> > >
> > > I am running into some issues
> > >
> >
> >  First error is caused by axiom_node_free_detached_subtree,
> > which I
> > could not find in the code you have sent. Can you send the
> > correct code
> > which causes these errors?
> >
> > Regards,
> > Shankar
> >
> > >
> > > Below is some error which I get :
> > > ---------------------------------
> > >
> > > Program received signal SIGSEGV, Segmentation fault.
> > > [Switching to Thread -1208951888 (LWP 19071)]
> > > axiom_node_free_detached_subtree (om_node=3D0x8927758,
> > env=3D0x8920e60)
> > > at om_node.c:105
> > > 105 next_sibling =3D child_node->next_sibling;
> > >
> > > #0 axiom_node_free_detached_subtree
> > (om_node=3D0x81d9758, env=3D0x81d2e60)
> > > at om_node.c:105
> > > #1 0x006005a2 in axiom_node_free_detached_subtree
> > (om_node=3D0x81d96d0,=20
> > > env=3D0x81d2e60) at om_node.c:106
> > > #2 0x006005a2 in axiom_node_free_detached_subtree
> > (om_node=3D0x81d9528,=20
> > > env=3D0x81d2e60) at om_node.c:106
> > > #3 0x006005a2 in axiom_node_free_detached_subtree
> > (om_node=3D0x81d9478,=20
> > > env=3D0x81d2e60) at om_node.c:106
> > > #4 0x006005a2 in axiom_node_free_detached_subtree
> > (om_node=3D0x81d9198,=20
> > > env=3D0x81d2e60) at om_node.c:106
> > > #5 0x0060026e in axiom_document_free
> > (document=3D0x81d50b8, env=3D0x81d2e60=
> > > )
> > > at om_document.c:87
> > > #6 0x00607b6e in axiom_stax_builder_free
> > (om_builder=3D0x81d5010, env=3D0x8=
> > > 1d2e60)
> > > at om_stax_builder.c:897
> > > #7 0x0060e7ad in axiom_soap_builder_free
> > (soap_builder=3D0x81d50d8,=20
> > > env=3D0x81d2e60) at soap_builder.c:188
> > > #8 0x0060dd25 in axiom_soap_envelope_free
> > (soap_envelope=3D0x81d9338,=20
> > > env=3D0x81d2e60) at soap_envelope.c:178
> > > #9 0x0806b2be in axis2_msg_ctx_free
> > (msg_ctx=3D0x81d45f8, env=3D0x81d2e60)
> > > at msg_ctx.c:410
> > > #10 0x00c60b43 in axis2_http_worker_process_request
> > (http_worker=3D0x81d0d3=
> > > 8,=20
> > > env=3D0x81d2e60, svr_conn=3D0x81d2e80,
> > simple_request=3D0x81d2f48)
> > > at http_worker.c:1952
> > >
> > > Program received signal SIGSEGV, Segmentation fault.
> > > [Switching to Thread -1208378448 (LWP 18971)]
> > > axiom_node_create (env=3D0x20202020) at om_node.c:75
> > > 75 node =3D (axiom_node_t *)
> > AXIS2_MALLOC(env->allocator, sizeof(axiom_node=
> > > _t));
> > >
> > > #0 axiom_node_create (env=3D0x20202020) at
> > om_node.c:75
> > > #1 0x00f250fa in axiom_element_create
> > (env=3D0x20202020, parent=3D0x0,=20
> > > localname=3D0x4e9f8c "outparam0", ns=3D0x0,
> > node=3D0xb7f98f30) at om_elemen=
> > > t.c:78
> > > #2 0x004e9a0f in build_res_text_response ()
> > > from ..//services/ws_test_demo/libws_test_demo.so
> > > #3 0x004e99ac in axis2_skel_ws_test_demo_test_demo ()
> > > from ..//services/ws_test_demo/libws_test_demo.so
> > > #4 0x20202020 in ?? ()
> > > #5 0x20202020 in ?? ()
> > > #6 0x20202020 in ?? ()
> > > #7 0xb7f99000 in ?? ()
> > > #8 0x004e9b62 in axis2_svc_skel_ws_test_demo_invoke ()
> > > from ..//services/ws_test_demo/libws_test_demo.so
> > >
> > >
> > > Pls let me know, if I am missing something ...
> > >
> > > Also, pls let me know if you need more info.
> > > I need some help on an urgent basis.
> > >
> > > Rgds,
> > > Ramesh
> > >
> > >
> > >       Add more friends to your messenger and enjoy! Go
> > to http://messenger.yahoo.com/invite/
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-c-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail:
> > axis-c-user-help@ws.apache.org
> > >
> > >
> > >
> > >
> >
> >
> > --
> > S.Uthaiyashankar
> > Software Architect
> > WSO2 Inc.
> > http://wso2.com/ - "The Open Source SOA Company"
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > axis-c-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> > axis-c-user-help@ws.apache.org
>
>
>       Share files, take polls, and make new friends - all under one roof.
> Go to http://in.promos.yahoo.com/groups/
>
>
> ---------------------------------------------------------------------
> 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
Web Services with Axis2/C http://wsaxc.blospot.com

Re: Some quick Axis2C help required

Posted by ramesh Gopal <fa...@yahoo.com>.
Hi,

------------------
Generated Code is
------------------

    AXIS2_ENV_CHECK(env, NULL);
    if (!node) ---- Complete Node
    {
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SVC_SKEL_INVALID_XML_FORMAT_IN_REQUEST, AXIS2_FAILURE);
        printf("ERROR: invalid XML in request\n");
    }
    parent_node = axiom_node_get_first_element(node, env);
    if (!parent_node)
    {
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SVC_SKEL_INVALID_XML_FORMAT_IN_REQUEST, AXIS2_FAILURE);
        printf("ERROR: invalid XML in request\n");
    }
    request_node = axiom_node_get_first_child(parent_node, env);
    if (!request_node)
    {
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SVC_SKEL_INVALID_XML_FORMAT_IN_REQUEST, AXIS2_FAILURE);
        printf("ERROR: invalid XML in request\n");
    }
    if (request_node && axiom_node_get_node_type(request_node, env) == AXIOM_TEXT)
    {
        axiom_text_t *reqtext = (axiom_text_t *)axiom_node_get_data_element(request_node, env);
        if (reqtext && axiom_text_get_value(reqtext , env))
        {
            const axis2_char_t *reqtext_str = axiom_text_get_value(reqtext, env);
            inparam0 = reqtext_str;
            printf("The first param is %s : \n", inparam0);
        }
    }
    sibling_node = axiom_node_get_next_sibling(parent_node, env);
    if (!sibling_node)
    {
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SVC_SKEL_INVALID_XML_FORMAT_IN_REQUEST, AXIS2_FAILURE);
        printf("ERROR: invalid XML in request while getting sibling");
    }
    request_node =  axiom_node_get_first_child(sibling_node, env);
    if (request_node && axiom_node_get_node_type(request_node, env) == AXIOM_TEXT)
    {
        axiom_text_t *reqtext = (axiom_text_t *)axiom_node_get_data_element(request_node, env);
        if (reqtext && axiom_text_get_value(reqtext , env))
        {
            const axis2_char_t *reqtext_str = axiom_text_get_value(reqtext, env);
            inparam1 = reqtext_str;
            printf("The second param is %s : \n", inparam1);
        }
    }


Does this help ?

With this code, can you pin-point the area of code which could be faulty.
Also, if you can suggest what change I need to be doing to avoid the "Segmentation Fault" issue.


Rgds,
Ramesh.


--- On Tue, 4/11/08, Uthaiyashankar <sh...@wso2.com> wrote:

> From: Uthaiyashankar <sh...@wso2.com>
> Subject: Re: Some quick Axis2C help required
> To: "Apache AXIS C User List" <ax...@ws.apache.org>
> Date: Tuesday, 4 November, 2008, 1:09 PM
> Hi Ramesh,
> 
> See the comments.
> 
> 
> > Sample xml request:
> > -------------------
> >
> > <operation>
> > <in1>1</in1>
> > <in2>2</in2>
> > </operation>
> >
> > My sample code :
> > ----------------
> >
> > if (node) { --- This is the entire xml
> > parent_node =3D axiom_node_get_first_element(node,
> env); --- Here, I though=
> > I will get operation as the first element, but I get
> <in1>1</in1> ...
> >   
> 
> You have to do "axiom_node_get_data_element" to
> get <operation> as the 
> element. When you do axiom_node_get_first_element, it will
> return first 
> child whose type is om element.
> 
> 
> > If this is wrong pls point out the exact function that
> I ought to be using.
> >
> > {
> > if (!parent_node)
> > { // throw error;
> > }
> > request_node =3D
> axiom_node_get_first_child(parent_node, env);
> > if (!request_node)
> > { // throw error;
> > }
> > if (request_node &&
> axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
> > M_TEXT)
> > { // Get value of TEXT --- Here we get value
> "1"
> > }
> > }
> > sibling_node =3D
> axiom_node_get_next_sibling(parent_node, env); --- Here I =
> > get <in2>2</in2>, which is a sibling to
> <in1>1</in1>
> >
> > if (!sibling_node) { // throw error ; }
> > request_node =3D
> axiom_node_get_first_child(sibling_node, env);
> > if (!request_node)
> > { // throw error;
> > }
> > if (request_node &&
> axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
> > M_TEXT)
> > { // Get value of TEXT --- Here we get value
> "2"
> > }=20
> > }
> >
> >
> > I am running into some issues
> >   
> 
>  First error is caused by axiom_node_free_detached_subtree,
> which I 
> could not find in the code you have sent. Can you send the
> correct code 
> which causes these errors?
> 
> Regards,
> Shankar
> 
> >
> > Below is some error which I get :
> > ---------------------------------
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread -1208951888 (LWP 19071)]
> > axiom_node_free_detached_subtree (om_node=3D0x8927758,
> env=3D0x8920e60)
> > at om_node.c:105
> > 105 next_sibling =3D child_node->next_sibling;
> >
> > #0 axiom_node_free_detached_subtree
> (om_node=3D0x81d9758, env=3D0x81d2e60)
> > at om_node.c:105
> > #1 0x006005a2 in axiom_node_free_detached_subtree
> (om_node=3D0x81d96d0,=20
> > env=3D0x81d2e60) at om_node.c:106
> > #2 0x006005a2 in axiom_node_free_detached_subtree
> (om_node=3D0x81d9528,=20
> > env=3D0x81d2e60) at om_node.c:106
> > #3 0x006005a2 in axiom_node_free_detached_subtree
> (om_node=3D0x81d9478,=20
> > env=3D0x81d2e60) at om_node.c:106
> > #4 0x006005a2 in axiom_node_free_detached_subtree
> (om_node=3D0x81d9198,=20
> > env=3D0x81d2e60) at om_node.c:106
> > #5 0x0060026e in axiom_document_free
> (document=3D0x81d50b8, env=3D0x81d2e60=
> > )
> > at om_document.c:87
> > #6 0x00607b6e in axiom_stax_builder_free
> (om_builder=3D0x81d5010, env=3D0x8=
> > 1d2e60)
> > at om_stax_builder.c:897
> > #7 0x0060e7ad in axiom_soap_builder_free
> (soap_builder=3D0x81d50d8,=20
> > env=3D0x81d2e60) at soap_builder.c:188
> > #8 0x0060dd25 in axiom_soap_envelope_free
> (soap_envelope=3D0x81d9338,=20
> > env=3D0x81d2e60) at soap_envelope.c:178
> > #9 0x0806b2be in axis2_msg_ctx_free
> (msg_ctx=3D0x81d45f8, env=3D0x81d2e60)
> > at msg_ctx.c:410
> > #10 0x00c60b43 in axis2_http_worker_process_request
> (http_worker=3D0x81d0d3=
> > 8,=20
> > env=3D0x81d2e60, svr_conn=3D0x81d2e80,
> simple_request=3D0x81d2f48)
> > at http_worker.c:1952
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread -1208378448 (LWP 18971)]
> > axiom_node_create (env=3D0x20202020) at om_node.c:75
> > 75 node =3D (axiom_node_t *)
> AXIS2_MALLOC(env->allocator, sizeof(axiom_node=
> > _t));
> >
> > #0 axiom_node_create (env=3D0x20202020) at
> om_node.c:75
> > #1 0x00f250fa in axiom_element_create
> (env=3D0x20202020, parent=3D0x0,=20
> > localname=3D0x4e9f8c "outparam0", ns=3D0x0,
> node=3D0xb7f98f30) at om_elemen=
> > t.c:78
> > #2 0x004e9a0f in build_res_text_response ()
> > from ..//services/ws_test_demo/libws_test_demo.so
> > #3 0x004e99ac in axis2_skel_ws_test_demo_test_demo ()
> > from ..//services/ws_test_demo/libws_test_demo.so
> > #4 0x20202020 in ?? ()
> > #5 0x20202020 in ?? ()
> > #6 0x20202020 in ?? ()
> > #7 0xb7f99000 in ?? ()
> > #8 0x004e9b62 in axis2_svc_skel_ws_test_demo_invoke ()
> > from ..//services/ws_test_demo/libws_test_demo.so
> >
> >
> > Pls let me know, if I am missing something ...
> >
> > Also, pls let me know if you need more info.
> > I need some help on an urgent basis.
> >
> > Rgds,
> > Ramesh
> >
> >
> >       Add more friends to your messenger and enjoy! Go
> to http://messenger.yahoo.com/invite/
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-c-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> axis-c-user-help@ws.apache.org
> >
> >
> >
> >   
> 
> 
> -- 
> S.Uthaiyashankar
> Software Architect
> WSO2 Inc. 
> http://wso2.com/ - "The Open Source SOA Company" 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail:
> axis-c-user-help@ws.apache.org


      Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/


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


Re: Some quick Axis2C help required

Posted by ramesh Gopal <fa...@yahoo.com>.

Hi Shankar,

Could you give me a better solution which achieves this ...

Basically, I want to read all the child nodes (for a node) and get the values.

I have tried using axiom_element_get_child_elements or axiom_element_get_children ... but in vain, simply because I do not know how to use them ..

I have sent you the portion of my code, pls give me your suggestions.

Rgds,
Ramesh.


--- On Tue, 4/11/08, Uthaiyashankar <sh...@wso2.com> wrote:

> From: Uthaiyashankar <sh...@wso2.com>
> Subject: Re: Some quick Axis2C help required
> To: "Apache AXIS C User List" <ax...@ws.apache.org>
> Date: Tuesday, 4 November, 2008, 1:09 PM
> Hi Ramesh,
> 
> See the comments.
> 
> 
> > Sample xml request:
> > -------------------
> >
> > <operation>
> > <in1>1</in1>
> > <in2>2</in2>
> > </operation>
> >
> > My sample code :
> > ----------------
> >
> > if (node) { --- This is the entire xml
> > parent_node =3D axiom_node_get_first_element(node,
> env); --- Here, I though=
> > I will get operation as the first element, but I get
> <in1>1</in1> ...
> >   
> 
> You have to do "axiom_node_get_data_element" to
> get <operation> as the 
> element. When you do axiom_node_get_first_element, it will
> return first 
> child whose type is om element.
> 
> 
> > If this is wrong pls point out the exact function that
> I ought to be using.
> >
> > {
> > if (!parent_node)
> > { // throw error;
> > }
> > request_node =3D
> axiom_node_get_first_child(parent_node, env);
> > if (!request_node)
> > { // throw error;
> > }
> > if (request_node &&
> axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
> > M_TEXT)
> > { // Get value of TEXT --- Here we get value
> "1"
> > }
> > }
> > sibling_node =3D
> axiom_node_get_next_sibling(parent_node, env); --- Here I =
> > get <in2>2</in2>, which is a sibling to
> <in1>1</in1>
> >
> > if (!sibling_node) { // throw error ; }
> > request_node =3D
> axiom_node_get_first_child(sibling_node, env);
> > if (!request_node)
> > { // throw error;
> > }
> > if (request_node &&
> axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
> > M_TEXT)
> > { // Get value of TEXT --- Here we get value
> "2"
> > }=20
> > }
> >
> >
> > I am running into some issues
> >   
> 
>  First error is caused by axiom_node_free_detached_subtree,
> which I 
> could not find in the code you have sent. Can you send the
> correct code 
> which causes these errors?
> 
> Regards,
> Shankar
> 
> >
> > Below is some error which I get :
> > ---------------------------------
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread -1208951888 (LWP 19071)]
> > axiom_node_free_detached_subtree (om_node=3D0x8927758,
> env=3D0x8920e60)
> > at om_node.c:105
> > 105 next_sibling =3D child_node->next_sibling;
> >
> > #0 axiom_node_free_detached_subtree
> (om_node=3D0x81d9758, env=3D0x81d2e60)
> > at om_node.c:105
> > #1 0x006005a2 in axiom_node_free_detached_subtree
> (om_node=3D0x81d96d0,=20
> > env=3D0x81d2e60) at om_node.c:106
> > #2 0x006005a2 in axiom_node_free_detached_subtree
> (om_node=3D0x81d9528,=20
> > env=3D0x81d2e60) at om_node.c:106
> > #3 0x006005a2 in axiom_node_free_detached_subtree
> (om_node=3D0x81d9478,=20
> > env=3D0x81d2e60) at om_node.c:106
> > #4 0x006005a2 in axiom_node_free_detached_subtree
> (om_node=3D0x81d9198,=20
> > env=3D0x81d2e60) at om_node.c:106
> > #5 0x0060026e in axiom_document_free
> (document=3D0x81d50b8, env=3D0x81d2e60=
> > )
> > at om_document.c:87
> > #6 0x00607b6e in axiom_stax_builder_free
> (om_builder=3D0x81d5010, env=3D0x8=
> > 1d2e60)
> > at om_stax_builder.c:897
> > #7 0x0060e7ad in axiom_soap_builder_free
> (soap_builder=3D0x81d50d8,=20
> > env=3D0x81d2e60) at soap_builder.c:188
> > #8 0x0060dd25 in axiom_soap_envelope_free
> (soap_envelope=3D0x81d9338,=20
> > env=3D0x81d2e60) at soap_envelope.c:178
> > #9 0x0806b2be in axis2_msg_ctx_free
> (msg_ctx=3D0x81d45f8, env=3D0x81d2e60)
> > at msg_ctx.c:410
> > #10 0x00c60b43 in axis2_http_worker_process_request
> (http_worker=3D0x81d0d3=
> > 8,=20
> > env=3D0x81d2e60, svr_conn=3D0x81d2e80,
> simple_request=3D0x81d2f48)
> > at http_worker.c:1952
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread -1208378448 (LWP 18971)]
> > axiom_node_create (env=3D0x20202020) at om_node.c:75
> > 75 node =3D (axiom_node_t *)
> AXIS2_MALLOC(env->allocator, sizeof(axiom_node=
> > _t));
> >
> > #0 axiom_node_create (env=3D0x20202020) at
> om_node.c:75
> > #1 0x00f250fa in axiom_element_create
> (env=3D0x20202020, parent=3D0x0,=20
> > localname=3D0x4e9f8c "outparam0", ns=3D0x0,
> node=3D0xb7f98f30) at om_elemen=
> > t.c:78
> > #2 0x004e9a0f in build_res_text_response ()
> > from ..//services/ws_test_demo/libws_test_demo.so
> > #3 0x004e99ac in axis2_skel_ws_test_demo_test_demo ()
> > from ..//services/ws_test_demo/libws_test_demo.so
> > #4 0x20202020 in ?? ()
> > #5 0x20202020 in ?? ()
> > #6 0x20202020 in ?? ()
> > #7 0xb7f99000 in ?? ()
> > #8 0x004e9b62 in axis2_svc_skel_ws_test_demo_invoke ()
> > from ..//services/ws_test_demo/libws_test_demo.so
> >
> >
> > Pls let me know, if I am missing something ...
> >
> > Also, pls let me know if you need more info.
> > I need some help on an urgent basis.
> >
> > Rgds,
> > Ramesh
> >
> >
> >       Add more friends to your messenger and enjoy! Go
> to http://messenger.yahoo.com/invite/
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-c-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> axis-c-user-help@ws.apache.org
> >
> >
> >
> >   
> 
> 
> -- 
> S.Uthaiyashankar
> Software Architect
> WSO2 Inc. 
> http://wso2.com/ - "The Open Source SOA Company" 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail:
> axis-c-user-help@ws.apache.org


      Share files, take polls, and make new friends - all under one roof. Go to http://in.promos.yahoo.com/groups/


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


Re: Some quick Axis2C help required

Posted by Uthaiyashankar <sh...@wso2.com>.
Hi Ramesh,

See the comments.


> Sample xml request:
> -------------------
>
> <operation>
> <in1>1</in1>
> <in2>2</in2>
> </operation>
>
> My sample code :
> ----------------
>
> if (node) { --- This is the entire xml
> parent_node =3D axiom_node_get_first_element(node, env); --- Here, I though=
> I will get operation as the first element, but I get <in1>1</in1> ...
>   

You have to do "axiom_node_get_data_element" to get <operation> as the 
element. When you do axiom_node_get_first_element, it will return first 
child whose type is om element.


> If this is wrong pls point out the exact function that I ought to be using.
>
> {
> if (!parent_node)
> { // throw error;
> }
> request_node =3D axiom_node_get_first_child(parent_node, env);
> if (!request_node)
> { // throw error;
> }
> if (request_node && axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
> M_TEXT)
> { // Get value of TEXT --- Here we get value "1"
> }
> }
> sibling_node =3D axiom_node_get_next_sibling(parent_node, env); --- Here I =
> get <in2>2</in2>, which is a sibling to <in1>1</in1>
>
> if (!sibling_node) { // throw error ; }
> request_node =3D axiom_node_get_first_child(sibling_node, env);
> if (!request_node)
> { // throw error;
> }
> if (request_node && axiom_node_get_node_type(request_node, env) =3D=3D AXIO=
> M_TEXT)
> { // Get value of TEXT --- Here we get value "2"
> }=20
> }
>
>
> I am running into some issues
>   

 First error is caused by axiom_node_free_detached_subtree, which I 
could not find in the code you have sent. Can you send the correct code 
which causes these errors?

Regards,
Shankar

>
> Below is some error which I get :
> ---------------------------------
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1208951888 (LWP 19071)]
> axiom_node_free_detached_subtree (om_node=3D0x8927758, env=3D0x8920e60)
> at om_node.c:105
> 105 next_sibling =3D child_node->next_sibling;
>
> #0 axiom_node_free_detached_subtree (om_node=3D0x81d9758, env=3D0x81d2e60)
> at om_node.c:105
> #1 0x006005a2 in axiom_node_free_detached_subtree (om_node=3D0x81d96d0,=20
> env=3D0x81d2e60) at om_node.c:106
> #2 0x006005a2 in axiom_node_free_detached_subtree (om_node=3D0x81d9528,=20
> env=3D0x81d2e60) at om_node.c:106
> #3 0x006005a2 in axiom_node_free_detached_subtree (om_node=3D0x81d9478,=20
> env=3D0x81d2e60) at om_node.c:106
> #4 0x006005a2 in axiom_node_free_detached_subtree (om_node=3D0x81d9198,=20
> env=3D0x81d2e60) at om_node.c:106
> #5 0x0060026e in axiom_document_free (document=3D0x81d50b8, env=3D0x81d2e60=
> )
> at om_document.c:87
> #6 0x00607b6e in axiom_stax_builder_free (om_builder=3D0x81d5010, env=3D0x8=
> 1d2e60)
> at om_stax_builder.c:897
> #7 0x0060e7ad in axiom_soap_builder_free (soap_builder=3D0x81d50d8,=20
> env=3D0x81d2e60) at soap_builder.c:188
> #8 0x0060dd25 in axiom_soap_envelope_free (soap_envelope=3D0x81d9338,=20
> env=3D0x81d2e60) at soap_envelope.c:178
> #9 0x0806b2be in axis2_msg_ctx_free (msg_ctx=3D0x81d45f8, env=3D0x81d2e60)
> at msg_ctx.c:410
> #10 0x00c60b43 in axis2_http_worker_process_request (http_worker=3D0x81d0d3=
> 8,=20
> env=3D0x81d2e60, svr_conn=3D0x81d2e80, simple_request=3D0x81d2f48)
> at http_worker.c:1952
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1208378448 (LWP 18971)]
> axiom_node_create (env=3D0x20202020) at om_node.c:75
> 75 node =3D (axiom_node_t *) AXIS2_MALLOC(env->allocator, sizeof(axiom_node=
> _t));
>
> #0 axiom_node_create (env=3D0x20202020) at om_node.c:75
> #1 0x00f250fa in axiom_element_create (env=3D0x20202020, parent=3D0x0,=20
> localname=3D0x4e9f8c "outparam0", ns=3D0x0, node=3D0xb7f98f30) at om_elemen=
> t.c:78
> #2 0x004e9a0f in build_res_text_response ()
> from ..//services/ws_test_demo/libws_test_demo.so
> #3 0x004e99ac in axis2_skel_ws_test_demo_test_demo ()
> from ..//services/ws_test_demo/libws_test_demo.so
> #4 0x20202020 in ?? ()
> #5 0x20202020 in ?? ()
> #6 0x20202020 in ?? ()
> #7 0xb7f99000 in ?? ()
> #8 0x004e9b62 in axis2_svc_skel_ws_test_demo_invoke ()
> from ..//services/ws_test_demo/libws_test_demo.so
>
>
> Pls let me know, if I am missing something ...
>
> Also, pls let me know if you need more info.
> I need some help on an urgent basis.
>
> Rgds,
> Ramesh
>
>
>       Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>
>
>   


-- 
S.Uthaiyashankar
Software Architect
WSO2 Inc. 
http://wso2.com/ - "The Open Source SOA Company" 


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