Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 14995 invoked from network); 5 Dec 2005 22:04:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Dec 2005 22:04:39 -0000 Received: (qmail 15231 invoked by uid 500); 5 Dec 2005 22:04:39 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 15198 invoked by uid 500); 5 Dec 2005 22:04:39 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 15184 invoked by uid 99); 5 Dec 2005 22:04:39 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2005 14:04:38 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [64.202.165.79] (HELO smtpout01-04.mesa1.secureserver.net) (64.202.165.79) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 05 Dec 2005 14:04:38 -0800 Received: (qmail 24707 invoked from network); 5 Dec 2005 22:04:16 -0000 Received: from unknown (69.104.108.82) by smtpout01-04.mesa1.secureserver.net (64.202.165.79) with ESMTP; 05 Dec 2005 22:04:16 -0000 Message-ID: <009501c5f9e7$d505dce0$3700a8c0@EMANUEL> From: "Emanuel Norrbin" To: Subject: Bad C++ generated by WSDL2Ws Date: Mon, 5 Dec 2005 14:04:14 -0800 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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(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(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