Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 35152200B2F for ; Sun, 3 Jul 2016 10:22:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 28550160A71; Sun, 3 Jul 2016 08:22:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4BFC7160A2C for ; Sun, 3 Jul 2016 10:22:12 +0200 (CEST) Received: (qmail 1176 invoked by uid 500); 3 Jul 2016 08:22:11 -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 1156 invoked by uid 99); 3 Jul 2016 08:22:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jul 2016 08:22:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1F1B02C02A3 for ; Sun, 3 Jul 2016 08:22:11 +0000 (UTC) Date: Sun, 3 Jul 2016 08:22:11 +0000 (UTC) From: "Andreas Veithen (JIRA)" To: java-dev@axis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (AXIS2-5505) WSDL2Code/Axis2 1.6.2: Generated Stub fails compilation - Possible issue in JaxbRIDatabindingTemplate.xsl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 03 Jul 2016 08:22:13 -0000 [ https://issues.apache.org/jira/browse/AXIS2-5505?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Andreas Veithen resolved AXIS2-5505. ------------------------------------ Resolution: Incomplete > WSDL2Code/Axis2 1.6.2: Generated Stub fails compilation - Possible issue = in JaxbRIDatabindingTemplate.xsl > -------------------------------------------------------------------------= -------------------------------- > > Key: AXIS2-5505 > URL: https://issues.apache.org/jira/browse/AXIS2-5505 > Project: Axis2 > Issue Type: Bug > Components: codegen > Affects Versions: 1.6.2 > Environment: Windows 7 - 64 bit, Weblogic 11gR1 & JDK 1.6.0_25 > Reporter: Sumit Shah > Priority: Critical > Attachments: ParticipantService.wsdl > > > I am using WSDL2Code in Axis2 1.6.2 to generate the client stubs from a s= et of WSDLs. However, the following code block fails compilation in couple = of the WSDL files. If you notice: the line: 'com.sample.test.webservices.im= pl.participant.Notify.class,' ends with a comma that shouldn't be there. > try { > jc =3D javax.xml.bind.JAXBContext.newInstance( > > > .class, > > > > ); > } > If I remove the and the faults from the , I= do not see this issue.=20 > It seems like the XSL needs to be fixed to account for such operations.= =20 > Below is the snippet of the generated stub: > private static final javax.xml.bind.JAXBContext wsContext; > static { > javax.xml.bind.JAXBContext jc; > jc =3D null; > try { > jc =3D ja= vax.xml.bind.JAXBContext.newInstance( > com.sample.test.webservices.impl.participant.Add.class, > com.sample.test.webservices.impl.participant.AddR= esponse.class, > com.sample.test.webservices.exceptions.Unrecovera= bleFault.class, > com.sample.test.webservices.exceptions.Recoverabl= eFault.class, > com.sample.test.webservices.impl.participant.Dele= te.class, > com.sample.test.webservices.impl.participant.Dele= teResponse.class, > com.sample.test.webservices.impl.participant.Sele= ct.class, > com.sample.test.webservices.impl.participant.Sele= ctResponse.class, > com.sample.test.webservices.impl.participant.AddC= hange.class, > com.sample.test.webservices.impl.participant.AddC= hangeResponse.class, > com.sample.test.webservices.impl.participant.Quer= y.class, > com.sample.test.webservices.impl.participant.Quer= yResponse.class, > com.sample.test.webservices.impl.participant.Upda= te.class, > com.sample.test.webservices.impl.participant.Upda= teResponse.class, > com.sample.test.webservices.impl.participant.Chan= ge.class, > com.sample.test.webservices.impl.participant.Chan= geResponse.class, > com.sample.test.webservices.impl.participant.Sync= hronize.class, > com.sample.test.webservices.impl.participant.Sync= hronizeResponse.class, > com.sample.test.webservices.impl.participant.Noti= fy.class, > =20 > ); > } > catch ( javax.xml.bind.JAXBException ex ) { > System.err.println("Unable to create JAXBContext: " + ex.= getMessage()); > ex.printStackTrace(System.err); > Runtime.getRuntime().exit(-1); > } > finally { > wsContext =3D jc; > } > } > This issue does not occur in 1.6.0. > Research so far > ------------------------------------------------------------- > https://issues.apache.org/jira/browse/AXIS2-5215 caused the Java2WSDL cha= nge from 1.6.0 to 1.6.2. If you notice the wsdl change I mention below, in = that case I see why the JaxbRIDatabindingTemplate.xsl is failing. This is a= guess, but FWIW=E2=80=A6the wsdl generated for a one way operation using J= ava2WSDL contains a =E2=80=98null=E2=80=99 message for the output as shown = below: > > > > > > > If you look at the wsdl snippet above and the code in the JaxbRIDatabindi= ngTemplate.xsl, after writing Notify.class, (because probably at that point= in the order Notify.class is not the last one) and is expecting to write N= otifyResponse.class as the last one, but the check =E2=80=98=E2=80=99 fails because the output message/type is null and h= ence the trailing comma. > =20 > try { > jc =3D javax.xml.bind.JAXBContext.newInstance( > > > .class, > > > > ); > } > If I remove the and the faults from the , I= do not see this issue.=20 > It seems like the XSL needs to be fixed to account for such operations.= =20 > Email Snippet from Andreas > ------------------------------------------------------ > -----Original Message----- > From: Andreas Veithen [mailto:andreas.veithen@gmail.com]=20 > Sent: Thursday, March 21, 2013 4:35 AM > To: java-user > Subject: Re: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fail= s compilation - Update: Actually issue occurring in WSDL2Code > That's simply because the code in JaxbRIDatabindingTemplate.xsl is incorr= ect. position() !=3D last() checks if the current node is the last node, bu= t the expression appears in an block. So, if the last node doesn't= satisfy the condition of the block, then an extra comma is genera= ted and the generated code won't compile. > Andreas -- 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