Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 67134 invoked from network); 17 Jul 2008 15:53:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jul 2008 15:53:51 -0000 Received: (qmail 84013 invoked by uid 500); 17 Jul 2008 15:53:48 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 83996 invoked by uid 500); 17 Jul 2008 15:53:48 -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 83846 invoked by uid 99); 17 Jul 2008 15:53:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jul 2008 08:53:48 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Carl.Lefrancois@axa-canada.com designates 206.47.141.39 as permitted sender) Received: from [206.47.141.39] (HELO ssmtl104.axa-canada.com) (206.47.141.39) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jul 2008 15:52:53 +0000 X-AuditID: 0a0102fb-000015dc0000068c-13-487f6ae257f0 Received: from SSMTL101.axa-canada.com ([10.1.2.254]) by ssmtl104.axa-canada.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 17 Jul 2008 11:53:06 -0400 Received: from ([142.216.40.176]) by SSMTL101.axa-canada.com; Thu, 17 Jul 2008 11:53:13 -0400 (EDT) content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 Subject: RE : RE : RE : RE : WSDL2C deserialisation problem Date: Thu, 17 Jul 2008 11:52:02 -0400 Message-ID: <08CEB0908629C64AB48367CEF2DD01290120D3A1@smmtl102.axa.ca> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: RE : RE : RE : WSDL2C deserialisation problem Thread-Index: AcjoG/Nlqf9fz8VfSbuNhirEIFOQagAB7blw From: "Lefrancois, Carl" To: "Apache AXIS C User List" X-Brightmail-Tracker: AAAAAA== X-Virus-Checked: Checked by ClamAV on apache.org Hi Dimuthu, I did try adding those lines to the deserialize function but had the = same result. As part of the debugging process I downloaded the nightly = snapshot dated 2008/07/07. It is possible there has been a fix since = then. I'm not convinced this is a real bug, but I still can't explain what = mistake I made to get this behaviour. If no one else is having this = problem then it must be me :) Anyway it works with this patch. The WSDL on the server stays the same = and my local WSDL used to generate the stubs can have this modification. = Thanks for your suggestions. Carl -----Message d'origine----- De : Dimuthu Gamage [mailto:dimuthuc@gmail.com]=20 Envoy=E9 : jeudi, juillet 17, 2008 10:46 =C0 : Apache AXIS C User List Objet : Re: RE : RE : RE : WSDL2C deserialisation problem Hi Carl, Again I tried without any elements in the parent type, i.e. only with an = attribute as in your case. But it was generating correct code and give = the correct result at running. May be some modification in the latest = svn may have correct the problem. (i believe some correction done after = axis2/java 1.4 release). So from your note I saw it works when=20 current_node =3D first_node; is_early_node_valid =3D AXIS2_FALSE; is at the start. I think you can just add these lines in the deserialize = funciton without changing the wsdl. (you may able to debug the logic = removing the code that handle your fake element from the deserialize = logic. Thanks Dimuthu On Wed, Jul 16, 2008 at 8:43 PM, Lefrancois, Carl = wrote: Hi Dimuthu, More information on this interesting problem... I decided to start by modifying the definition of my schema to try and = get around the current_node initialisation problem. I changed the = definition of the base type to this: I ignore the deser_test element and my source document never contains = it, but the new generated code for deserialisation contains this: /* * building deser_test element */ current_node =3D first_node; is_early_node_valid =3D AXIS2_FALSE; And now my ActivityNumber element is correctly deserialised. Is there anything more I can do to help debug this behaviour? -Carl -----Message d'origine----- De : Lefrancois, Carl Envoy=E9 : mardi, juillet 8, 2008 11:23 =C0 : Apache AXIS C User List Objet : RE : RE : WSDL2C deserialisation problem Hi Dimuthu, the parent type is Please let me know if there is anything else I can send you to help = figure this out. I already tried setting current_node =3D first_node; as described in my last response. I will try with the is_early_node_valid =3D AXIS2_FALSE; = and see if it helps. Carl -----Message d'origine----- De : Dimuthu Gamage [mailto:dimuthuc@gmail.com] Envoy=E9 : lundi, juillet 7, 2008 21:17 =C0 : Apache AXIS C User List Objet : Re: RE : WSDL2C deserialisation problem Hi Carl, I have a test case with the following schema and it works fine I think this is exactly simmilar to your schema (it has elements and an = attribute), may be the parent type is the different. Just check whether = there is special different in 'ActivityType' in your schema with the = Matrix type here. It s better if you can send that as well. And normally at the stat of the deserialize, we see the following code = segment code together, you may give a try with it too. current_node =3D first_node; is_early_node_valid =3D AXIS2_FALSE; Thanks Dimuthu On Tue, Jul 8, 2008 at 2:19 AM, Lefrancois, Carl = wrote: Hi Dimuthu Thanks for the quick response. The schema piece that defines the = commercial activity type is I tried setting current_node =3D first_node; just after first_node =3D = axiom_node_get_first_child(parent, env); however, the call to = current_node =3D axiom_node_get_next_sibling(current_node, env); set = current_node to NULL. Here is a piece of the XML that I am trying to deserialise: 503200 So I know the value is there. Carl -----Message d'origine----- De : Dimuthu Gamage [mailto:dimuthuc@gmail.com] Envoy=E9 : lundi, juillet 7, 2008 14:41 =C0 : Apache AXIS C User List Objet : Re: WSDL2C deserialisation problem 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 = 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 = part de AXA. Toute publication, utilisation ou diffusion, m=EAme = partielle, doit =EAtre autoris=E9e pr=E9alablement. Si vous n'=EAtes pas = destinataire 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 --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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