Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-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 77E4DD3B7 for ; Thu, 18 Oct 2012 07:24:11 +0000 (UTC) Received: (qmail 99574 invoked by uid 500); 18 Oct 2012 07:24:11 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 99433 invoked by uid 500); 18 Oct 2012 07:24:10 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 99402 invoked by uid 99); 18 Oct 2012 07:24:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2012 07:24:09 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of freeman.fang@gmail.com designates 209.85.160.41 as permitted sender) Received: from [209.85.160.41] (HELO mail-pb0-f41.google.com) (209.85.160.41) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2012 07:24:04 +0000 Received: by mail-pb0-f41.google.com with SMTP id rq2so9085708pbb.0 for ; Thu, 18 Oct 2012 00:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer; bh=adYEb/0S8zuckqoupn44UNAbTxGbVRuQc0wqtElX1hE=; b=O97UsUY3h1DJyTiJ1nLMD2a11QPQtY9gilEOdQCeYwzGQa/CcxsIol6cn28Y+CVIYI gUtomp6zc/a+xIFCzIDxrCNmNP/zlald75qBT+M6zk9HtbUV3woX9b2arI2VlV/dpXN/ 0ZnRouzQjQTzkQHngQ4RoYiv4gQV9UTTe5/NTE0mxsRuyFLfI2gxTHmOSrvS4JXi5G0M O51JvRYbOHbY1jwtWcneKU4ZRt5AaP13e9y6Vp6p0zdm4gv3iTBulW0qVbjHq1cSFed6 oxgnKEnwIRekfUijigBJwA/XO+kgHgHAmqBG0OWsEzclFGttSGo6abkj3JVUrpJFA0dH nCSA== Received: by 10.66.86.165 with SMTP id q5mr51865251paz.18.1350545023451; Thu, 18 Oct 2012 00:23:43 -0700 (PDT) Received: from [192.168.1.102] ([123.116.136.15]) by mx.google.com with ESMTPS id gj9sm13814070pbc.16.2012.10.18.00.23.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Oct 2012 00:23:42 -0700 (PDT) From: Freeman Fang Mime-Version: 1.0 (Apple Message framework v1280) Content-Type: multipart/alternative; boundary="Apple-Mail=_89675493-B3BF-4549-B304-4FA941716AB3" Subject: Re: Incompatible fault type is generated in the wsdl with RI command Date: Thu, 18 Oct 2012 15:23:30 +0800 In-Reply-To: To: dev@cxf.apache.org References: <214D29BE-7406-4A5A-B124-F20B0A98E347@gmail.com> Message-Id: <0BEEEAD6-BF00-41F3-B607-BB0E53C009DE@gmail.com> X-Mailer: Apple Mail (2.1280) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_89675493-B3BF-4549-B304-4FA941716AB3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=GB2312 Yeah, I must admit CXF does't exactly follow the JAXWS spec 3.7, that's = could be issues when use code-first way with exception. Could you please create a jira to track this issue, and patch are = welcomed, as always. Thanks Freeman =A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3= =AD Freeman(Yue) Fang Red Hat, Inc.=20 FuseSource is now part of Red Hat Web: http://fusesource.com | http://www.redhat.com/ Twitter: freemanfang Blog: http://freemanfang.blogspot.com http://blog.sina.com.cn/u/1473905042 weibo: http://weibo.com/u/1473905042 On 2012-10-18, at =CF=C2=CE=E72:24, Ivan wrote: > Yes, with current CXF generation codes, I could see only in/out jaxb > classes are generated in WrapperClassGenerator (if I did not miss = anything > here ;-)) > But, think that it is required to generate the fault jaxb class per = the > description in 3.7 Service Specific Exception, XmlAccessType.FIELD = will not > workaroud all the issues, at least for the message property in the > Exception hierarchy. >=20 > 2012/10/18 Freeman Fang >=20 >> Hi, >>=20 >> If there's no FaultBean in @webFault and no getFaultInfo method in >> TestException class, currently CXF will put the exception class = itself as >> the FaultBean, so you need ensure field in TestException could be >> marshaled/unmarshalled correctly by jaxb, so just add >> @XmlAccessorType(XmlAccessType.FIELD) in TestException can do the = trick, >> =A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD=A3=AD= =A3=AD >> Freeman(Yue) Fang >>=20 >> Red Hat, Inc. >> FuseSource is now part of Red Hat >> Web: http://fusesource.com | http://www.redhat.com/ >> Twitter: freemanfang >> Blog: http://freemanfang.blogspot.com >> http://blog.sina.com.cn/u/1473905042 >> weibo: http://weibo.com/u/1473905042 >>=20 >> On 2012-10-17, at =CF=C2=CE=E711:53, Ivan wrote: >>=20 >>> Hi, with the exception class below , it only has a get*** method for = the >>> info property. >>>=20 >>> @WebFault >>> public TestException extends Exception { >>> private String message =3D null; >>>=20 >>> public TestException () { >>> } >>>=20 >>> public TestException (String message) { >>> this.message =3D message; >>> } >>>=20 >>> public String getInfo() { >>> return message; >>> } >>>=20 >>> } >>>=20 >>> With the RI wsgen command, the generated schema type is : >>> RI: >>> >>> >>> >>> >>> >>> >>> >>>=20 >>> If using CXF tool or on the CXF runtime, the generated schema type = for >> the >>> exception is : >>>=20 >>> >>> >>> >>> >>>=20 >>> With the JaxWS spec, 3.7 Service Specific Exception, considering = that no >>> getFaultInfo or faultBean in WebFault annotation is provided, the >>> special algorithm will be used to map the exception to jaxb bean, = one of >>> the steps write below: >>>=20 >>> For each getter in the exception and its superclasses, a property of = the >>> same type and name is added to >>> the bean. All the getter methods except >>> getMessagefromjava.lang.Throwabletype hierarchy >>> are excluded from the list of getters to be mapped. >>>=20 >>> Seems that only getter method is required, with the current codes in >> static >>> boolean JAXBContextInitializer.isMethodAccepted, it will check = whether >> the >>> setter exists. I am thinking that this is not required for this = scenario, >>> as we only need to read the information from the user exception. >> Thoughts ? >>>=20 >>> -- >>> Ivan >>=20 >>=20 >=20 >=20 > --=20 > Ivan --Apple-Mail=_89675493-B3BF-4549-B304-4FA941716AB3--