axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimuthu Gamage (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2C-730) using wsdl2c with -d adb option, and element with minOccurs=0 results in lost nodes in the deserialize method
Date Mon, 22 Oct 2007 03:16:52 GMT

    [ https://issues.apache.org/jira/browse/AXIS2C-730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536562
] 

Dimuthu Gamage commented on AXIS2C-730:
---------------------------------------

Hi,

The deserialize logic doesnt effect lost nodes since it is used to parse an existing xml.
Where as the serialize method is used to build xml (from adb objects)

Since the "actualDraught" has minOccurs=0 property the deserialize function should be ready
to continue regardless  of "actualDraught" exist or missing. That is what have done in the
following code segment

if (current_node && axiom_node_get_data_element( current_node, env) && !axutil_strcmp("actualDraught",
axiom_element_get_localname((axiom_element_t *)axiom_node_get_data_element( current_node,
env), env)) 

I think what has happened is that in the incomming xml the "actualDraught" element is already
missing. Please check the incomming xml using TCPMon or just using axiom serialization http://ws.apache.org/axis2/c/docs/om_tutorial.html#Serialization


Thanks
Dimuthu

>  using wsdl2c with -d adb option, and element with minOccurs=0 results in lost nodes
in the deserialize method
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2C-730
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-730
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: code generation
>    Affects Versions: 1.1.0
>         Environment: Windows
>            Reporter: José Manuel Rubio
>
> I created stub using wsdl2c with -d adb option. 
> Generated code does not take into account the fact that a node could be missing from
the input. For example the following code is being generated:
> axis2_status_t AXIS2_CALL
> adb_ship_deserialize(
>        adb_ship_t* _ship,
>        const axutil_env_t *env,
>        axiom_node_t* parent)
> {
>    .
>    .
>    .
> if (current_node  && axiom_node_get_data_element( current_node, env) &&
!axutil_strcmp("actualDraught", 
> axiom_element_get_localname((axiom_element_t *)axiom_node_get_data_element( current_node,
env), env))
> )
> {
> 	current_element = (axiom_element_t *)axiom_node_get_data_element( current_node, env);
> 		  text_value = axiom_element_get_text(current_element, env, current_node );
> 		  
> 	status = adb_ship_set_actualDraught( _ship, env,
> 										 atof( text_value));
> 			
> 	if( AXIS2_FAILURE ==  status)
> 	{
> 		AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in setting the value for actualDraught
"
> 							 " %d :: %s", env->error->error_number,
> 							 AXIS2_ERROR_GET_MESSAGE(env->error));
> 		return AXIS2_FAILURE;
> 	}
> }
> if(current_node != NULL)
> {
>         //Here it is asking for the next node even when the code above has not processed
the current_node
> 	current_node = axiom_node_get_next_sibling( current_node, env);
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message