Return-Path: X-Original-To: apmail-axis-c-user-archive@www.apache.org Delivered-To: apmail-axis-c-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 94294E106 for ; Tue, 26 Feb 2013 21:22:12 +0000 (UTC) Received: (qmail 85066 invoked by uid 500); 26 Feb 2013 21:22:12 -0000 Delivered-To: apmail-axis-c-user-archive@axis.apache.org Received: (qmail 85053 invoked by uid 500); 26 Feb 2013 21:22:12 -0000 Mailing-List: contact c-user-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache AXIS C User List" Delivered-To: mailing list c-user@axis.apache.org Received: (qmail 85043 invoked by uid 99); 26 Feb 2013 21:22:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2013 21:22:12 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jpavani07@gmail.com designates 209.85.223.174 as permitted sender) Received: from [209.85.223.174] (HELO mail-ie0-f174.google.com) (209.85.223.174) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2013 21:22:06 +0000 Received: by mail-ie0-f174.google.com with SMTP id k10so4991010iea.19 for ; Tue, 26 Feb 2013 13:21:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=ggRiLRXGdUu+IvOTNR2133z9zuOyeWmko9blT29D0hU=; b=zfkLJ34k8cqqkKao0KdmyVOGm1oxadkFo0YiGv7RVjdhdoGTliacVjoDojhGXyAXPT 8b1/t7md/1ktwmlHTO2aUxU5TlMzWp3PsWNfWDq10oqkKF/Vci+jiD8NkB9VaO13X80d EtmcYl9JhXEg9moJDld1xBgcJDPLnGBHlcBN9JGNzUx64ulTdKB+/QiSzKl5rxkYiGbr bs1HW9tttcYhJ2uXE+2/LmqNVVFUniHyH77ripAh1cNVkiU8IYZR2vgexWkbuJXJEYOk j5fxD8M76oWMbR1KRxV9ufZzM5AZLUiK5AhY4R2YaBJEfX4WaDSmG4NMtP6bYY6/m4uU vd2g== MIME-Version: 1.0 X-Received: by 10.50.13.208 with SMTP id j16mr6382194igc.73.1361913706353; Tue, 26 Feb 2013 13:21:46 -0800 (PST) Received: by 10.50.77.198 with HTTP; Tue, 26 Feb 2013 13:21:46 -0800 (PST) In-Reply-To: References: Date: Tue, 26 Feb 2013 13:21:46 -0800 Message-ID: Subject: Re: New Axis2c user - Axis2c API returning NULL From: Pavani J To: Apache AXIS C User List Content-Type: multipart/alternative; boundary=f46d0447f094aee63a04d6a73e89 X-Virus-Checked: Checked by ClamAV on apache.org --f46d0447f094aee63a04d6a73e89 Content-Type: text/plain; charset=ISO-8859-1 Hi, I went through samples/server/session. Do I need to 1. have/create mysql database table for session-table 2. build apache module with mod-dbd enabled for message context, msg_ctx to return Cookie information? Or it is there for sample code to work? Client is setting HTTP headers properly, I can see Cookie information on wireshark. Any help is appreciated. Thanks, Pavani On Tue, Feb 26, 2013 at 12:34 AM, Stadelmann Josef < josef.stadelmann@axa-winterthur.ch> wrote: > I have a question: **** > > Are the samples delivered with your axis2C kit running?**** > > There are all kind of samples, simple and more complex ones. **** > > If you work / debugging through this examples, you learn a lot.**** > > Once an example is running, enhance it with your code below: i.e.**** > > call to axis2_msg_ctx_get_property**** > > ** ** > > But make sure, that at the client side, the client has in fact feed a > property into the message context.**** > > If the client does not pass a property into the message context for > transport to the server, NULL at the **** > > server side is normal. Or what else would you expect from the server in > this case?**** > > ** ** > > Josef**** > > ** ** > > *Von:* Pavani J [mailto:jpavani07@gmail.com] > *Gesendet:* Montag, 25. Februar 2013 20:01 > *An:* c-user@axis.apache.org > *Betreff:* New Axis2c user - Axis2c API returning NULL**** > > ** ** > > Hi,**** > > ** ** > > I am a new user of Axis2c and I am stuck because of the following:**** > > ** ** > > I have WSDL generated C stubs and using axis2c-1.7.0 to deploy web service > based on them. I am on server side.**** > > ** ** > > Below is my code snippets that I tried to get HTTP header and it is > returning NULL. Actually I am trying to get Cookie information from header. > I could see the headers with Cookie information when I did a packet > capture using wireshark, where Axis2c API is returning NULL for the same.* > *** > > Please let me know if there is anything wrong with the following code.**** > > ** ** > > 1) First method**** > > axutil_property_t* property = NULL;**** > > axis2_char_t* prop_val = NULL;**** > > property = axis2_msg_ctx_get_property(msg_ctx, env,**** > > AXIS2_TRANSPORT_HEADERS); // <--- this is returning NULL**** > > if (property == NULL)**** > > {**** > > printf("property is NULL\n\n");**** > > }**** > > else**** > > {**** > > prop_val = (axis2_char_t*)axutil_property_get_value(property, env); > **** > > if (prop_val == NULL)**** > > {**** > > printf(" prop_val is NULL\n\n");**** > > }**** > > else**** > > {**** > > printf("prop_val: %s\n\n", prop_val);**** > > }**** > > }**** > > ** ** > > 2) Second Method**** > > ** ** > > axutil_hash_t* header = NULL;**** > > header = axis2_msg_ctx_get_transport_headers(msg_ctx, env); // <--- > This is returning NULL**** > > if (header)**** > > {**** > > axis2_http_header_t* test = NULL;**** > > test = (axis2_http_header_t*) axutil_hash_get(header,**** > > AXIS2_HTTP_HEADER_COOKIE, AXIS2_HASH_KEY_STRING);**** > > if (test)**** > > {**** > > axis2_char_t* val = NULL;**** > > val = axis2_http_header_get_value(test, env);**** > > if (val)**** > > {**** > > printf (" axis2_http_header_get_value, val: %s\n\n", val); > **** > > }**** > > else**** > > {**** > > printf("axis2_http_header_get_value returned NULL\n\n");** > ** > > }**** > > }**** > > else**** > > {**** > > printf("axutil_hash_get returned NULL\n\n");**** > > }**** > > }**** > > else**** > > {**** > > printf("axis2_msg_ctx_get_transport_headers returned NULL\n\n");** > ** > > }**** > > ** ** > > ** ** > > Any help is appreciated.**** > > ** ** > > Thanks,**** > > Pavani**** > > ** ** > > ** ** > --f46d0447f094aee63a04d6a73e89 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I went through samples/server/session.
Do = I need to
1.=A0=A0have/create mysql database table for session-ta= ble=A0
2. build apache module with mod-dbd enabled=A0
f= or message context, msg_ctx to return Cookie information?
Or it is there for sample code to work?

Clien= t is setting HTTP headers properly, I can see Cookie information on wiresha= rk.


Any help is appreciated.

Thanks,
Pavani


On Tue, Feb 26, 2013 at 12:34 AM, Stadelmann Josef <josef.stadelmann@axa-winterthur.ch> wrote:

= I have a question:

Are the samp= les delivered with your axis2C kit running?

There are all kind of samples, simp= le and more complex ones.

<= span lang=3D"EN-US" style=3D"font-size:10.0pt;font-family:"Arial"= ,"sans-serif";color:#1f497d">If you work / debugging through this= examples, you learn a lot.

Once an exam= ple is running, enhance it with your code below: i.e.<= /p>

call to axis= 2_msg_ctx_get_property

=A0

But make sur= e, that at the client side, the client has in fact feed a property into the= message context.

If the clien= t does not pass a property into the message context for transport to the se= rver, NULL at the

server side = is normal. Or what else would you expect from the server in this case?

=A0

Josef

=A0

Von: Pavani J [mailto:jpavani07@gmail.com]
Gesendet: Montag, 25. Februar 2013 20:01
An: c-user@axis.apache.orgBetreff: New Axis2c user - Axis2c API returning NULL=

= =A0

Hi,

=A0

I am a new u= ser of Axis2c and I am stuck because of the following:

=A0

I have WSDL = generated C stubs and using axis2c-1.7.0 to deploy web service based on the= m. I am on server side.

=A0

Below is my code snippets that I tried to get HTTP header and it i= s returning NULL. Actually I am trying to get Cookie information from heade= r. =A0I could see the headers with Cookie information when I did a packet c= apture using wireshark, where Axis2c API is returning NULL for the same.=

Please let m= e know if there is anything wrong with the following code.

=A0<= u>

1) First met= hod

=A0 =A0=A0axutil_property_t* property =3D NULL;

<= /div>

=A0 =A0 axis2_char_t* p= rop_val =3D NULL;

=A0 =A0 property =3D axis2_msg_ctx_get_property(msg= _ctx, env,

AXIS2_TRANSP= ORT_HEADERS); =A0// <--- this is returning NULL

<= div>

=A0 =A0 if (propert= y =3D=3D NULL)

=A0 =A0 {=

=A0 =A0 =A0 =A0 printf("property is NULL\n\n");<= /p>

=A0 =A0 }

=A0 =A0 else

=A0 =A0 {

=A0 =A0 =A0 =A0 prop_val =3D (axis2_char_t*)axutil_property_get_value(prope= rty, env);

=A0 =A0 =A0 =A0 if (prop_val =3D=3D NULL)

=

=A0 =A0 =A0 =A0 {

=A0 =A0 =A0 =A0 =A0 =A0 printf(" prop_val is N= ULL\n\n");

=A0 =A0 =A0 =A0 }

=A0 =A0 =A0 = =A0 else

=A0 =A0 =A0 =A0 {

=A0 =A0 =A0 =A0 =A0 =A0 printf("prop_val: %s\n\n", prop_val);<= /u>

=A0 =A0 =A0 =A0 }

=A0 =A0 }

=A0

2) Second Method

=A0

=A0 =A0 axutil_hash_t* header =3D NULL;

=A0 =A0 header =3D ax= is2_msg_ctx_get_transport_headers(msg_ctx, env); =A0 // <--- This is ret= urning NULL

=A0 =A0 if (= header)

=A0 =A0 {

=A0 =A0 =A0 =A0 axis2_http_header_t* test =3D NULL;

=

=A0 =A0 =A0 =A0 te= st =3D (axis2_http_header_t*) axutil_hash_get(header,

AXIS2_HTTP_HEADER_COOKIE, AXIS2_HASH_KEY_STRING);

=A0 =A0 =A0 =A0 if (= test)

=A0 =A0 =A0 =A0 {

=A0 =A0 =A0 = =A0 =A0 =A0 axis2_char_t* val =3D NULL;

=A0 =A0 =A0 =A0 =A0 =A0 val = =3D axis2_http_header_get_value(test, env);

=A0 =A0 =A0 = =A0 =A0 =A0 if (val)

=A0 =A0 =A0 =A0 =A0 =A0 {

=

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf (" axis2_http_header_get_value,= val: %s\n\n", val);

=A0 =A0 =A0 =A0 =A0 =A0 }

<= /div>

=A0 =A0 =A0 =A0 =A0 =A0 else

=A0 =A0 =A0 =A0 =A0 =A0 {

=A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 printf("axis2_http_header_get_value returned N= ULL\n\n");

=A0 =A0 =A0 = =A0 =A0 =A0 }

=A0 =A0 =A0 =A0 }

=A0 =A0 =A0 =A0 else

=A0 =A0 =A0 =A0 {

=A0 =A0 =A0 =A0 =A0 =A0 pr= intf("axutil_hash_get returned NULL\n\n");

=A0 =A0 =A0 = =A0 }

=A0 =A0 }

=A0 =A0 else

=A0 =A0 {

=A0 =A0 =A0 =A0 printf("axis2_msg_ctx= _get_transport_headers returned NULL\n\n");

=A0 =A0 }=

=A0

=A0

Any help is = appreciated.

=A0

Thanks,

Pavani

=A0

=A0


<= /div> --f46d0447f094aee63a04d6a73e89--