Return-Path: X-Original-To: apmail-ws-dev-archive@www.apache.org Delivered-To: apmail-ws-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 ED1C618463 for ; Sun, 7 Jun 2015 16:50:00 +0000 (UTC) Received: (qmail 85292 invoked by uid 500); 7 Jun 2015 16:50:00 -0000 Delivered-To: apmail-ws-dev-archive@ws.apache.org Received: (qmail 85113 invoked by uid 500); 7 Jun 2015 16:50:00 -0000 Mailing-List: contact dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ws.apache.org Delivered-To: mailing list dev@ws.apache.org Received: (qmail 85103 invoked by uid 99); 7 Jun 2015 16:50:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Jun 2015 16:50:00 +0000 Date: Sun, 7 Jun 2015 16:50:00 +0000 (UTC) From: "Andreas Veithen (JIRA)" To: dev@ws.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (AXIOM-392) Inconsistent behavior with respect to order of SOAPFault child elements 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/AXIOM-392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andreas Veithen resolved AXIOM-392. ----------------------------------- Resolution: Fixed > Inconsistent behavior with respect to order of SOAPFault child elements > ----------------------------------------------------------------------- > > Key: AXIOM-392 > URL: https://issues.apache.org/jira/browse/AXIOM-392 > Project: Axiom > Issue Type: Bug > Components: DOOM, LLOM > Affects Versions: 1.2.12 > Reporter: Andreas Veithen > Assignee: Andreas Veithen > Priority: Minor > Fix For: 1.2.15 > > > SOAPFaultImpl#internalSerialize contains logic to reorder the child elements to satisfy the requirements of SOAP 1.2 (which explicitly requires the child elements of a SOAP fault to appear in a specific order). This is useful for programmatically created SOAP faults because the application code doesn't need to take care of the order in which setCode, setReason, etc. are called. However, the reordering only works with some serialization methods. In particular, the child elements are not reordered when the SOAP message is serialized using a pull parser. > This can be shown using the following code: > SOAPFactory factory = OMAbstractFactory.getSOAP12Factory(); > SOAPFault fault = factory.createSOAPFault(); > SOAPFaultReason reason = factory.createSOAPFaultReason(); > reason.setText("Some reason"); > fault.setReason(reason); > SOAPFaultCode code = factory.createSOAPFaultCode(); > code.setText(new QName(factory.getNamespace().getNamespaceURI(), "Server")); > fault.setCode(code); > System.out.println("Using serialize:"); > fault.serialize(System.out); > System.out.println(); > System.out.println("Using pull parser:"); > XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(System.out); > new StreamingOMSerializer().serialize(fault.getXMLStreamReader(), writer); > writer.close(); > The output is: > Using serialize: > soapenv:ServerSome reason > Using pull parser: > Some reasonsoapenv:Server > The reordering only occurs in the first case. > Ideally, Axiom should take care of the order of child elements in the setCode, setReason, etc. methods and then just serialize the object model as is. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org For additional commands, e-mail: dev-help@ws.apache.org