Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7C7F196C6 for ; Fri, 15 Apr 2016 01:00:34 +0000 (UTC) Received: (qmail 19105 invoked by uid 500); 15 Apr 2016 01:00:34 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 18828 invoked by uid 500); 15 Apr 2016 01:00:34 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 18638 invoked by uid 99); 15 Apr 2016 01:00:34 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2016 01:00:34 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 2AF342C1F5C for ; Fri, 15 Apr 2016 01:00:34 +0000 (UTC) Date: Fri, 15 Apr 2016 01:00:34 +0000 (UTC) From: "Hudson (JIRA)" To: java-dev@axis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AXIS2-5758) wsdl2java: nillable = "true" is ignored MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AXIS2-5758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15242243#comment-15242243 ] Hudson commented on AXIS2-5758: ------------------------------- SUCCESS: Integrated in axis2-1.7 #48 (See [https://builds.apache.org/job/axis2-1.7/48/]) AXIS2-5758: Merge r1739186 to the 1.7 branch. (veithen: rev 1739202) * axis2 * axis2/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java * axis2/modules/adb-tests/pom.xml * axis2/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758 * axis2/modules/adb-tests/src/test/wsdl/AXIS2-5758.wsdl > wsdl2java: nillable = "true" is ignored > --------------------------------------- > > Key: AXIS2-5758 > URL: https://issues.apache.org/jira/browse/AXIS2-5758 > Project: Axis2 > Issue Type: Bug > Components: adb > Affects Versions: 1.7.1 > Reporter: Philemon Schucker > > I tried to create a java client with wsdl2java. With version 1.7.0 and older ones everything is fine. But since version 1.7.1 the {{nillable="true"}} attribute is ignored. Here is a small example wsdl: > {code:xml} > targetNamespace="http://example.com/stockquote.wsdl" > xmlns:tns="http://example.com/stockquote.wsdl" > xmlns:xsd1="http://example.com/stockquote.xsd" > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns="http://schemas.xmlsoap.org/wsdl/"> > > > xmlns="http://www.w3.org/2001/XMLSchema"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > My first service > > > > > > > {code} > For creating the client I use the {{-u}} option. The problem appears in the Factory's parse method for the defined types. For example for TradePrice.java from the given wsdl above: > Genereated code from version 1.7.0 (snippet from Factory parse method): > {code:title=TradePrice.java|borderStyle=solid} > if (!"true".equals(nillableValue) && > !"1".equals(nillableValue)) { > java.lang.String content = reader.getElementText(); > object.setPrice(org.apache.axis2.databinding.utils.ConverterUtil.convertToFloat( > content)); > } else { > object.setPrice(java.lang.Float.NaN); > reader.getElementText(); // throw away text nodes if any. > } > {code} > Genereated code from version 1.7.1 (snippet from Factory parse method): > {code:title=TradePrice.java|borderStyle=solid} > if ("true".equals(nillableValue) || > "1".equals(nillableValue)) { > throw new org.apache.axis2.databinding.ADBException( > "The element: " + "price" + > " cannot be null"); > } > java.lang.String content = reader.getElementText(); > object.setPrice(org.apache.axis2.databinding.utils.ConverterUtil.convertToFloat( > content)); > {code} > So as you can see, in 1.7.1 the {{price}} element is handled as a non nillable value although it is nillable. So if the server sends a repsonse with price = null the client will throw an exception although everything is fine... -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org