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 25147FFFB for ; Tue, 9 Apr 2013 20:54:18 +0000 (UTC) Received: (qmail 33602 invoked by uid 500); 9 Apr 2013 20:54:17 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 32930 invoked by uid 500); 9 Apr 2013 20:54:16 -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 32550 invoked by uid 99); 9 Apr 2013 20:54:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2013 20:54:16 +0000 Date: Tue, 9 Apr 2013 20:54:16 +0000 (UTC) From: "Andreas Veithen (JIRA)" To: java-dev@axis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (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 [ https://issues.apache.org/jira/browse/AXIS2-5505?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1362= 7092#comment-13627092 ]=20 Andreas Veithen commented on AXIS2-5505: ---------------------------------------- Sorry, the WSDL file appears to be copyrighted and we therefore can't use i= t in a test case. Can you please provide a WSDL that reproduces the problem= and that you can contribute under the Apache Software License? =20 > 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org