project_key: JBPAPP6
RemoteIssueLink: Added: This issue links to "CXF-4729 (Apache JIRA)"
RemoteIssueLink: Added: This issue links to "CXF-4680 (Apache JIRA)"
CXF-4729 and CXF-4680 were fixed in 2.6.5, EAP 6.1.0 contains 2.6.6 Does it mean it's resolved ? If yes, please set proper Status to ON_QA ans select proper Target Release
Using the same app I used for https://issues.jboss.org/browse/JBPAPP-10835 WSDL is fine: <xs:complexType name="WSInstructionCreationException"> <xs:sequence> <xs:element name="aValue" nillable="true" type="xs:string"/> <xs:element name="detail" nillable="true" type="xs:string"/> <xs:element name="info1" nillable="true" type="xs:string"/> <xs:element name="info2" nillable="true" type="xs:string"/> <xs:element name="instruction" nillable="true" type="xs:string"/> <xs:element name="intVal" nillable="true" type="xs:int"/> <xs:element name="message" nillable="true" type="xs:string"/> <xs:element name="messageKey" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> SAOP response in NOT fine: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Error message</faultstring> <detail> <ns1:WSInstructionCreationException xmlns:ns1="http://ws.arte.lodh.com/cxf"> <detail xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf"/> <message xmlns="http://ws.arte.lodh.com/cxf">Error message</message> <instruction xmlns="http://ws.arte.lodh.com/cxf">instr</instruction> <info1 xmlns="http://ws.arte.lodh.com/cxf">myInfo1</info1> <info2 xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf"/> <messageKey xmlns="http://ws.arte.lodh.com/cxf">msg key</messageKey> <aValue xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf"/> <intVal xsi:type="xs:int" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ws.arte.lodh.com/cxf">0</intVal> </ns1:WSInstructionCreationException> </detail> </soap:Fault> </soap:Body> </soap:Envelope>
https://issues.apache.org/jira/browse/CXF-5163 is fixed in CXF 2.7.6 which should be included in EAP 6.2.0 ER1. Moving to POST, Alessio is aware.
Checking per Jimmy's request via email. This issue never made it back to ON_QA after FailedQA - Comment 6. Checking on EAP 6.2.0 GA. WSDL is NOT fine: <xs:complexType name="WSInstructionCreationException"> <xs:sequence> <xs:element name="aValue" nillable="true" type="xs:string"/> <xs:element name="detail" nillable="true" type="xs:string"/> <xs:element name="info1" nillable="true" type="xs:string"/> <xs:element name="info2" nillable="true" type="xs:string"/> <xs:element name="instruction" nillable="true" type="xs:string"/> <xs:element name="intVal" nillable="true" type="xs:int"/> <xs:element name="message" nillable="true" type="xs:string"/> <xs:element minOccurs="0" name="message" type="xs:string"/> <xs:element name="messageKey" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> Problematic part is duplicated line for name="message": <xs:element name="message" nillable="true" type="xs:string"/> <xs:element minOccurs="0" name="message" type="xs:string"/> SOAP response is fine: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Error message</faultstring> <detail> <ns1:WSInstructionCreationException xmlns:ns1="http://ws.arte.lodh.com/cxf"> <aValue xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf"/> <detail xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf"/> <info1 xmlns="http://ws.arte.lodh.com/cxf">myInfo1</info1> <info2 xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf"/> <instruction xmlns="http://ws.arte.lodh.com/cxf">instr</instruction> <intVal xsi:type="xs:int" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ws.arte.lodh.com/cxf">0</intVal> <message xmlns="http://ws.arte.lodh.com/cxf">Error message</message> <messageKey xmlns="http://ws.arte.lodh.com/cxf">msg key</messageKey> </ns1:WSInstructionCreationException> </detail> </soap:Fault> </soap:Body> </soap:Envelope>
This is a reposting of comments based upon an evaluation I'm using this bld env. Is it the correct one for 6.4.0? upstream https://github.com/jbossas/jboss-eap.git remotes/upstream/6.x In this branch the pom.xml is using apache CXF version 2.7.11.redhat-3. I am getting different output from that described above. Using wireshark I got the correct value order in the returned msg. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body><soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Error message</faultstring> <detail> <ns1:WSInstructionCreationException xmlns:ns1="http://ws.arte.lodh.com/cxf"> <aValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf" xsi:nil="true"/> <detail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf" xsi:nil="true"/> <info1 xmlns="http://ws.arte.lodh.com/cxf">myInfo1</info1> <info2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf" xsi:nil="true"/> <instruction xmlns="http://ws.arte.lodh.com/cxf">instr</instruction> <intVal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ws.arte.lodh.com/cxf" xsi:type="xs:int">0</intVal> <message xmlns="http://ws.arte.lodh.com/cxf">Error message</message> <messageKey xmlns="http://ws.arte.lodh.com/cxf">msg key</messageKey> </ns1:WSInstructionCreationException> <stackTrace xmlns="http://cxf.apache.org/fault">com.lodh.cxf.WSInstructionCreationException#@#: com.lodh.cxf.MyWebService!throwException!MyWebService.java!39#*#sun.reflect.NativeMethodAccessorImpl!invoke0!NativeMethodAccessorImpl.java!-2#*#sun.reflect.NativeMethodAccessorImpl!invoke!NativeMethodAccessorImpl.java!57#*#sun.reflect.DelegatingMethodAccessorImpl!invoke!DelegatingMethodAccessorImpl.java!43#*# .... </stackTrace> </detail> </soap:Fault> </soap:Body> </soap:Envelope> However I did not get correct data generated in the wsdl. (dup message elements) <xs:complexType name="WSInstructionCreationException"> <xs:sequence> <xs:element minOccurs="0" name="aValue" type="xs:string"/> <xs:element minOccurs="0" name="detail" type="xs:string"/> <xs:element minOccurs="0" name="info1" type="xs:string"/> <xs:element minOccurs="0" name="info2" type="xs:string"/> <xs:element minOccurs="0" name="instruction" type="xs:string"/> <xs:element minOccurs="0" name="intVal" type="xs:int"/> >> <xs:element minOccurs="0" name="message" type="xs:string"/> >> <xs:element minOccurs="0" name="message" type="xs:string"/> <xs:element minOccurs="0" name="messageKey" type="xs:string"/> </xs:sequence> </xs:complexType> It appears as Kyle Lape noted on 2013-09-03 20:31:08 that the 2 fixes weren't fixed at the same time. The The WSDL ordering is NOT fixed via CXF-4729 in this version however the SOAP message ordering IS fixed (CXF-5163). Would someone confirm I am using the right repo ref.
Retested with current 6.x. Still failing in wsdl generation. steps to reproduce repo: https://github.com/jbossas/jboss-eap.git branch: checkout branch 6.x build Use test app bz901318App-test-code.zip (see attached) cd bz901318App ant deploy -Djboss.home=<USER-HOME>/jboss-eap/build/target/jboss-as-7.5.0.Final-redhat-SNAPSHOT java -jar target/bz-901318-app-1.0.jar org.jbossws.Client view <USER-HOME>/jboss-eap/build/target/jboss-as-7.5.0.Final-redhat-SNAPSHOT/standalone/data/wsdl/test.war/MyWebService.wsdl ant undeploy -Djboss.home=<USER-HOME>/jboss-eap/build/target/jboss-as-7.5.0.Final-redhat-SNAPSHOT ------ results ------------- <xs:complexType name="WSInstructionCreationException"> <xs:sequence> <xs:element minOccurs="0" name="aValue" type="xs:string"/> <xs:element minOccurs="0" name="detail" type="xs:string"/> <xs:element minOccurs="0" name="info1" type="xs:string"/> <xs:element minOccurs="0" name="info2" type="xs:string"/> <xs:element minOccurs="0" name="instruction" type="xs:string"/> <xs:element minOccurs="0" name="intVal" type="xs:int"/> >> <xs:element minOccurs="0" name="message" type="xs:string"/> >> <xs:element minOccurs="0" name="message" type="xs:string"/> <xs:element minOccurs="0" name="messageKey" type="xs:string"/> </xs:sequence> </xs:complexType>
Created attachment 954260 [details] test code
Testing with 6.x branch in https://github.com/jbossas/jboss-eap/ This version is using CXF <version.org.apache.cxf>2.7.13</version.org.apache.cxf> The cause of duplicate message elements being listed in the generated WSDL is a duplication of the processing of "cls" by Utils.getGetters at line 562 and addExceptionMessage() at line 587. Utils.getGetters checks for an Exception class defining method, getMessage. If method, "getMessage" is NOT annotated with @XmlTransient it is returned as a method to be processed and added to "seq" (lines 575-581) . A similar evaluation is performed by addExceptionMessage(). It adds a second ref to "getMessage" to "seq" when @XmlTransient is not present on the method, hence the duplicate elements in the WSDL. This same basic code exists back to version (2.6.x-fixes) http://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes I did not check version prior to that. ----- org.apache.cxf.jaxb.JAXBSchemaInitializer 562 for (Method m : Utils.getGetters(cls, accessType)) { .......... 575 JAXBBeanInfo beanInfo = getBeanInfo(type); 576 if (beanInfo != null) { 577 int idx = m.getName().startsWith("get") ? 3 : 2; 578 String name = m.getName().substring(idx); 579 name = Character.toLowerCase(name.charAt(0)) + name.substring(1); 580 XmlElement xmlElementAnno = m.getAnnotation(XmlElement.class); 581 addElement(schema, seq, beanInfo, new QName(namespace, name), isArray(type), xmlElementAnno); } } } // Create element in xsd:sequence for Exception.class if (Exception.class.isAssignableFrom(cls)) { 587 addExceptionMessage(cls, schema, seq); } ----- org.apache.cxf.jaxb.JAXBSchemaInitializer private void addExceptionMessage(Class<?> cls, XmlSchema schema, XmlSchemaSequence seq) { try { //a subclass could mark the message method as transient 611 Method m = cls.getMethod("getMessage"); 612 if (!m.isAnnotationPresent(XmlTransient.class)) { JAXBBeanInfo beanInfo = getBeanInfo(java.lang.String.class); XmlSchemaElement exEle = new XmlSchemaElement(schema, false); exEle.setName("message"); exEle.setSchemaTypeName(getTypeName(beanInfo)); exEle.setMinOccurs(0); 618 seq.getItems().add(exEle); } } catch (Exception e) { //ignore, just won't have the message element } ----- org.apache.cxf.jaxb.Utils 121 if (method.isBridge() 122 || Modifier.isStatic(method.getModifiers()) 123 >> || method.isAnnotationPresent(XmlTransient.class) 124 || method.getDeclaringClass().equals(Throwable.class) 125 || "getClass".equals(method.getName())) { 126 return false; }
I created https://issues.apache.org/jira/browse/CXF-6089 and provided patch for cxf-2.7.13.
Verified on 6.4.0.ER1 WSDL: <xs:element name="WSInstructionCreationException" type="tns:WSInstructionCreationException"/> <xs:complexType name="WSInstructionCreationException"> <xs:sequence> <xs:element minOccurs="0" name="aValue" type="xs:string"/> <xs:element minOccurs="0" name="detail" type="xs:string"/> <xs:element minOccurs="0" name="info1" type="xs:string"/> <xs:element minOccurs="0" name="info2" type="xs:string"/> <xs:element minOccurs="0" name="instruction" type="xs:string"/> <xs:element minOccurs="0" name="intVal" type="xs:int"/> <xs:element minOccurs="0" name="message" type="xs:string"/> <xs:element minOccurs="0" name="messageKey" type="xs:string"/> </xs:sequence> </xs:complexType> SOAP: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Error message</faultstring> <detail> <ns1:WSInstructionCreationException xmlns:ns1="http://ws.arte.lodh.com/cxf"> <aValue xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf"/> <detail xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf"/> <info1 xmlns="http://ws.arte.lodh.com/cxf">myInfo1</info1> <info2 xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.arte.lodh.com/cxf"/> <instruction xmlns="http://ws.arte.lodh.com/cxf">instr</instruction> <intVal xsi:type="xs:int" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ws.arte.lodh.com/cxf">0</intVal> <message xmlns="http://ws.arte.lodh.com/cxf">Error message</message> <messageKey xmlns="http://ws.arte.lodh.com/cxf">msg key</messageKey> </ns1:WSInstructionCreationException> </detail> </soap:Fault> </soap:Body> </soap:Envelope>