Hello Franz and all,

This problem is completely the same with AXISCPP-972 & AXISCPP-973(for 1.6beta) 
which I've already reported on JIRA.
http://issues.apache.org/jira/browse/AXISCPP-972
http://issues.apache.org/jira/browse/AXISCPP-973

And it was indeed an old problem AXISCPP-884 for 1.5final
http://issues.apache.org/jira/browse/AXISCPP-884

which I've already reported some months ago.

When I reporting bug on JIRA, I always wrote my solution to resolve the bug in 
descriptions.

Thanks.
Michael Xiong

-----Original Message-----
From: Franz Fehringer [mailto:[EMAIL PROTECTED] 
Sent: 2006年6月26日 15:56
To: Apache AXIS C Developers List
Subject: getChardataAs dysfunctional

Hello,

I work currently in the realm of deserializing xsd:extension based data types.
After noticing, that getChardataAs does not work as expected, i had a closer 
look at it.
It is defined (in SoapDeserializer.cpp) as void
SoapDeSerializer::getChardataAs(void* pValue,
                                 XSDTYPE type) and contains pValue = 
pSimpleType->getValue(); Since call by value is done here, this has no effect 
on the caller side (it is a local copy which is assigned to).
Furthermore in the generated sources, calls like
pIWSDZ->getChardataAs((void*)&(param->t_SellRate_value), XSD_DECIMAL);
show up.
Taking the address with an ampersand does not lead to a modifyable lvalue, so 
some repair has to be done here too.
With string (char*) datatypes there is an additional problem:
pIWSDZ->getChardataAs((void*)&(param->t_RequiredRoom2_value), 
pIWSDZ->XSD_STRING);
This is pointer to pointer, where only pointer was intended (no ampersand 
should be applied for xsd__string and xsd__nmtoken; i made a (resolved already) 
JIRA entry for a similar problem in the serializing code).

I resolved these problems temporarily in the following way

Pass the void* as a reference
void
SoapDeSerializer::getChardataAs(void*& pValue,
                                 XSDTYPE type) This means changes in 
SoapDeSerializer.cpp, SoapDeSerializer.h and IWrapperSoapDeSerializer.hpp.

Replace

pIWSDZ->getChardataAs((void*)&(param->t_SellRate_value), XSD_DECIMAL);
with
void* pValue3;
pIWSDZ->getChardataAs(pValue3, XSD_DECIMAL);
param->t_SellRate_value = *((xsd__decimal*) pValue3);
and
pIWSDZ->getChardataAs((void*)&(param->t_RequiredRoom2_value), 
pIWSDZ->XSD_STRING);
with
void* pValue6;
pIWSDZ->getChardataAs(pValue6, XSD_STRING);
param->t_RequiredRoom2_value = (xsd__string) pValue6;

Any ideas, how to make this better?
Any kind soul (Adrian, John, ...) to integrate this (or an alternative
approach) into stub generation?

Greetings

Franz



Reply via email to