[
http://issues.apache.org/jira/browse/AXISCPP-966?page=comments#action_12436926
]
Jean Vincent commented on AXISCPP-966:
--------------------------------------
A similar problem with xsd_int when the parameter is nillable. In the generate
code above it should have generated:
Should have been (!!! in front of modified lines, 8 lines removed):
int Axis_DeSerialize_MTM(MTM* param, IWrapperSoapDeSerializer* pIWSDZ)
{
!!! param->MTM_MTM_DSD = pIWSDZ->getElementAsInt("MTM_MTM_DSD",0);
!!! param->FAM_ASS_MAC = pIWSDZ->getElementAsString("FAM_ASS_MAC",1);
!!! param->MTM_MTM_NAT = pIWSDZ->getElementAsString("MTM_MTM_NAT",1);
!!! param->MTM_MTM_DSF = pIWSDZ->getElementAsInt("MTM_MTM_DSF",0);
return pIWSDZ->getStatus();
}
Note that if the xsd_int was not nillable the generated code would be correct
by assigning the integer value and deleting the allocated xsd__int*. But when
the last xsd_int is nillable, and the value is now stored as an xsd__int*, it
should be assigned by reference and not deleted.
I believe the same issue probably comes with all nillable types.
> WSDL2WS generate wrong code: redundant value reference * in Wrapper
> -------------------------------------------------------------------
>
> Key: AXISCPP-966
> URL: http://issues.apache.org/jira/browse/AXISCPP-966
> Project: Axis-C++
> Issue Type: Bug
> Components: WSDL processing - RPC
> Affects Versions: 1.6 Beta
> Environment: Platform:
> Linux fedora 3.0
> Axis version:
> Server-side Axis C++ 1.6Beta
> XML Parser Lib:
> xersesc 2.6
> WSDL2ws tool by using axis java 1.3
> Client-side version Axis java 1.3
> Http Server Version:
> Apache 2.0.53
> Tomcat 2.0.58
> Reporter: Michael Xiong
> Priority: Critical
>
> [Error Statement]:
> I have used AxisCPP1.6Beta version to generate SampleTestSoapWrapper.cpp as
> the below:
> Function: int SampleTestSoapWrapper::GetOperation(void* pMsg)
> xsd_string v0 = *(pIWSDZ->getElementAsString("ListType", 0));
> The generated code has bug: xsd_string is already indeed a "char *", so
> should not reference it's content by "*".
> The correct code I expected is:
> xsd_string v0 = pIWSDZ->getElementAsString("ListType", 0);
> [solution]:
> I have investigated the source code of AxisCPP/WSDL2Ws tool, and found that
> if I modify the following code at about line 217~234 in writeMethodInWrapper
> method that belongs to WrapWriter (wsdl2ws/cpp/iteral) class, the above bug
> can be resolved.
> else
> {
>
> writer.write(
> "\t"
> + paraTypeName
> + " v"
> + i
> //<mxiong debug 20060425
> + " = pIWSDZ->"
> // + " = *(pIWSDZ->"
> //>mxiong debug 20060425
> + CUtils.getParameterGetValueMethodName(
> paraTypeName,
> false)
> + "(\""
> + elementName
> // <mxiong debug 20060425
>
> // + "\",0));\n");
> + "\",0);\n");
> // >mxiong debug 20060425
>
> }
> So I think it's a bug.
> [other]
> I will create a patch for you and upload it later.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]