Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 45578 invoked from network); 31 Jan 2007 07:43:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Jan 2007 07:43:26 -0000 Received: (qmail 42911 invoked by uid 500); 31 Jan 2007 07:43:32 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 42894 invoked by uid 500); 31 Jan 2007 07:43:32 -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 42883 invoked by uid 99); 31 Jan 2007 07:43:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jan 2007 23:43:32 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jan 2007 23:43:25 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 84598714057 for ; Tue, 30 Jan 2007 23:43:05 -0800 (PST) Message-ID: <15416162.1170229385522.JavaMail.jira@brutus> Date: Tue, 30 Jan 2007 23:43:05 -0800 (PST) From: "nadir amra (JIRA)" To: axis-c-dev@ws.apache.org Subject: [jira] Updated: (AXISCPP-970) axis-c engine: nillable problem: when minOccurs="0" and nillable="false", the serailization does NOT follow W3C schema standard In-Reply-To: <22029775.1148051431066.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXISCPP-970?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] nadir amra updated AXISCPP-970: ------------------------------- Comment: was deleted > axis-c engine: nillable problem: when minOccurs="0" and nillable="false", the serailization does NOT follow W3C schema standard > ------------------------------------------------------------------------------------------------------------------------------- > > Key: AXISCPP-970 > URL: https://issues.apache.org/jira/browse/AXISCPP-970 > Project: Axis-C++ > Issue Type: Bug > Components: Serialization, Server - Apache module, Server - Engine, SOAP, XSD Types > 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 > > [Introduction]: > Maybe you have known that, the axis-c-1.5final's "nillable" dealing is completely wrong. > I found that axis-c-1.6beta has taken some improvement on this area, it's good. > But after really verify axis-c-1.6beta, I found axis-c-1.6beta seems has NOT resolved the old nillable issue correctly. > At first, the design of "nillable" is too strange and hard-for-maintain in axis-c-1.6beta. > The W3C's standard set default of "nillable" to "false", but axis-c-1.6beta set it's default to "true" in related constructor. > Anyway, if axis-c-1.6beta can deal with "nillable" carefully & correctly in inner logic, there will has no problem. > But after verify, I found that axis-c-1.6beta seems does not deal with "nillable" correctly in case of minOccurs="0". > This problem occurred in nearly all XSD types. > The below is a sample which has been verified by me, which indicate that axis-c-1.6beta has problem to deal with "nillable" in case of minOccurs="0". > [Error Statement]: > The below is a piece of WSDL which used by me: > ... ... > > > > > > > > ... ... > When I create server code by axis-c-1.6beta on this WSDL, build it and run, the response looks like this: > ; > > > > > I wrote the related code logic(demo purpose only) in server module is like the below: > xsd__string_Array * MyTesting::Testing(xsd__string Value0,xsd__string Value1,xsd__string Value2) > { > // xsd__string_Array* pIDs = new xsd__string_Array(); > xsd__string* p = new xsd__string[3]; > p[0] = strdup(""); > p[1] = strdup(""); > p[2] = strdup(""); > pIDs->set(p,3); > return pIDs; > //>mxiong debug 2006/5/19 > } > You can found that the response xsi:nil="true" is wrong. > That will cause my client application rejecting to accept this response for it does not follow contracted schema. > [My Solution]: > After analyzing and debug to axis-c-1.6beta code, I modified soap/xsd/String.cpp, it became OK. > My modification is like the below: > String::String(const xsd__string value) > { > #ifdef ENABLE_AXISTRACE > if (axiscpp::AxisTrace::isTraceOn()) > axiscpp::AxisTrace::traceEntry("String", "String", this, 1, > TRACETYPE_STRING, 0, ((void*)&value)); /* AUTOINSERTED TRACE */ > #endif > // // if (value) > // { > setNil(false); > serialize(value); > // } > //>mxiong debug 2006/5/19 > { > #ifdef ENABLE_AXISTRACE > if (axiscpp::AxisTrace::isTraceOn()) > axiscpp::AxisTrace::traceExit("String", "String", this, 0); /* AUTOINSERTED TRACE */ > #endif > return; > } > } > AxisChar* String::serialize(const xsd__string value) throw (AxisSoapException) > { > #ifdef ENABLE_AXISTRACE > if (axiscpp::AxisTrace::isTraceOn()) > axiscpp::AxisTrace::traceEntry("String", "serialize", this, 1, > TRACETYPE_STRING, 0, ((void*)&value)); /* AUTOINSERTED TRACE */ > #endif > MinLength* minLength= getMinLength(); > // unsigned int nLen = 0; > //>mxiong debug 2006/5/19 > if (minLength->isSet()) > { > // if (NULL != value) > { > nLen = strlen(value); > } > if (nLen < (unsigned int) minLength->getMinLength()) > //>mxiong debug 2006/5/19 > // if (strlen(value) < (unsigned int) minLength->getMinLength()) > { > AxisString exceptionMessage = > "Length of value to be serialized is shorter than MinLength specified for this type. Minlength = "; > AxisChar* length = new AxisChar[10]; > sprintf(length, "%d", minLength->getMinLength()); > exceptionMessage += length; > exceptionMessage += ", Length of value = "; > sprintf(length, "%d", strlen(value)); > exceptionMessage += length; > exceptionMessage += "."; > delete [] length; > > throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, > const_cast(exceptionMessage.c_str())); > } > } > delete minLength; > > MaxLength* maxLength = getMaxLength(); > if (maxLength->isSet()) > { > // // if (strlen(value) > (unsigned int) maxLength->getMaxLength()) > if (nLen > (unsigned int) maxLength->getMaxLength()) > //>mxiong debug 2006/5/19 > { > AxisString exceptionMessage = > "Length of value to be serialized is longer than MaxLength specified for this type. Maxlength = "; > AxisChar* length = new AxisChar[10]; > sprintf(length, "%d", maxLength->getMaxLength()); > exceptionMessage += length; > exceptionMessage += ", Length of value = "; > sprintf(length, "%d", strlen(value)); > exceptionMessage += length; > exceptionMessage += "."; > delete [] length; > > throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, > const_cast(exceptionMessage.c_str())); > } > } > delete maxLength; > Length* length = getLength(); > if (length->isSet()) > { > // if (nLen != (unsigned int) length->getLength()) > //>mxiong debug 2006/5/19 > // if (strlen(value) != (unsigned int) length->getLength()) > { > AxisString exceptionMessage = > "Length of value to be serialized is not the same as Length specified for this type. Length = "; > AxisChar* lengthAsString = new AxisChar[10]; > sprintf(lengthAsString, "%d", length->getLength()); > exceptionMessage += lengthAsString; > exceptionMessage += ", Length of value = "; > sprintf(lengthAsString, "%d", strlen(value)); > exceptionMessage += lengthAsString; > exceptionMessage += "."; > delete [] lengthAsString; > > throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, > const_cast(exceptionMessage.c_str())); > } > } > delete length; > // AxisString valueAsString; > if (NULL != value) > { > valueAsString = value; > } else > { > valueAsString = ""; > } > //>mxiong debug 2006/5/19 > // AxisString valueAsString = value; > AxisChar* serializedValue = (AxisChar*) replaceReservedCharacters(valueAsString).c_str(); > IAnySimpleType::serialize(serializedValue); > { > #ifdef ENABLE_AXISTRACE > AxisChar* traceRet = (m_Buf); > if (axiscpp::AxisTrace::isTraceOn()) > axiscpp::AxisTrace::traceExit("String", "serialize", this, 0, > TRACETYPE_STRING, 0, ((void*)&traceRet)); /* AUTOINSERTED TRACE */ > return traceRet; > #else > return m_Buf; > #endif > } > } > So I think axis-c-1.6beta has bug in dealing with "nillable" for nearly any XSD types, especially for String type as my sample indicated. > [Suggestion] > Would you like to give it a careful check to correct this problem in axis-c-1.6beta? > My modification may be regarded as a candicate solution for you to resolve this problem, but I wish maybe a better detail design for axis-c-1.6beta on "nillable" area may be better. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-c-dev-help@ws.apache.org