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 Rico M <ri...@gmail.com> on 2010/08/05 17:36:44 UTC

Retriving value from Soap Header

Hi nandika,

As i mentioned below :
 How is the envelope of a response payload found?

I did not see any relevant functions in axiom_node.h , which is the
structure received after calling axis2_svc_client_send_receive

Is there a document which explains internal arch of Axis2C ? I am
still trying to come to grips with it. What are nodes/elements..?



You can obtain the soap header and soap header block from the soap envelope.
In axiom, every soap construct wraps an axiom node and  you can get the
axiom node corresponding to each of the soap header blocks using the
...get_base_node methods.

Regards
Nandika

On Tue, Jul 27, 2010 at 1:59 PM, Rico M <ri...@gmail.com> wrote:

> Anyone ? :|
>
>
> On Wed, Jul 21, 2010 at 11:39 AM, Rico M <ri...@gmail.com> wrote:
>
>> Assuming my message is as follows:
>>
>>
>> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
>> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="
>> http://www.w3.org/2001/XMLSchema">
>>
>> <soap:Header>
>>
>> <MyHeader xmlns="http://me.org/1.1/Header/">
>>
>> <TransactionId>100</TransactionId>
>>
>> </MyHeader>
>>
>> <soap:Body>
>>
>> <greet>Hello Server!</greet>
>>
>> </soap:Body></soap:Envelope>
>>
>>
>> How can one retirve transaction ID value.?
>>
>> I did read there was a work around for this , but i have not come across
>> it.
>>
>> I can see the following API's playing a role.
>>
>> -    AXIS2_EXTERN struct axiom_soap_header *AXIS2_CALL
>> axiom_soap_envelope_get_header( axiom_soap_envelope_t * envelope, const
>> axutil_env_t * env);
>>
>> -     AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL
>> axiom_soap_header_examine_all_header_blocks(axiom_soap_header_t * header,
>> const axutil_env_t * env);
>>
>> How is the envelope of a response payload found?
>>
>>
>> Offtopic: I seem to be running into trivial yet time consuming issues with
>> doing simpler things. I wanted to know if i can use my own API' ( or
>> something like libxml2 ) to create/read soap messsages and the underlying
>> framework of axis2/c to send/recieve them? Is there an example of the same
>> available ?
>>
>>
>> Cheers!
>>
>>
>>
>>
>>
>>
>

You can obtain the soap header and soap header block from the soap envelope.
In axiom, every soap construct wraps an axiom node and  you can get the
axiom node corresponding to each of the soap header blocks using the
...get_base_node methods.

Regards
Nandika

On Tue, Jul 27, 2010 at 1:59 PM, Rico M <ri...@gmail.com> wrote:

> Anyone ? :|
>
>
> On Wed, Jul 21, 2010 at 11:39 AM, Rico M <ri...@gmail.com> wrote:
>
>> Assuming my message is as follows:
>>
>>
>> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
>> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="
>> http://www.w3.org/2001/XMLSchema">
>>
>> <soap:Header>
>>
>> <MyHeader xmlns="http://me.org/1.1/Header/">
>>
>> <TransactionId>100</TransactionId>
>>
>> </MyHeader>
>>
>> <soap:Body>
>>
>> <greet>Hello Server!</greet>
>>
>> </soap:Body></soap:Envelope>
>>
>>
>> How can one retirve transaction ID value.?
>>
>> I did read there was a work around for this , but i have not come across
>> it.
>>
>> I can see the following API's playing a role.
>>
>> -    AXIS2_EXTERN struct axiom_soap_header *AXIS2_CALL
>> axiom_soap_envelope_get_header( axiom_soap_envelope_t * envelope, const
>> axutil_env_t * env);
>>
>> -     AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL
>> axiom_soap_header_examine_all_header_blocks(axiom_soap_header_t * header,
>> const axutil_env_t * env);
>>
*>> How is the envelope of a response payload found?*
>>
>>
>> Offtopic: I seem to be running into trivial yet time consuming issues with
>> doing simpler things. I wanted to know if i can use my own API' ( or
>> something like libxml2 ) to create/read soap messsages and the underlying
>> framework of axis2/c to send/recieve them? Is there an example of the same
>> available ?
>>
>>
>> Cheers!
>>
>>
>>
>>
>>
>>
>

Re: Retriving value from Soap Header

Posted by Samisa Abeysinghe <sa...@wso2.com>.
Since the element finding code is application specific, you have to do it on
your own in business logic.

However, if you have a WSDL, the generated code can do this for you with ADB
data binding

On Thu, Aug 5, 2010 at 9:06 PM, Rico M <ri...@gmail.com> wrote:

> Hi nandika,
>
> As i mentioned below :
>  How is the envelope of a response payload found?
>
> I did not see any relevant functions in axiom_node.h , which is the structure received after calling axis2_svc_client_send_receive
>
> Is there a document which explains internal arch of Axis2C ? I am still trying to come to grips with it. What are nodes/elements..?
>
>
>
> You can obtain the soap header and soap header block from the soap envelope.
>
> In axiom, every soap construct wraps an axiom node and  you can get the
> axiom node corresponding to each of the soap header blocks using the
> ...get_base_node methods.
>
> Regards
> Nandika
>
> On Tue, Jul 27, 2010 at 1:59 PM, Rico M <ri...@gmail.com> wrote:
>
> > Anyone ? :|
> >
> >
> > On Wed, Jul 21, 2010 at 11:39 AM, Rico M <ri...@gmail.com> wrote:
> >
> >> Assuming my message is as follows:
> >>
>
> >>
> >> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
> >> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="
>
> >> http://www.w3.org/2001/XMLSchema">
> >>
> >> <soap:Header>
> >>
> >> <MyHeader xmlns="http://me.org/1.1/Header/">
>
> >>
> >> <TransactionId>100</TransactionId>
> >>
> >> </MyHeader>
> >>
> >> <soap:Body>
> >>
> >> <greet>Hello Server!</greet>
> >>
>
> >> </soap:Body></soap:Envelope>
> >>
> >>
> >> How can one retirve transaction ID value.?
> >>
> >> I did read there was a work around for this , but i have not come across
>
> >> it.
> >>
> >> I can see the following API's playing a role.
> >>
> >> -    AXIS2_EXTERN struct axiom_soap_header *AXIS2_CALL
> >> axiom_soap_envelope_get_header( axiom_soap_envelope_t * envelope, const
>
> >> axutil_env_t * env);
> >>
> >> -     AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL
> >> axiom_soap_header_examine_all_header_blocks(axiom_soap_header_t * header,
> >> const axutil_env_t * env);
>
> >>
> >> How is the envelope of a response payload found?
> >>
> >>
> >> Offtopic: I seem to be running into trivial yet time consuming issues with
> >> doing simpler things. I wanted to know if i can use my own API' ( or
>
> >> something like libxml2 ) to create/read soap messsages and the underlying
> >> framework of axis2/c to send/recieve them? Is there an example of the same
> >> available ?
> >>
> >>
>
> >> Cheers!
> >>
> >>
> >>
> >>
> >>
> >>
> >
>
> You can obtain the soap header and soap header block from the soap envelope.
> In axiom, every soap construct wraps an axiom node and  you can get the
>
> axiom node corresponding to each of the soap header blocks using the
> ...get_base_node methods.
>
> Regards
> Nandika
>
> On Tue, Jul 27, 2010 at 1:59 PM, Rico M <ri...@gmail.com> wrote:
>
> > Anyone ? :|
> >
> >
> > On Wed, Jul 21, 2010 at 11:39 AM, Rico M <ri...@gmail.com> wrote:
> >
> >> Assuming my message is as follows:
> >>
>
> >>
> >> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
> >> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="
>
> >> http://www.w3.org/2001/XMLSchema">
> >>
> >> <soap:Header>
> >>
> >> <MyHeader xmlns="http://me.org/1.1/Header/">
>
> >>
> >> <TransactionId>100</TransactionId>
> >>
> >> </MyHeader>
> >>
> >> <soap:Body>
> >>
> >> <greet>Hello Server!</greet>
> >>
>
> >> </soap:Body></soap:Envelope>
> >>
> >>
> >> How can one retirve transaction ID value.?
> >>
> >> I did read there was a work around for this , but i have not come across
>
> >> it.
> >>
> >> I can see the following API's playing a role.
> >>
> >> -    AXIS2_EXTERN struct axiom_soap_header *AXIS2_CALL
> >> axiom_soap_envelope_get_header( axiom_soap_envelope_t * envelope, const
>
> >> axutil_env_t * env);
> >>
> >> -     AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL
> >> axiom_soap_header_examine_all_header_blocks(axiom_soap_header_t * header,
> >> const axutil_env_t * env);
>
> >>
> *>> How is the envelope of a response payload found?*
> >>
> >>
> >> Offtopic: I seem to be running into trivial yet time consuming issues with
> >> doing simpler things. I wanted to know if i can use my own API' ( or
>
> >> something like libxml2 ) to create/read soap messsages and the underlying
> >> framework of axis2/c to send/recieve them? Is there an example of the same
> >> available ?
> >>
> >>
>
> >> Cheers!
> >>
> >>
> >>
> >>
> >>
> >>
> >
>
>  Samisa ...

http://samisa-abeysinghe.blogspot.com/

Re: Sending a NULL value in xml response to notify the usage of xsi:nil attribute

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

I used these functions to get it working.

Ramesh.

--- On Tue, 28/9/10, Rico M <ri...@gmail.com> wrote:

From: Rico M <ri...@gmail.com>
Subject: Re: Sending a NULL value in xml response to notify the usage of xsi:nil attribute
To: "Apache AXIS C User List" <c-...@axis.apache.org>
Date: Tuesday, 28 September, 2010, 9:29 PM

You should be  able to find your way around with these two functions.

    AXIS2_EXTERN axiom_attribute_t *AXIS2_CALL
    axiom_attribute_create(
        const axutil_env_t * env,
        const axis2_char_t * localname,

        const axis2_char_t * value,
        axiom_namespace_t * ns);

axiom_attribute.h

and 

    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axiom_element_add_attribute(
        axiom_element_t * om_element,

        const axutil_env_t * env,
        axiom_attribute_t * attribute,
        axiom_node_t * node);

axiom_element.h

Cheers!


On Thu, Sep 23, 2010 at 3:11 PM, ramesh Gopal <fa...@yahoo.com> wrote:



Hello,

I am in urgent need of some help.
I have created my wsdl file which uses the xsi:nil attribute.

Now I am stuck where-in I do not know about any Axis2C apis which will use this attribute in its response.


When we create a simple text, we use axis_create_element and set_text methods.
But I dont see any methods which will enable me to send the xsi:attribute while creating the element.

I want to generate a code which will acehive something like :

<par xsi:nil="true"/>

I need something on this really bad.

Rgds,
Ramesh







Re: Sending a NULL value in xml response to notify the usage of xsi:nil attribute

Posted by Rico M <ri...@gmail.com>.
You should be  able to find your way around with these two functions.

    AXIS2_EXTERN axiom_attribute_t *AXIS2_CALL
    axiom_attribute_create(
        const axutil_env_t * env,
        const axis2_char_t * localname,
        const axis2_char_t * value,
        axiom_namespace_t * ns);

axiom_attribute.h

and

    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axiom_element_add_attribute(
        axiom_element_t * om_element,
        const axutil_env_t * env,
        axiom_attribute_t * attribute,
        axiom_node_t * node);

axiom_element.h

Cheers!


On Thu, Sep 23, 2010 at 3:11 PM, ramesh Gopal <fa...@yahoo.com>wrote:

>
> Hello,
>
> I am in urgent need of some help.
> I have created my wsdl file which uses the xsi:nil attribute.
>
> Now I am stuck where-in I do not know about any Axis2C apis which will use
> this attribute in its response.
>
> When we create a simple text, we use axis_create_element and set_text
> methods.
> But I dont see any methods which will enable me to send the xsi:attribute
> while creating the element.
>
> I want to generate a code which will acehive something like :
> <par xsi:nil="true"/>
>
> I need something on this really bad.
>
> Rgds,
> Ramesh
>
>
>

Sending a NULL value in xml response to notify the usage of xsi:nil attribute

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

I am in urgent need of some help.
I have created my wsdl file which uses the xsi:nil attribute.

Now I am stuck where-in I do not know about any Axis2C apis which will use this attribute in its response.

When we create a simple text, we use axis_create_element and set_text methods.
But I dont see any methods which will enable me to send the xsi:attribute while creating the element.

I want to generate a code which will acehive something like :
<par xsi:nil="true"/>

I need something on this really bad.

Rgds,
Ramesh




Re: Retrieve xsi:nil attribute from node

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

Can we use axiom_create_element to send a xsi:nil attribute.
My intention is to have something like
<parameter name xsi:nil"=true"> in the request.

Rgds,
Ramesh



Re: Retrieve xsi:nil attribute from node

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

I am using a few tools to send some request.

I use eclipse tool to send xml request and see that, I am able to communicate a simple request with a tag xsi:nil

But the same from a SOAPUI tool, doesnt list the request tag.

My guess is all tools should behave the same.

Is there something I am missing here.

Ramesh.


--- On Fri, 3/9/10, ramesh Gopal <fa...@yahoo.com> wrote:

From: ramesh Gopal <fa...@yahoo.com>
Subject: Retrieve xsi:nil attribute from node
To: "Apache AXIS C User List" <c-...@axis.apache.org>
Date: Friday, 3 September, 2010, 5:35 PM


Hello,

Do we have any axis2c apis which will tell us whether node has xsi:nil attribute.
(Obviously this means that the node can have a NULL value.)

Subsequently, if the request has still this attribute set, it can still pass some values.

How do we check for all these conditions ?

Rgds,
Ramesh




Retrieve xsi:nil attribute from node

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

Do we have any axis2c apis which will tell us whether node has xsi:nil attribute.
(Obviously this means that the node can have a NULL value.)

Subsequently, if the request has still this attribute set, it can still pass some values.

How do we check for all these conditions ?

Rgds,
Ramesh