Re: Problem in deserialization with WSDL2C generated code

2009-07-25 Thread Dimuthu Gamage
Correction: "RT_AnalogVarListSequence" is a type and there should *not* be
any xml tag in that name.

Dimuthu

On Sat, Jul 25, 2009 at 8:52 PM, Dimuthu Gamage  wrote:

>
> Hi Unai,
>
> This is a bug in fact in the deserializaton code.
> "RT_AnalogVarListSequence" is a type and there should be any xml tag in that
> name.
> Look at the pattern on the non-array case (this bug is there with the array
> scenario), the code inside
>
>
>>
>> if (axutil_qname_equals(element_qname, env, qname))
>> {
>>
>>is_early_node_valid = AXIS2_TRUE;
>
>   ..
>
> should be changed to
>
>
>
>>
>> if (adb_RT_AnalogVarListSequence_is_particle() ||
>> axutil_qname_equals(element_qname, env, qname))
>> {
>>if (axutil_qname_equals(element_qname, env, qname))
>>{
>> is_early_node_valid = AXIS2_TRUE;
>>
>}
>..
>
> Please raise a jira to report this problem.
>
> Thanks
> Dimuthu
>
>
> 2009/7/24 Unai Estébanez 
>
> Hi,
>> I have a problem with my client while I try to deserialize my server
>> response. Please, could anybody help me?
>>
>> I generate the server and client code with WSDL2C
>> client: /usr/local/axis2c/bin/tools/wsdl2c/WSDL2C.sh -uri ./rsu_vars.wsdl
>> -sp -d adb -uw --noBuildXML
>> server: /usr/local/axis2c/bin/tools/wsdl2c/WSDL2C.sh -uri ./rsu_vars.wsdl
>> -ss -sd -sp -d adb -uw --noBuildXML
>>
>> At the bottom of this message I will include the wsdl I use.
>>
>> The problem I have is that when I serialize, the automatic generated code,
>> perform this check: ( I have hand written remarks inside the code )
>> --- SEVER SERIALIZATION CODE BEGIN ---
>>  more code here
>> /*
>>  * parsing RT_AnalogVarListSequence element
>>  */
>>if(!adb_RT_AnalogVarListSequence_is_particle())
>> <- THIS FUNCTIONS ALWAYS DO: "return AXIS2_TRUE;"
>>{
>>axutil_stream_write(stream, env,
>> start_input_str, start_input_str_len); <-- NEVER INSERTS THE TAG
>> ""
>>}
>>
>>  
>> adb_RT_AnalogVarListSequence_serialize((adb_RT_AnalogVarListSequence_t*)element,
>>
>>
>>   env, current_node, parent_element,
>>
>>   adb_RT_AnalogVarListSequence_is_particle() || AXIS2_FALSE, namespaces,
>> next_ns_index);
>>if(!adb_RT_AnalogVarListSequence_is_particle())
>>{
>>axutil_stream_write(stream, env,
>> end_input_str, end_input_str_len);
>>}
>> }
>>  more code here
>> --- SEVER SERIALIZATION CODE END ---
>>
>> On the other hand the deserialization code fails because it needs the
>>  tag:
>> --- CLIENT DESERIALIZATION CODE BEGIN ---
>> /*
>>  * building RT_AnalogVarListSequence element
>> */
>> element_qname = axutil_qname_create(env, "RT_AnalogVarListSequence", "
>> http://www.example.org/rsu_vars/";, NULL); <-- CLient expects the
>> "" tag
>> for (i = 0, sequence_broken = 0, current_node = first_node;
>> !sequence_broken && current_node != NULL;)
>> {
>>  if(axiom_node_get_node_type(current_node,
>> env) != AXIOM_ELEMENT)
>>   {
>>  current_node
>> =axiom_node_get_next_sibling(current_node, env);
>>  is_early_node_valid = AXIS2_FALSE;
>>  continue;
>>   }
>>
>>   current_element = (axiom_element_t
>> *)axiom_node_get_data_element(current_node, env);
>>   qname =
>> axiom_element_get_qname(current_element, env, current_node);
>>
>>   if (axutil_qname_equals(element_qname,
>> env, qname))
>>   {
>>
>>   is_early_node_valid = AXIS2_TRUE;
>>
>>
>>   element =
>> (void*)adb_RT_AnalogVarListSequence_create(env);
>>
>>   status =
>> adb_RT_AnalogVarListSequence_deserialize((adb_RT_AnalogVarListSequence_t*)element,
>> env,
>>
>> ¤t_node, &is_early_node_valid, AXIS2_FALSE);
>>
>>   if(AXIS2_FAILURE ==  status)
>>   {
>>   AXIS2_LOG_ERROR(env->log,
>> AXIS2_LOG_SI, "failed in building element RT_AnalogVarListSequence ");
>>   }
>>   else
>>   {
>>
>> axutil_array_list_add_at(arr_list, env, i, element);
>>   }
>>
>>  if(AXIS2_FAILURE ==  status)
>> 

Re: Problem in deserialization with WSDL2C generated code

2009-07-25 Thread Dimuthu Gamage
Hi Unai,

This is a bug in fact in the deserializaton code. "RT_AnalogVarListSequence"
is a type and there should be any xml tag in that name.
Look at the pattern on the non-array case (this bug is there with the array
scenario), the code inside


>
> if (axutil_qname_equals(element_qname, env, qname))
> {
>
>is_early_node_valid = AXIS2_TRUE;

  ..

should be changed to



>
> if (adb_RT_AnalogVarListSequence_is_particle() ||
> axutil_qname_equals(element_qname, env, qname))
> {
>if (axutil_qname_equals(element_qname, env, qname))
>{
> is_early_node_valid = AXIS2_TRUE;
>
   }
   ..

Please raise a jira to report this problem.

Thanks
Dimuthu


2009/7/24 Unai Estébanez 

> Hi,
> I have a problem with my client while I try to deserialize my server
> response. Please, could anybody help me?
>
> I generate the server and client code with WSDL2C
> client: /usr/local/axis2c/bin/tools/wsdl2c/WSDL2C.sh -uri ./rsu_vars.wsdl
> -sp -d adb -uw --noBuildXML
> server: /usr/local/axis2c/bin/tools/wsdl2c/WSDL2C.sh -uri ./rsu_vars.wsdl
> -ss -sd -sp -d adb -uw --noBuildXML
>
> At the bottom of this message I will include the wsdl I use.
>
> The problem I have is that when I serialize, the automatic generated code,
> perform this check: ( I have hand written remarks inside the code )
> --- SEVER SERIALIZATION CODE BEGIN ---
>  more code here
> /*
>  * parsing RT_AnalogVarListSequence element
>  */
>if(!adb_RT_AnalogVarListSequence_is_particle())
> <- THIS FUNCTIONS ALWAYS DO: "return AXIS2_TRUE;"
>{
>axutil_stream_write(stream, env,
> start_input_str, start_input_str_len); <-- NEVER INSERTS THE TAG
> ""
>}
>
>  
> adb_RT_AnalogVarListSequence_serialize((adb_RT_AnalogVarListSequence_t*)element,
>
>
> env, current_node, parent_element,
>
> adb_RT_AnalogVarListSequence_is_particle() || AXIS2_FALSE, namespaces,
> next_ns_index);
>if(!adb_RT_AnalogVarListSequence_is_particle())
>{
>axutil_stream_write(stream, env,
> end_input_str, end_input_str_len);
>}
> }
>  more code here
> --- SEVER SERIALIZATION CODE END ---
>
> On the other hand the deserialization code fails because it needs the
>  tag:
> --- CLIENT DESERIALIZATION CODE BEGIN ---
> /*
>  * building RT_AnalogVarListSequence element
> */
> element_qname = axutil_qname_create(env, "RT_AnalogVarListSequence", "
> http://www.example.org/rsu_vars/";, NULL); <-- CLient expects the
> "" tag
> for (i = 0, sequence_broken = 0, current_node = first_node;
> !sequence_broken && current_node != NULL;)
> {
>  if(axiom_node_get_node_type(current_node,
> env) != AXIOM_ELEMENT)
>   {
>  current_node
> =axiom_node_get_next_sibling(current_node, env);
>  is_early_node_valid = AXIS2_FALSE;
>  continue;
>   }
>
>   current_element = (axiom_element_t
> *)axiom_node_get_data_element(current_node, env);
>   qname =
> axiom_element_get_qname(current_element, env, current_node);
>
>   if (axutil_qname_equals(element_qname,
> env, qname))
>   {
>
>   is_early_node_valid = AXIS2_TRUE;
>
>
>   element =
> (void*)adb_RT_AnalogVarListSequence_create(env);
>
>   status =
> adb_RT_AnalogVarListSequence_deserialize((adb_RT_AnalogVarListSequence_t*)element,
> env,
>
> ¤t_node, &is_early_node_valid, AXIS2_FALSE);
>
>   if(AXIS2_FAILURE ==  status)
>   {
>   AXIS2_LOG_ERROR(env->log,
> AXIS2_LOG_SI, "failed in building element RT_AnalogVarListSequence ");
>   }
>   else
>   {
>
> axutil_array_list_add_at(arr_list, env, i, element);
>   }
>
>  if(AXIS2_FAILURE ==  status)
>  {
>  AXIS2_LOG_ERROR(env->log,
> AXIS2_LOG_SI, "failed in setting the value for RT_AnalogVarListSequence ");
>  if(element_qname)
>  {
>
> axutil_qname_free(element_qname, env);
>  

Problem in deserialization with WSDL2C generated code

2009-07-24 Thread Unai Estébanez
Hi,
I have a problem with my client while I try to deserialize my server
response. Please, could anybody help me?

I generate the server and client code with WSDL2C
client: /usr/local/axis2c/bin/tools/wsdl2c/WSDL2C.sh -uri ./rsu_vars.wsdl
-sp -d adb -uw --noBuildXML
server: /usr/local/axis2c/bin/tools/wsdl2c/WSDL2C.sh -uri ./rsu_vars.wsdl
-ss -sd -sp -d adb -uw --noBuildXML

At the bottom of this message I will include the wsdl I use.

The problem I have is that when I serialize, the automatic generated code,
perform this check: ( I have hand written remarks inside the code )
--- SEVER SERIALIZATION CODE BEGIN ---
 more code here
/*
 * parsing RT_AnalogVarListSequence element
 */
   if(!adb_RT_AnalogVarListSequence_is_particle())
<- THIS FUNCTIONS ALWAYS DO: "return AXIS2_TRUE;"
   {
   axutil_stream_write(stream, env,
start_input_str, start_input_str_len); <-- NEVER INSERTS THE TAG
""
   }

 
adb_RT_AnalogVarListSequence_serialize((adb_RT_AnalogVarListSequence_t*)element,


env, current_node, parent_element,

adb_RT_AnalogVarListSequence_is_particle() || AXIS2_FALSE, namespaces,
next_ns_index);
   if(!adb_RT_AnalogVarListSequence_is_particle())
   {
   axutil_stream_write(stream, env,
end_input_str, end_input_str_len);
   }
}
 more code here
--- SEVER SERIALIZATION CODE END ---

On the other hand the deserialization code fails because it needs the
 tag:
--- CLIENT DESERIALIZATION CODE BEGIN ---
/*
 * building RT_AnalogVarListSequence element
*/
element_qname = axutil_qname_create(env, "RT_AnalogVarListSequence", "
http://www.example.org/rsu_vars/";, NULL); <-- CLient expects the
"" tag
for (i = 0, sequence_broken = 0, current_node = first_node; !sequence_broken
&& current_node != NULL;)
{
 if(axiom_node_get_node_type(current_node,
env) != AXIOM_ELEMENT)
  {
 current_node
=axiom_node_get_next_sibling(current_node, env);
 is_early_node_valid = AXIS2_FALSE;
 continue;
  }

  current_element = (axiom_element_t
*)axiom_node_get_data_element(current_node, env);
  qname =
axiom_element_get_qname(current_element, env, current_node);

  if (axutil_qname_equals(element_qname,
env, qname))
  {

  is_early_node_valid = AXIS2_TRUE;


  element =
(void*)adb_RT_AnalogVarListSequence_create(env);

  status =
adb_RT_AnalogVarListSequence_deserialize((adb_RT_AnalogVarListSequence_t*)element,
env,

¤t_node, &is_early_node_valid, AXIS2_FALSE);

  if(AXIS2_FAILURE ==  status)
  {
  AXIS2_LOG_ERROR(env->log,
AXIS2_LOG_SI, "failed in building element RT_AnalogVarListSequence ");
  }
  else
  {

axutil_array_list_add_at(arr_list, env, i, element);
  }

 if(AXIS2_FAILURE ==  status)
 {
 AXIS2_LOG_ERROR(env->log,
AXIS2_LOG_SI, "failed in setting the value for RT_AnalogVarListSequence ");
 if(element_qname)
 {
axutil_qname_free(element_qname,
env);
 }
 if(arr_list)
 {
axutil_array_list_free(arr_list,
env);
 }
 return AXIS2_FAILURE;
 }

 i ++;
current_node =
axiom_node_get_next_sibling(current_node, env);
  }
  else
  {
 ALWAYS ENTER HERE
  is_early_node_valid = AXIS2_FALSE;
  sequence_broken = 1;
  }

}
--- CLIENT DESERIALIZATION CODE END ---

--- WSDL BEGIN ---

http://schemas.xmlsoap.org/wsdl/soap/";
x