Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 58455 invoked from network); 17 Jan 2006 11:17:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jan 2006 11:17:58 -0000 Received: (qmail 85882 invoked by uid 500); 17 Jan 2006 11:16:11 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 85485 invoked by uid 500); 17 Jan 2006 11:16:09 -0000 Mailing-List: contact axis-c-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C User List" Reply-To: "Apache AXIS C User List" Delivered-To: mailing list axis-c-user@ws.apache.org Received: (qmail 83515 invoked by uid 99); 17 Jan 2006 11:15:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2006 03:15:56 -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 [194.139.105.20] (HELO ns3.isogmbh.de) (194.139.105.20) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 17 Jan 2006 03:15:54 -0800 Received: (qmail 31511 invoked from network); 17 Jan 2006 11:15:31 -0000 Received: from unknown (HELO winpc89) (192.168.81.12) by mail.dmz.isogmbh.de with SMTP; 17 Jan 2006 11:15:30 -0000 From: "Franz Fehringer" To: "axis-c-user" , "Apache AXIS C Developers List" Subject: extra ampersand in serializexxx methods Date: Tue, 17 Jan 2006 12:15:22 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0076_01C61B5F.B05659D0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-ISOAntiVirus: scanned for viruses by ISO Mail-Scanner X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on ns3.nbg.isogmbh.de X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-104.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, MIME_QP_LONG_LINE,USER_IN_WHITELIST autolearn=ham version=3.0.2 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0076_01C61B5F.B05659D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Hello, Both AxisC 1.5 and the upcoming 1.6 have issues with serializexxx methods in generated code. The point is that all data items are passed as void* (opaque pointers). Therefore integer items get an ampersand & applied in front like pSZ->serializeAsAttribute( "xsi:nil", 0, (void*)&(xsd_boolean_true), XSD_BOOLEAN); But string/char*/AxisChar* items are already pointers themselves, so no ampersand should be applied: pSZ->serializeAsAttribute("MatchType", 0, (void*)(param->MatchType), XSD_NMTOKEN); What can now observed with my example is that AxisC 1.5 does it wrong in two places: pSZ->serializeAsAttribute("MatchType", 0, (void*)&(param->MatchType), XSD_NMTOKEN); pSZ->serializeAsChardata((void*)&(param->t_OrgNameSearch_value), XSD_STRING); whereas AxisC 1.6 is right in the first and still wrong in the second case: pSZ->serializeAsAttribute("MatchType", 0, (void*)(param->MatchType), XSD_NMTOKEN); pSZ->serializeAsChardata((void*)&(param->t_OrgNameSearch_value), XSD_STRING); Note that the attached generated sources are from AxisC 1.6. AxisC 1.5 has other issues with the code in question (attributes of type XSD_NMTOKEN are not serialized at all; members of structs already out of scope are accessed), but these seem to be fixed with AxisC 1.6. Is this issue already known and present in JIRA? Greetings Franz Dr. Franz Fehringer (Dipl. Math.) ____________________________________ ISO Software Systeme Eichendorffstrasse 29 90491 N�rnberg Deutschland Tel. : +49/(911) - 99594-0 Fax : +49/(911) - 99594-580 mailto:feh@isogmbh.de http://www.isogmbh.de ------=_NextPart_000_0076_01C61B5F.B05659D0 Content-Type: application/xml; name="vakanz.wsdl" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="vakanz.wsdl" ------=_NextPart_000_0076_01C61B5F.B05659D0 Content-Type: application/xml; name="vakanz.xsd" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="vakanz.xsd" Used for internal purposes. Must not be changed by = the client. The error ID uniquely identifies the error = instance. Code to indicate the class of this = error. Description of error = condition Source of error The StackTrace will be returned when an API = Setting is on. A warning or information about the booking = process just performed may be returned with the = booking. Defines the required timeout period of the = session, in whole seconds. NOTE: The API session manager can choose to = ignore/override this value. Defines the client prefered language. This = language is used to report back errors and user = messages. Defines the maximum number of transactions that = can occur on the session. The session is automatically disabled when = this maximum number of transactions has occured. This policy prevents = abuse by intruders. Super class for all references. All refrences are = immutable. To search on all agreements associated with the = logged on user, do not supply an AgreementKey. Specify an agreementSearchMethod if the = AgreementKey has not been supplied. Optionally search for a location within a = region. Select location by a number of Refs or combination = of Country/CSP and location name Set of locations identified by a unique location = reference A single location identified by the location = name within country and optionally CSP. Supply one or more locations Specify the Ref of the hotel if available or = enter the hotel name (a partial search will be = done.) Supply a Hotel and optionally a = location. Specify one or more hotel groups. Supply a Ref = is available or enter the Hotel Group Code. This class captures a date without the time and = timezone. ie it represents the same day of the year, and the same time = of day, locally, where ever it is displayed. Hence, it will always = display the same wherever it is viewed. One occurrence per bed constraint. Specifies = the min/max/exact number of beds by type: Single, Double, Permanent (any = single or double permanent beds), Any (any beds including = rollaways). One occurrence per occupancy constraint. Allows = rooms to be selected based on the number of guests it sleeps. If = WithExtraBeds attribute is "true" then it specifies total number of = occupants if temporary beds are added to room. Select room type by Ref Specify the room by the number (and type) of = beds and/or the number of people it sleeps. Attribute size is optional ; but API use's it on = all responses. On a request the API should ignore it and process = whatever is there Can either supply one Children element = specifying the number of children or include one element for each age = group (qualified by the Age attribute) GuestCounts and RoomRequirements can be used to = select the room type if the room type code is not known. Also, the rate = returned in the results will relate to the guest numbers (if specified); = otherwise it will be the standard room rate. Select room types by the facilities/amenities = they offer. This includes smoking/non-smoking, types of view, = connecting rooms, bed type (king, sofabed) etc. Restricts to rates that include a specific meal = plan Restricts to rates that include a specific = breakfast plan If more than one type of room is required then a = each room is given a unique ID (could be a number sequence - e.g. 1, 2, = 3 etc. or text - e.g. TWIN, DOUBLE. This ID is echoed back in the = search results to show which CRS room types match each required = room. Select Agreement and receiving organisation - = e.g. agent Supply a Location and / or a Hotel. One must be = selected. Specifies the hotel group(s) that are required. = Searches all if not set. Ignored if a unique hotel is = specified. Select hotels by official rating/category. The = Match attribute specifies whether this is the exact, minimum or maximum = rating that is required. Select hotels by the facilities they = offer If more than one room type is specified then all = rooms must be available at the hotel. If no rooms are specified then = all room types are returned. If "true" then return the number of remaining = rooms if from allocation If "true" then searches on-request rates as well = as allocation If "false" then only return hotels where there is = a direct connection to their CRS Specifies whether to check availability of = on-request rates. "None"=3DNo check; "Hotel"=3DCheck hotel and rate = plan is available; "Room"=3D check Hotel/RatePlan/RoomType is = available. Multiple locations will be returned if the = location specified in the search request is not = unique. Hotel CRS support information. Included if the = Hotel is connected to a CRS Notes that apply to the applicable = rate(s) One element for each matching room = type Brief hotel details. Full hotel information can = be obtained using GetHotelDetails. One SearchResult for each matching hotel that = has all the required rooms available Returned if there is more than one location that = matches the search criteria Describes any errors that occur during system = operation. Search for availability of one or more room types = in one or more hotels ------=_NextPart_000_0076_01C61B5F.B05659D0 Content-Type: text/plain; name="t_OrgNameSearch.cpp" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="t_OrgNameSearch.cpp" /*=0A= * Copyright 2003-2004 The Apache Software Foundation.=0A= =0A= *=0A= * Licensed under the Apache License, Version 2.0 (the "License");=0A= * you may not use this file except in compliance with the License.=0A= * You may obtain a copy of the License at=0A= *=0A= * http://www.apache.org/licenses/LICENSE-2.0=0A= *=0A= * Unless required by applicable law or agreed to in writing, software=0A= * distributed under the License is distributed on an "AS IS" BASIS,=0A= * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied.=0A= * See the License for the specific language governing permissions and=0A= * limitations under the License.=0A= *=0A= * This file was auto-generated by the Axis C++ Web Service Generator = (WSDL2Ws)=0A= * This file contains functions to manipulate complex type = t_OrgNameSearch=0A= */=0A= =0A= #include =0A= #include =0A= =0A= #include "t_OrgNameSearch.hpp"=0A= =0A= xsd__NMTOKEN t_OrgNameSearch::getMatchType()=0A= {=0A= return MatchType ; =0A= }=0A= =0A= void t_OrgNameSearch::setMatchType(xsd__NMTOKEN InValue, bool deep)=0A= {=0A= if (MatchType !=3D NULL)=0A= {=0A= if (__axis_deepcopy_MatchType)=0A= {=0A= delete [] MatchType;=0A= }=0A= MatchType =3D NULL;=0A= }=0A= =0A= if(InValue !=3D NULL)=0A= {=0A= if (deep)=0A= {=0A= MatchType =3D new char[strlen(InValue) + 1];=0A= strcpy(MatchType, InValue);=0A= }=0A= else=0A= {=0A= MatchType =3D InValue;=0A= }=0A= }=0A= else=0A= {=0A= MatchType =3D NULL;=0A= }=0A= __axis_deepcopy_MatchType =3D deep;=0A= }=0A= /*=0A= * This static method serialize a t_OrgNameSearch type of object=0A= */=0A= int Axis_Serialize_t_OrgNameSearch(t_OrgNameSearch* param, = IWrapperSoapSerializer* pSZ, bool bArray =3D false)=0A= {=0A= if ( param =3D=3D NULL )=0A= {=0A= pSZ->serializeAsAttribute( "xsi:nil", 0, (void*)&(xsd_boolean_true), = XSD_BOOLEAN);=0A= pSZ->serialize( ">", NULL);=0A= return AXIS_SUCCESS;=0A= }=0A= =0A= bool blnIsNewPrefix =3D false;=0A= if (!bArray)=0A= {=0A= const AxisChar* sPrefix =3D = pSZ->getNamespacePrefix(Axis_URI_t_OrgNameSearch, blnIsNewPrefix);=0A= if (blnIsNewPrefix)=0A= {=0A= pSZ->serialize(" xmlns:", sPrefix, "=3D\"",=0A= Axis_URI_t_OrgNameSearch, "\"", NULL );=0A= }=0A= }=0A= /* If there are any attributes serialize them. If there aren't then = close the tag */=0A= if (0 !=3D param->MatchType)=0A= pSZ->serializeAsAttribute("MatchType", 0, (void*)(param->MatchType), = XSD_NMTOKEN);=0A= pSZ->serialize( ">", 0);=0A= pSZ->serializeAsChardata((void*)&(param->t_OrgNameSearch_value), = XSD_STRING);=0A= =0A= /* then serialize elements if any*/=0A= =0A= if (!bArray && blnIsNewPrefix)=0A= {=0A= pSZ->removeNamespacePrefix(Axis_URI_t_OrgNameSearch);=0A= }=0A= =0A= return AXIS_SUCCESS;=0A= }=0A= =0A= /*=0A= * This static method deserialize a t_OrgNameSearch type of object=0A= */=0A= int Axis_DeSerialize_t_OrgNameSearch(t_OrgNameSearch* param, = IWrapperSoapDeSerializer* pIWSDZ)=0A= {=0A= xsd__NMTOKEN pValue0 =3D pIWSDZ->getAttributeAsNMTOKEN( "MatchType", 0);=0A= =0A= if( pValue0 =3D=3D NULL)=0A= {=0A= param->MatchType =3D NULL;=0A= }=0A= else=0A= {=0A= param->setMatchType (pValue0);=0A= Axis::AxisDelete( (void *) pValue0, XSD_NMTOKEN);=0A= =0A= }=0A= pIWSDZ->getChardataAs((void*)&(param->t_OrgNameSearch_value), = XSD_STRING);=0A= return pIWSDZ->getStatus();=0A= }=0A= void* Axis_Create_t_OrgNameSearch(t_OrgNameSearch* pObj, bool bArray =3D = false, int nSize=3D0)=0A= {=0A= if (bArray && (nSize > 0))=0A= {=0A= if (pObj)=0A= {=0A= t_OrgNameSearch* pNew =3D new t_OrgNameSearch[nSize];=0A= size_t i =3D nSize/2;=0A= for (int ii =3D 0; ii < (int) i; ++ii)=0A= {=0A= pNew[ii] =3D pObj[ii];=0A= pObj[ii].reset();=0A= }=0A= delete [] pObj;=0A= return pNew;=0A= }=0A= else=0A= {=0A= return new t_OrgNameSearch[nSize];=0A= }=0A= }=0A= else=0A= return new t_OrgNameSearch;=0A= }=0A= =0A= /*=0A= * This static method delete a t_OrgNameSearch type of object=0A= */=0A= void Axis_Delete_t_OrgNameSearch(t_OrgNameSearch* param, bool bArray =3D = false, int nSize=3D0)=0A= {=0A= if (bArray)=0A= {=0A= delete [] param;=0A= }=0A= else=0A= {=0A= delete param;=0A= }=0A= }=0A= /*=0A= * This static method gives the size of t_OrgNameSearch type of object=0A= */=0A= int Axis_GetSize_t_OrgNameSearch()=0A= {=0A= return sizeof(t_OrgNameSearch);=0A= }=0A= =0A= t_OrgNameSearch::t_OrgNameSearch()=0A= {=0A= reset();=0A= }=0A= =0A= t_OrgNameSearch::t_OrgNameSearch(const t_OrgNameSearch & original)=0A= {=0A= MatchType =3D NULL;=0A= __axis_deepcopy_MatchType =3D false;=0A= setMatchType(original.MatchType, original.__axis_deepcopy_MatchType);=0A= =0A= }=0A= =0A= void t_OrgNameSearch::reset()=0A= {=0A= /*do not allocate memory to any pointer members here=0A= because deserializer will allocate memory anyway. */=0A= MatchType =3D NULL;=0A= __axis_deepcopy_MatchType =3D false;=0A= }=0A= =0A= t_OrgNameSearch::~t_OrgNameSearch()=0A= {=0A= /*delete any pointer and array members here*/=0A= if (MatchType !=3D NULL)=0A= {=0A= if(__axis_deepcopy_MatchType)=0A= {=0A= delete [] MatchType;=0A= }=0A= MatchType =3D NULL;=0A= }=0A= }=0A= ------=_NextPart_000_0076_01C61B5F.B05659D0--