Hi Emanuel,
I found this problem in windows as well. This is a problem in server
side wrapper generation. Server side wrapper generation still doesn't
support for the new memory model for arrays. I'm currently working on
this on this and will fix most probably in the next 2 days.
Thanks,
Dushshantha
-----Original Message-----
From: Emanuel Norrbin [mailto:Emanuel.Norrbin@edgewaystech.com]
Sent: Tuesday, December 06, 2005 4:04 AM
To: axis-c-dev@ws.apache.org
Subject: Bad C++ generated by WSDL2Ws
Hi,
I am generating C++ server stubs using Axis C++ 1.2, using the java
class
org.apache.axis.wsdl.wsdl2ws.WSDL2Ws. If a web service operation has a
vector argument (e.g. vector of string or vector of ints) the generated
code
is not correct. The generated code seems to be accepted by many
compilers
but gcc 4, correctoy, gives a compilation error (gcc 3 does not
complain).
To give an example, the code is from the *Wrapper.cpp file:
int ActivityInfoProviderWrapper::deleteSourceFileHistory(void* pMsg)
{
IMessageData* mc = (IMessageData*)pMsg;
int nStatus;
IWrapperSoapSerializer* pIWSSZ = NULL;
mc->getSoapSerializer(&pIWSSZ);
if (!pIWSSZ) return AXIS_FAIL;
IWrapperSoapDeSerializer* pIWSDZ = NULL;
mc->getSoapDeSerializer(&pIWSDZ);
if (!pIWSDZ) return AXIS_FAIL;
/* check whether we have got correct message */
if (AXIS_SUCCESS !=
pIWSDZ->checkMessageBody("deleteSourceFileHistory",
"urn:com.edgeways.integration.server.implementation.webservice.activity.
ActivityInfoProvider")return
AXIS_FAIL;
pIWSSZ->createSoapMethod("deleteSourceFileHistoryResponse", \
"urn:com.edgeways.integration.server.implementation.webservice.activity.
ActivityInfoProvider");
xsd__string v0 = pIWSDZ->getElementAsString("user",0);
xsd__string v1 = pIWSDZ->getElementAsString("passwrd",0);
// This is the original code
// xsd__long_Array v2 =
(xsd__long_Array&)pIWSDZ->getBasicArray(XSD_LONG, "entryIDs",0);
// This would work:
const Axis_Array& v2ref= pIWSDZ->getBasicArray(XSD_LONG,
"entryIDs",0);
const xsd__long_Array& v2 = reinterpret_cast<const
xsd__long_Array&>(v2ref);
//
(...)
The line assigning to v2 does not compile on gcc 4, failing with the
following error message:
In member function
int ActivityInfoProviderWrapper::deleteSourceFileHistory(void*):
./../ActivityInfoProviderWrapper.cpp:352: error:.
invalid cast of an rvalue expression of type axiscpp::Axis_Array
to type axiscpp::xsd__long_Array
which is correct since what is assigned to the lhs is a reference to a
temporary variable.
My suggestion is to replace it with something like this:
const Axis_Array& v2ref= pIWSDZ->getBasicArray(XSD_LONG,
"entryIDs",0);
const xsd__long_Array& v2 = reinterpret_cast<const
xsd__long_Array&>(v2ref);
which will work since the temporary is bound to the const reference
v2ref.
I have not seen this issue resolved in Jira or mentioned on this list.
Should I submit it to Jira or is someone already aware of this?
/Emanuel Norrbin
emanuel.norrbin@edgewaystech.com
|