Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 93768 invoked from network); 7 Jul 2008 18:42:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jul 2008 18:42:01 -0000 Received: (qmail 56413 invoked by uid 500); 7 Jul 2008 18:42:01 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 56403 invoked by uid 500); 7 Jul 2008 18:42:01 -0000 Mailing-List: contact axis-c-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C User List" Reply-To: "Apache AXIS C User List" Delivered-To: mailing list axis-c-user@ws.apache.org Received: (qmail 56392 invoked by uid 99); 7 Jul 2008 18:42:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2008 11:42:01 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dimuthuc@gmail.com designates 209.85.142.185 as permitted sender) Received: from [209.85.142.185] (HELO ti-out-0910.google.com) (209.85.142.185) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2008 18:41:07 +0000 Received: by ti-out-0910.google.com with SMTP id y6so622134tia.18 for ; Mon, 07 Jul 2008 11:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=UdoVp7GCNBiuWVVzvmKXrw6EPJVqbQy8L48Psh5OLgs=; b=CwjUA0l3K5MFa5sFgDqldh8zlwbyCnvU4vg570UNaXBKheM9Kk+ghFBUhRBKZZB/Ad zUWioYAfO7xdlOnVORBAo2IVg3ssmjIAo/nBsxwnfFQHyTSyu8DceV1QWdm/c6Lj3Mpu 36NfA6iz/Au06RwTGV4gKfB+JHJNJt4St2agM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=R8g/TNCPSQzomJn2pTQ7MxIwaKVxpvIBNGbOl8xuxs3cR0VLQu8Zye2peqAEmKlTEc 9agzn5h9fvIq03r9mt1k0ihlyaHCfY65nfdITzrEFSMt4F8N+QxsHP/v5Eu5zop4u/Ir e6kug1pjKTtwby0Cb0q+gaIVhh9LTmR1/kX8E= Received: by 10.110.26.20 with SMTP id 20mr2797966tiz.20.1215456087256; Mon, 07 Jul 2008 11:41:27 -0700 (PDT) Received: by 10.110.20.9 with HTTP; Mon, 7 Jul 2008 11:41:27 -0700 (PDT) Message-ID: Date: Tue, 8 Jul 2008 00:11:27 +0530 From: "Dimuthu Gamage" To: "Apache AXIS C User List" Subject: Re: WSDL2C deserialisation problem In-Reply-To: <08CEB0908629C64AB48367CEF2DD01290120D355@smmtl102.axa.ca> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1786_25404042.1215456087234" References: <08CEB0908629C64AB48367CEF2DD01290120D355@smmtl102.axa.ca> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1786_25404042.1215456087234 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Carl, My guess is this has missed the statement current_node =3D first_node; but = it is just a guess. If you can send us the schema part which correspond to adb_CommercialActivityType we can find the error in the logic more easily and find exactly what current_node is. Thanks Dimuthu On Mon, Jul 7, 2008 at 9:39 PM, Lefrancois, Carl < Carl.Lefrancois@axa-canada.com> wrote: > Hello List, > > While deserialising my document, I have the following behaviour: > > current_node is initialised to NULL > An if statement checks current_node to make sure it is not null before > deserialising a sub-element. > The sub-element can never be created during deserialisation. > > This is the first ADB object that gives me this problem. I looked at > the other files and they have a line like this: > > current_node =3D first_node; > > Somewhere before the if statement that checks current_node for NULL. > However in the other files this line comes when deserialising another > type of sub-element. This may be a bug in WSDL2C logic. > > > > > Below is a piece of the deserialise function for this element and the > important lines have ####### in front > > Because current node stays null, no qname is set on the line marked > @@@@@@@. > > Then the if statement marked &&&&&&& does not enter and finally the > sub-element can not get deserialised on the line marked %%%%%%%%%. > > This code was generated with the latest snapshot downloaded just before > sending this mail > > Does anyone have an idea how to set the current_node properly for this > element to deserialise? > > > > > > axis2_status_t AXIS2_CALL > adb_CommercialActivityType_deserialize( > adb_CommercialActivityType_t* _CommercialActivityType, > const axutil_env_t *env, > axiom_node_t **dp_parent, > axis2_bool_t *dp_is_early_node_valid, > axis2_bool_t dont_care_minoccurs) > { > axiom_node_t *parent =3D *dp_parent; > > axis2_status_t status =3D AXIS2_SUCCESS; > > axiom_attribute_t *parent_attri =3D NULL; > axiom_element_t *parent_element =3D NULL; > axis2_char_t *attrib_text =3D NULL; > > axutil_hash_t *attribute_hash =3D NULL; > > > void *element =3D NULL; > > axis2_char_t* text_value =3D NULL; > axutil_qname_t *qname =3D NULL; > > int i =3D 0; > axutil_array_list_t *arr_list =3D NULL; > > int sequence_broken =3D 0; > axiom_node_t *tmp_node =3D NULL; > > axutil_qname_t *element_qname =3D NULL; > > axiom_node_t *first_node =3D NULL; > axis2_bool_t is_early_node_valid =3D AXIS2_TRUE; > ####### axiom_node_t *current_node =3D NULL; > axiom_element_t *current_element =3D NULL; > > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > AXIS2_PARAM_CHECK(env->error, _CommercialActivityType, > AXIS2_FAILURE); > > > > while(parent && axiom_node_get_node_type(parent, env) !=3D > AXIOM_ELEMENT) > { > parent =3D axiom_node_get_next_sibling(parent, env); > } > if (NULL =3D=3D parent) > { > /* This should be checked before everything */ > AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, > "Failed in building adb object for > CommercialActivityType : " > "NULL elemenet can not be passed to > deserialize"); > return AXIS2_FAILURE; > } > > > first_node =3D axiom_node_get_first_child(parent, > env); > > > parent_element =3D (axiom_element_t > *)axiom_node_get_data_element(parent, env); > attribute_hash =3D > axiom_element_get_all_attributes(parent_element, env); > > > > parent_attri =3D NULL; > attrib_text =3D NULL; > if(attribute_hash) > { > axutil_hash_index_t *hi; > void *val; > const void *key; > > for (hi =3D axutil_hash_first(attribute_hash, env); > hi; hi =3D axutil_hash_next(env, hi)) > { > axutil_hash_this(hi, &key, NULL, &val); > > > if(strstr((axis2_char_t*)key, > "ObjectIdentifier|http://www.axa.ca/add/types/data-types")) > > { > parent_attri =3D > (axiom_attribute_t*)val; > break; > } > } > } > > if(parent_attri) > { > attrib_text =3D > axiom_attribute_get_value(parent_attri, env); > } > else > { > /* this is hoping that attribute is stored in > "ObjectIdentifier", this happnes when name is in default namespace */ > attrib_text =3D > axiom_element_get_attribute_value_by_name(parent_element, env, > "ObjectIdentifier"); > } > > if(attrib_text !=3D NULL) > { > > > element =3D > (void*)adb_ObjectIDFormat_create(env); > > adb_ObjectIDFormat_deserialize_from_string((adb_ObjectIDFormat_t*)elemen > t, env, attrib_text, parent); > > adb_CommercialActivityType_set_ObjectIdentifier(_CommercialActivityType, > env, > (adb_ObjectIDFormat_t*)element); > > } > > if(element_qname) > { > axutil_qname_free(element_qname, env); > element_qname =3D NULL; > } > > > > /* > * building ActivityNumber element > */ > > > > /* > * because elements are ordered this > works fine > */ > > > ####### if(current_node !=3D NULL && > is_early_node_valid) > { > current_node =3D > axiom_node_get_next_sibling(current_node, env); > > > while(current_node && > axiom_node_get_node_type(current_node, env) !=3D AXIOM_ELEMENT) > { > current_node =3D > axiom_node_get_next_sibling(current_node, env); > } > if(current_node !=3D NULL) > { > current_element =3D > (axiom_element_t *)axiom_node_get_data_element(current_node, env); > @@@@@@@ qname =3D > axiom_element_get_qname(current_element, env, current_node); > } > > } > is_early_node_valid =3D AXIS2_FALSE; > > element_qname =3D > axutil_qname_create(env, "ActivityNumber", NULL, NULL); > > > &&&&&&& if > (adb_CommercialActivityNumberFormat_is_particle() || > (current_node && current_element && > (axutil_qname_equals(element_qname, env, qname) || > !axutil_strcmp("ActivityNumber", > axiom_element_get_localname(current_element, env))))) > { > if( current_node && current_element && > (axutil_qname_equals(element_qname, env, qname) || > !axutil_strcmp("ActivityNumber", > axiom_element_get_localname(current_element, env)))) > { > is_early_node_valid =3D AXIS2_TRUE; > } > > > element =3D > (void*)adb_CommercialActivityNumberFormat_create(env); > > %%%%%%%%% status =3D > adb_CommercialActivityNumberFormat_deserialize((adb_CommercialActivityNu > mberFormat_t*)element, > > env, ¤t_node, &is_early_node_valid, AXIS2_FALSE); > if(AXIS2_FAILURE =3D=3D status) > { > AXIS2_LOG_ERROR(env->log, > AXIS2_LOG_SI, "failed in building adb object for element > ActivityNumber"); > } > else > { > status =3D > adb_CommercialActivityType_set_ActivityNumber(_CommercialActivityType, > env, > > (adb_CommercialActivityNumberFormat_t*)element); > } > > if(AXIS2_FAILURE =3D=3D status) > { > AXIS2_LOG_ERROR(env->log, > AXIS2_LOG_SI, "failed in setting the value for ActivityNumber "); > if(element_qname) > { > > axutil_qname_free(element_qname, env); > } > return AXIS2_FAILURE; > } > } > > > > > > > > Carl Lefran=E7ois > Analyst / Programmeur > consultant Larochelle Groupe Conseil > pour AXA Canada Tech > > T=E9l. : 514-282-6817, poste 4548 > Couriel : carl.lefrancois@axa-canada.com > _____ > > "Ce message est confidentiel, =E0 l'usage exclusif du destinataire > ci-dessus et son contenu ne repr=E9sente en aucun cas un engagement de la > part de AXA, sauf en cas de stipulation expresse et par =E9crit de la par= t > de AXA. Toute publication, utilisation ou diffusion, m=EAme partielle, > doit =EAtre autoris=E9e pr=E9alablement. Si vous n'=EAtes pas destinatair= e de ce > message, merci d'en avertir imm=E9diatement l'exp=E9diteur." > > "This e-mail message is confidential, for the exclusive use of the > addressee and its contents shall not constitute a commitment by AXA, > except as otherwise specifically provided in writing by AXA. Any > unauthorized disclosure, use or dissemination, either whole or partial, > is prohibited. If you are not the intended recipient of the message, > please notify the sender immediately." > > --------------------------------------------------------------------- > To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org > For additional commands, e-mail: axis-c-user-help@ws.apache.org > > ------=_Part_1786_25404042.1215456087234 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Carl,
My guess is this has missed the statement current_node =3D firs= t_node; but it is just a guess. If you can send us the schema part which co= rrespond to adb_CommercialActivityType we can find the error in the logic m= ore easily and find exactly what current_node is.

Thanks
Dimuthu

On Mon, Jul 7, 2008= at 9:39 PM, Lefrancois, Carl <Carl.Lefrancois@axa-canada.com> wrote:
Hello List,

While deserialising my document, I have the following behaviour:

current_node is initialised to NULL
An if statement checks current_node to make sure it is not null before
deserialising a sub-element.
The sub-element can never be created during deserialisation.

This is the first ADB object that gives me this problem.  I looked at<= br> the other files and they have a line like this:

current_node =3D first_node;

Somewhere before the if statement that checks current_node for NULL.
However in the other files this line comes when deserialising another
type of sub-element.  This may be a bug in WSDL2C logic.




Below is a piece of the deserialise function for this element and the
important lines have ####### in front

Because current node stays null, no qname is set on the line marked
@@@@@@@.

Then the if statement marked &&&&&&& does not e= nter and finally the
sub-element can not get deserialised on the line marked %%%%%%%%%.

This code was generated with the latest snapshot downloaded just before
sending this mail

Does anyone have an idea how to set the current_node properly for this
element to deserialise?





       axis2_status_t AXIS2_CALL
       adb_CommercialActivityType_deserialize(
               adb_CommercialActiv= ityType_t* _CommercialActivityType,
               const axutil_env_t = *env,
               axiom_node_t **dp_p= arent,
               axis2_bool_t *dp_is= _early_node_valid,
               axis2_bool_t dont_c= are_minoccurs)
       {
         axiom_node_t *parent =3D *dp_parent;

         axis2_status_t status =3D AXIS2_SUCCESS;=

             axiom_attribute_t *parent_= attri =3D NULL;
             axiom_element_t *parent_el= ement =3D NULL;
             axis2_char_t *attrib_text = =3D NULL;

             axutil_hash_t *attribute_h= ash =3D NULL;


             void *element =3D NULL;
            axis2_char_t* text_value =3D NUL= L;
            axutil_qname_t *qname =3D NULL;<= br>
              int i =3D 0;
              axutil_array_list_t *arr_= list =3D NULL;

              int sequence_broken =3D 0= ;
              axiom_node_t *tmp_node = =3D NULL;

           axutil_qname_t *element_qname =3D= NULL;

              axiom_node_t *first_node = =3D NULL;
              axis2_bool_t is_early_nod= e_valid =3D AXIS2_TRUE;
#######        axiom_node_t *current_node =3D NULL;
              axiom_element_t *current_= element =3D NULL;

           AXIS2_ENV_CHECK(env, AXIS2_FAILUR= E);
           AXIS2_PARAM_CHECK(env->error, = _CommercialActivityType,
AXIS2_FAILURE);



             while(parent && ax= iom_node_get_node_type(parent, env) !=3D
AXIOM_ELEMENT)
             {
                 parent =3D a= xiom_node_get_next_sibling(parent, env);
             }
             if (NULL =3D=3D parent)              {
               /* This should be c= hecked before everything */
               AXIS2_LOG_ERROR(env= ->log, AXIS2_LOG_SI,
                    &nbs= p;      "Failed in building adb object for
CommercialActivityType : "
                    &nbs= p;      "NULL elemenet can not be passed to
deserialize");
               return AXIS2_FAILUR= E;
             }


                    &nbs= p;first_node =3D axiom_node_get_first_child(parent,
env);


                parent_element =3D= (axiom_element_t
*)axiom_node_get_data_element(parent, env);
                attribute_hash =3D=
axiom_element_get_all_attributes(parent_element, env);



                 parent_attri= =3D NULL;
                 attrib_text = =3D NULL;
                 if(attribute= _hash)
                 {
                    &nbs= p; axutil_hash_index_t *hi;
                    &nbs= p; void *val;
                    &nbs= p; const void *key;

                    &nbs= p; for (hi =3D axutil_hash_first(attribute_hash, env);
hi; hi =3D axutil_hash_next(env, hi))
                    &nbs= p; {
                    &nbs= p;     axutil_hash_this(hi, &key, NULL, &val);


                    &nbs= p;         if(strstr((axis2_char_t*)key,
"ObjectIdentifier|http://www.axa.ca/add/types/data-types"))

                    &nbs= p;         {
                    &nbs= p;             parent_attri =3D
(axiom_attribute_t*)val;
                    &nbs= p;             break;
                    &nbs= p;         }
                    &nbs= p; }
                 }

                 if(parent_at= tri)
                 {
                   attri= b_text =3D
axiom_attribute_get_value(parent_attri, env);
                 }
                 else
                 {
                   /* th= is is hoping that attribute is stored in
"ObjectIdentifier", this happnes when name is in default namespac= e */
                   attri= b_text =3D
axiom_element_get_attribute_value_by_name(parent_element, env,
"ObjectIdentifier");
                 }

                 if(attrib_te= xt !=3D NULL)
                 {


                    &nbs= p;      element =3D
(void*)adb_ObjectIDFormat_create(env);

adb_ObjectIDFormat_deserialize_from_string((adb_ObjectIDFormat_t*)elemen t, env, attrib_text, parent);

adb_CommercialActivityType_set_ObjectIdentifier(_CommercialActivityType,                     &nbs= p;                     &n= bsp;              env,
(adb_ObjectIDFormat_t*)element);

                   }

                 if(element_q= name)
                 {
                    axut= il_qname_free(element_qname, env);
                    elem= ent_qname =3D NULL;
                 }



                    /*                     &nbs= p;* building ActivityNumber element
                    &nbs= p;*/



                    &nbs= p;              /*
                    &nbs= p;               * because elements are = ordered this
works fine
                    &nbs= p;               */


#######                   &nbs= p;        if(current_node !=3D NULL &&
is_early_node_valid)
                    &nbs= p;             {
                    &nbs= p;                 current_node =3D=
axiom_node_get_next_sibling(current_node, env);


                    &nbs= p;                  while(curr= ent_node &&
axiom_node_get_node_type(current_node, env) !=3D AXIOM_ELEMENT)
                    &nbs= p;                  {
                    &nbs= p;                     &n= bsp;current_node =3D
axiom_node_get_next_sibling(current_node, env);
                    &nbs= p;                  }
                    &nbs= p;                  if(current= _node !=3D NULL)
                    &nbs= p;                  {
                    &nbs= p;                     &n= bsp;current_element =3D
(axiom_element_t *)axiom_node_get_data_element(current_node, env);
@@@@@@@                   &nbs= p;                 qname =3D
axiom_element_get_qname(current_element, env, current_node);
                    &nbs= p;                  }

                    &nbs= p;             }
                    &nbs= p;             is_early_node_valid =3D AXIS2_= FALSE;

                    &nbs= p;           element_qname =3D
axutil_qname_create(env, "ActivityNumber", NULL, NULL);


&&&&&&&           &nbs= p;        if
(adb_CommercialActivityNumberFormat_is_particle() ||
                    &nbs= p;          (current_node   && curren= t_element &&
(axutil_qname_equals(element_qname, env, qname) ||
!axutil_strcmp("ActivityNumber",
axiom_element_get_localname(current_element, env)))))
                    &nbs= p;     {
                    &nbs= p;        if( current_node   && current_el= ement &&
(axutil_qname_equals(element_qname, env, qname) ||
!axutil_strcmp("ActivityNumber",
axiom_element_get_localname(current_element, env))))
                    &nbs= p;        {
                    &nbs= p;          is_early_node_valid =3D AXIS2_TRUE;                     &nbs= p;        }


                    &nbs= p;                element =3D
(void*)adb_CommercialActivityNumberFormat_create(env);

%%%%%%%%%                   &n= bsp;         status =3D
adb_CommercialActivityNumberFormat_deserialize((adb_CommercialActivityNu mberFormat_t*)element,

env, &current_node, &is_early_node_valid, AXIS2_FALSE);
                    &nbs= p;                if(AXIS2_FAILURE = =3D=3D status)
                    &nbs= p;                {
                    &nbs= p;                    AXI= S2_LOG_ERROR(env->log,
AXIS2_LOG_SI, "failed in building adb object for element
ActivityNumber");
                    &nbs= p;                }
                    &nbs= p;                else
                    &nbs= p;                {
                    &nbs= p;                    sta= tus =3D
adb_CommercialActivityType_set_ActivityNumber(_CommercialActivityType,
env,

(adb_CommercialActivityNumberFormat_t*)element);
                    &nbs= p;                }

                    &nbs= p;           if(AXIS2_FAILURE =3D=3D  status)=
                    &nbs= p;           {
                    &nbs= p;               AXIS2_LOG_ERROR(env->= ;log,
AXIS2_LOG_SI, "failed in setting the value for ActivityNumber ");=
                    &nbs= p;               if(element_qname)
                    &nbs= p;               {

axutil_qname_free(element_qname, env);
                    &nbs= p;               }
                    &nbs= p;               return AXIS2_FAILURE;                     &nbs= p;           }
                    &nbs= p;        }







Carl Lefran=E7ois
Analyst / Programmeur
consultant Larochelle Groupe Conseil
pour AXA Canada Tech

T=E9l. :      514-282-6817, poste 4548
Couriel : carl.lefrancois= @axa-canada.com
 _____

"Ce message est confidentiel, =E0 l'usage exclusif du destinataire=
ci-dessus et son contenu ne repr=E9sente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par =E9crit de la part<= br> de AXA. Toute publication, utilisation ou diffusion, m=EAme partielle,
doit =EAtre autoris=E9e pr=E9alablement. Si vous n'=EAtes pas destinata= ire de ce
message, merci d'en avertir imm=E9diatement l'exp=E9diteur."
"This e-mail message is confidential, for the exclusive use of the
addressee and its contents shall not constitute a commitment by AXA,
except as otherwise specifically provided in writing by AXA. Any
unauthorized disclosure, use or dissemination, either whole or partial,
is prohibited. If you are not the intended recipient of the message,
please notify the sender immediately."

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


------=_Part_1786_25404042.1215456087234--