cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r463242 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/helpers/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/bindings/soap/src/...
Date Thu, 12 Oct 2006 13:21:53 GMT
Author: mmao
Date: Thu Oct 12 06:21:52 2006
New Revision: 463242

URL: http://svn.apache.org/viewvc?view=rev&rev=463242
Log:
Soap12Fault

*  Re-organize SoapFault, some of SoapVersion specific attributes moved into specific SoapVersion
*  Interceptors get the SoapFault attributes from SoapVersion.
*  Added Soap12Fault In/Out interceptors

Added:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XPathUtils.java
  (with props)
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java
  (with props)
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
  (with props)
Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapVersion.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultInInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XMLUtils.java Thu
Oct 12 06:21:52 2006
@@ -292,4 +292,26 @@
         }
         return ret;
     }
+    
+    public static QName getQName(String value, Node node) {        
+        if (value == null) {
+            return null;
+        }
+        
+        int index = value.indexOf(":");
+
+        if (index == -1) {
+            return new QName(value);
+        }
+
+        String prefix = value.substring(0, index);
+        String localName = value.substring(index + 1);
+        String ns = node.lookupNamespaceURI(prefix);
+
+        if (ns == null || localName == null) {
+            throw new RuntimeException("Invalid QName in mapping: " + value);
+        }
+
+        return new QName(ns, localName, prefix);        
+    }
 }

Added: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XPathUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XPathUtils.java?view=auto&rev=463242
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XPathUtils.java
(added)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XPathUtils.java
Thu Oct 12 06:21:52 2006
@@ -0,0 +1,82 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.helpers;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathFactory;
+
+import org.w3c.dom.Node;
+
+public class XPathUtils {
+
+    XPath xpath;
+    
+    public XPathUtils() {   
+        this(null);
+    }
+    
+    public XPathUtils(Map<String, String> ns) {
+        xpath = XPathFactory.newInstance().newXPath();
+
+        if (ns != null) {
+            xpath.setNamespaceContext(new MapNamespaceContext(ns));
+        }         
+    }
+    
+    public Object getValue(String xpathExpression, Node node, QName type) {    
+        try {
+            return xpath.evaluate(xpathExpression, node, type);
+        } catch (Exception e) {
+            return null;    
+        }
+    }
+    
+    class MapNamespaceContext implements NamespaceContext {
+        private Map<String, String> namespaces;
+
+        public MapNamespaceContext(Map<String, String> namespaces) {
+            super();
+            this.namespaces = namespaces;
+        }
+
+        public String getNamespaceURI(String prefix) {
+            return namespaces.get(prefix);
+        }
+
+        public String getPrefix(String namespaceURI) {
+            for (Map.Entry<String, String> e : namespaces.entrySet()) {
+                if (e.getValue().equals(namespaceURI)) {
+                    return e.getKey();
+                }
+            }
+            return null;
+        }
+
+        public Iterator getPrefixes(String namespaceURI) {
+            return null;
+        }
+
+    }
+}

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XPathUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/XPathUtils.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
Thu Oct 12 06:21:52 2006
@@ -28,7 +28,7 @@
  */
 public final class Soap11 implements SoapVersion {
     public static final String SOAP_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/";
-    
+
     private static final Soap11 INSTANCE = new Soap11();
 
     private final double version = 1.1;
@@ -56,7 +56,7 @@
     private Soap11() {
         // Singleton 
     }
-    
+
     public static Soap11 getInstance() {
         return INSTANCE;
     }
@@ -110,7 +110,7 @@
     public String getNextRole() {
         return nextRole;
     }
-    
+
     public String getAttrNameRole() {
         return "actor";
     }
@@ -119,4 +119,24 @@
         return "mustUnderstand";
     }
 
+    public QName getReceiver() {
+        return new QName(SOAP_NAMESPACE, "Server");
+    }
+
+    public QName getSender() {
+        return new QName(SOAP_NAMESPACE, "Client");
+    }
+
+    public QName getMustUnderstand() {
+        return new QName(SOAP_NAMESPACE, "MustUnderstand");
+    }
+
+    public QName getVersionMismatch() {
+        return new QName(SOAP_NAMESPACE, "VersionMismatch");
+    }
+
+    public QName getDateEncodingUnknown() {
+        // There is no such fault code in soap11
+        return null;
+    }
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
Thu Oct 12 06:21:52 2006
@@ -120,4 +120,24 @@
         return "mustUnderstand";
     }
 
+    public QName getReceiver() {
+        return new QName(SOAP_NAMESPACE, "Receiver");
+    }
+
+    public QName getSender() {
+        return new QName(SOAP_NAMESPACE, "Sender");
+    }
+
+    public QName getMustUnderstand() {
+        return new QName(SOAP_NAMESPACE, "MustUnderstand");
+    }
+
+    public QName getVersionMismatch() {
+        return new QName(SOAP_NAMESPACE, "VersionMismatch");
+    }
+
+    public QName getDateEncodingUnknown() {
+        return new QName(SOAP_NAMESPACE, "DataEncodingUnknown");
+    }
+
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Thu Oct 12 06:21:52 2006
@@ -47,6 +47,8 @@
 import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
 import org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor;
 import org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor;
+import org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor;
+import org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
@@ -117,10 +119,11 @@
         String bindingStyle = SoapConstants.BINDING_STYLE_DOC;
 
         SoapBinding sb = null;
+        SoapVersion version = null;
         if (binding instanceof SoapBindingInfo) {
             SoapBindingInfo sbi = (SoapBindingInfo) binding;
-            
-            sb = new SoapBinding(sbi.getSoapVersion());
+            version = sbi.getSoapVersion();
+            sb = new SoapBinding(version);
             // Service wide style
             if (!StringUtils.isEmpty(sbi.getStyle())) {
                 bindingStyle = sbi.getStyle();
@@ -142,9 +145,7 @@
         sb.getInInterceptors().add(new MultipartMessageInterceptor());
         sb.getInInterceptors().add(new ReadHeadersInterceptor());
         sb.getInInterceptors().add(new MustUnderstandInterceptor());
-        sb.getInInterceptors().add(new StaxInInterceptor());
-
-        sb.getInFaultInterceptors().add(new Soap11FaultInInterceptor());
+        sb.getInInterceptors().add(new StaxInInterceptor());        
         
         // TODO: We shouldn't be running this interceptor if MTOM isn't enabled
         // as caching everything is going to slow us down, should set according to config

@@ -158,7 +159,14 @@
 
         sb.getOutFaultInterceptors().add(new StaxOutInterceptor());
         sb.getOutFaultInterceptors().add(new SoapOutInterceptor());
-        sb.getOutFaultInterceptors().add(new Soap11FaultOutInterceptor());
+        
+        if (version.getVersion() == 1.1) {
+            sb.getInFaultInterceptors().add(new Soap11FaultInInterceptor());
+            sb.getOutFaultInterceptors().add(new Soap11FaultOutInterceptor());
+        } else if (version.getVersion() == 1.2) {
+            sb.getInFaultInterceptors().add(new Soap12FaultInInterceptor());
+            sb.getOutFaultInterceptors().add(new Soap12FaultOutInterceptor());
+        }        
 
         if (SoapConstants.BINDING_STYLE_RPC.equalsIgnoreCase(bindingStyle)) {
             sb.getInInterceptors().add(new RPCInInterceptor());

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
Thu Oct 12 06:21:52 2006
@@ -26,20 +26,17 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.interceptor.Fault;
 
 public class SoapFault extends Fault {
 
-    public static final QName VERSION_MISMATCH = new QName(Soap12.SOAP_NAMESPACE, "VersionMismatch");
-    public static final QName MUST_UNDERSTAND = new QName(Soap12.SOAP_NAMESPACE, "MustUnderstand");
-    public static final QName DATA_ENCODING_UNKNOWN = new QName(Soap12.SOAP_NAMESPACE, "DataEncodingUnknown");
     public static final QName ATTACHMENT_IO = new QName(Soap12.SOAP_NAMESPACE, "AttachmentIOError");
 
     /**
      * "The message was incorrectly formed or did not contain the appropriate
      * information in order to succeed." -- SOAP 1.2 Spec
-     */
-    public static final QName SENDER = new QName(Soap12.SOAP_NAMESPACE, "Sender");
+     */ 
 
     /**
      * A SOAP 1.2 only fault code. <p/> "The message could not be processed for
@@ -47,22 +44,17 @@
      * contents of the message itself." -- SOAP 1.2 Spec <p/> If this message is
      * used in a SOAP 1.1 Fault it will most likely (depending on the
      * FaultHandler) be mapped to "Sender" instead.
-     */
-    public static final QName RECEIVER = new QName(Soap12.SOAP_NAMESPACE, "Receiver");
-
-    public static final QName SOAP11_SERVER = new QName(Soap11.SOAP_NAMESPACE, "Server");
-    public static final QName SOAP11_CLIENT = new QName(Soap11.SOAP_NAMESPACE, "Client");
-    public static final QName SOAP11_MUST_UNDERSTAND = new QName(Soap11.SOAP_NAMESPACE, "MustUnderstand");
-    public static final QName SOAP11_VERSION_MISMATCH = new QName(Soap11.SOAP_NAMESPACE,
"VersionMismatch");
+     */ 
 
     private QName faultCode;
     private QName subCode;
     private String role;
+    private String node;
     private Map<String, String> namespaces = new HashMap<String, String>();
 
-    public SoapFault(Message message, Throwable throwable, QName type) {
+    public SoapFault(Message message, Throwable throwable, QName faultCode) {
         super(message, throwable);
-        this.faultCode = type;
+        this.faultCode = faultCode;
     }
 
     public SoapFault(Message message, QName faultCode) {
@@ -83,6 +75,28 @@
     public QName getFaultCode() {
         return faultCode;
     }
+    
+    public String getCodeString(String prefix, String defaultPrefix) {
+        return getFaultCodeString(prefix, defaultPrefix, faultCode);
+    }
+    
+    public String getSubCodeString(String prefix, String defaultPrefix) {
+        return getFaultCodeString(prefix, defaultPrefix, subCode);
+    }
+    
+    private String getFaultCodeString(String prefix, String defaultPrefix, QName fCode) {
+        String codePrefix = null;
+        if (StringUtils.isEmpty(prefix)) {
+            codePrefix = fCode.getPrefix();
+            if (StringUtils.isEmpty(codePrefix)) {
+                codePrefix = defaultPrefix;
+            }
+        } else {
+            codePrefix = prefix;
+        }
+        
+        return prefix + ":" + fCode.getLocalPart();        
+    }
 
     /**
      * Sets the fault code of this fault.
@@ -114,6 +128,14 @@
     public void setRole(String actor) {
         this.role = actor;
     }
+    
+    public String getNode() {
+        return node;
+    }
+
+    public void setNode(String n) {
+        this.node = n;
+    }    
 
     /**
      * Returns the SubCode for the Fault Code.
@@ -141,13 +163,14 @@
         this.namespaces = namespaces;
     }
 
-    public static SoapFault createFault(Fault f) {
+    public static SoapFault createFault(Fault f, SoapVersion v) {
         if (f instanceof SoapFault) {
             return (SoapFault)f;
         }
 
         SoapFault soapFault = new SoapFault(new Message(f.getMessage(), (ResourceBundle)null),
f.getCause(),
-                                            RECEIVER);
+                                            v.getReceiver());
+        
         soapFault.setDetail(f.getDetail());
         return soapFault;
     }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapVersion.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapVersion.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapVersion.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapVersion.java
Thu Oct 12 06:21:52 2006
@@ -39,6 +39,16 @@
     QName getBody();
     
     QName getFault();
+    
+    QName getReceiver();
+    
+    QName getSender();
+    
+    QName getMustUnderstand();
+    
+    QName getVersionMismatch();
+    
+    QName getDateEncodingUnknown();
 
     String getSoapEncodingStyle();
 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java
Thu Oct 12 06:21:52 2006
@@ -24,9 +24,12 @@
 import java.util.Set;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.staxutils.StaxUtils;
 
 public abstract class AbstractSoapInterceptor extends AbstractPhaseInterceptor<SoapMessage>

     implements SoapInterceptor {
@@ -43,4 +46,13 @@
     public Set<QName> getUnderstoodHeaders() {
         return Collections.emptySet();
     }
+    
+    protected String getFaultCodePrefix(XMLStreamWriter writer, QName faultCode) throws XMLStreamException
{
+        String codeNs = faultCode.getNamespaceURI();
+        String prefix = null;
+        if (codeNs.length() > 0) {
+            prefix = StaxUtils.getUniquePrefix(writer, codeNs, true);
+        }        
+        return prefix;
+    }    
 }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
Thu Oct 12 06:21:52 2006
@@ -34,6 +34,7 @@
 import org.apache.cxf.binding.soap.HeaderUtil;
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.interceptor.Interceptor;
@@ -50,6 +51,7 @@
     }
 
     public void handleMessage(SoapMessage soapMessage) {
+        SoapVersion soapVersion = soapMessage.getVersion();
         //Client-in message needs not to handle MustUnderstand
         if (isRequestor(soapMessage)) {
             return;
@@ -70,7 +72,7 @@
             }
             sb.delete(pos - 2, pos);
             throw new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, sb.toString()),
-                            SoapFault.MUST_UNDERSTAND);
+                                soapVersion.getMustUnderstand());
         }
     }
 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
Thu Oct 12 06:21:52 2006
@@ -90,7 +90,8 @@
                 xmlReader.next();
             }
         } catch (XMLStreamException e) {
-            throw new SoapFault(new Message("XML_STREAM_EXC", BUNDLE), e, SoapFault.SENDER);
+            throw new SoapFault(new Message("XML_STREAM_EXC", BUNDLE), e, 
+                                message.getVersion().getSender());
         }
     }
 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultInInterceptor.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultInInterceptor.java
Thu Oct 12 06:21:52 2006
@@ -54,7 +54,8 @@
                 }
             }
         } catch (XMLStreamException e) {
-            throw new SoapFault("Could not parse message.", SoapFault.SENDER);
+            throw new SoapFault("Could not parse message.", 
+                                message.getVersion().getSender());
         }
 
         SoapFault fault = new SoapFault(exMessage, faultCode);

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap11FaultOutInterceptor.java
Thu Oct 12 06:21:52 2006
@@ -22,7 +22,6 @@
 import java.util.Map;
 import java.util.ResourceBundle;
 
-import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
@@ -49,7 +48,7 @@
         XMLStreamWriter writer = message.getContent(XMLStreamWriter.class);
         Fault f = (Fault)message.getContent(Exception.class);
 
-        SoapFault fault = SoapFault.createFault(f);
+        SoapFault fault = SoapFault.createFault(f, message.getVersion());
 
         try {
             Map<String, String> namespaces = fault.getNamespaces();
@@ -58,33 +57,14 @@
             }
 
             String ns = message.getVersion().getNamespace();
-            String prefix = StaxUtils.getUniquePrefix(writer, ns, true);
+            String defaultPrefix = StaxUtils.getUniquePrefix(writer, ns, true);
 
-            writer.writeStartElement(prefix, "Fault", ns);
+            writer.writeStartElement(defaultPrefix, "Fault", ns);
 
-            writer.writeStartElement("faultcode");
-
-            QName faultCode = fault.getFaultCode();
-            String codeString;
-            if (faultCode.equals(SoapFault.RECEIVER)) {
-                codeString = prefix + ":Server";
-            } else if (faultCode.equals(SoapFault.SENDER)) {
-                codeString = prefix + ":Client";
-            } else if (faultCode.equals(SoapFault.VERSION_MISMATCH)) {
-                codeString = prefix + ":VersionMismatch";
-            } else if (faultCode.equals(SoapFault.MUST_UNDERSTAND)) {
-                codeString = prefix + ":MustUnderstand";
-            } else if (faultCode.equals(SoapFault.DATA_ENCODING_UNKNOWN)) {
-                codeString = prefix + ":Client";
-            } else {
-                String codeNs = faultCode.getNamespaceURI();
-                String codePrefix = faultCode.getPrefix();
-                if (codeNs.length() > 0) {
-                    codePrefix = StaxUtils.getUniquePrefix(writer, codeNs, true) + ":";
-                }
-
-                codeString = codePrefix + faultCode.getLocalPart();
-            }
+            writer.writeStartElement("faultcode");          
+                
+            String codeString = fault.getCodeString(getFaultCodePrefix(writer, fault.getFaultCode()),

+                                                    defaultPrefix);           
 
             writer.writeCharacters(codeString);
             writer.writeEndElement();
@@ -121,6 +101,5 @@
         } catch (XMLStreamException xe) {
             throw new Fault(new Message("XML_WRITE_EXC", BUNDLE), xe);
         }
-    }
-
+    }   
 }

Added: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java?view=auto&rev=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java
(added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java
Thu Oct 12 06:21:52 2006
@@ -0,0 +1,106 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.binding.soap.interceptor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.xpath.XPathConstants;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapFault;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.helpers.XMLUtils;
+import org.apache.cxf.helpers.XPathUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.staxutils.FragmentStreamReader;
+import org.apache.cxf.staxutils.StaxUtils;
+
+public class Soap12FaultInInterceptor extends AbstractSoapInterceptor {
+
+    public void handleMessage(SoapMessage message) throws Fault {
+        String exMessage = null;
+        QName faultCode = null;
+        QName subCode = null;
+        String role = null;
+        String node = null;
+        Element detail = null;
+
+        XMLStreamReader reader = message.getContent(XMLStreamReader.class);
+        Map<String, String> ns = new HashMap<String, String>();
+        ns.put("soap12", Soap12.SOAP_NAMESPACE);
+        XPathUtils xu = new XPathUtils(ns);        
+        
+        try {
+            Document fault = StaxUtils.read(new FragmentStreamReader(reader));
+            String faultCodeString = (String) xu.getValue("//soap12:Fault/Code/Value/text()",

+                                                        fault, 
+                                                        XPathConstants.STRING);
+            
+            faultCode = XMLUtils.getQName(faultCodeString, fault);
+            
+            String subCodeString = (String) xu.getValue("//soap12:Fault/Code/Subcode/Value/text()",

+                                                        fault,
+                                                        XPathConstants.STRING);
+            if (StringUtils.isEmpty(subCodeString)) {
+                subCode = XMLUtils.getQName(subCodeString, fault);
+            }
+            
+            exMessage = (String) xu.getValue("//soap12:Fault/Reason/Text/text()", 
+                                             fault,
+                                             XPathConstants.STRING);
+            
+            Node detailNode = (Node) xu.getValue("//soap12:Fault/Detail",
+                                                 fault,
+                                                 XPathConstants.NODE);
+            if (detailNode != null) {
+                detail = (Element) detailNode;
+            }
+            
+            role = (String) xu.getValue("//soap12:Fault/Role/text()", 
+                                        fault,
+                                        XPathConstants.STRING);
+
+            node = (String) xu.getValue("//soap12:Fault/Node/text()", 
+                                        fault,
+                                        XPathConstants.STRING);                       
+        } catch (XMLStreamException e) {
+            throw new SoapFault("Could not parse message.", 
+                                message.getVersion().getSender());
+        }
+
+        SoapFault fault = new SoapFault(exMessage, faultCode);
+        fault.setSubCode(subCode);
+        fault.setDetail(detail);
+        fault.setRole(role);
+        fault.setNode(node);
+
+        message.setContent(Exception.class, fault);
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultInInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java?view=auto&rev=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
(added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
Thu Oct 12 06:21:52 2006
@@ -0,0 +1,124 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.binding.soap.interceptor;
+
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import org.apache.cxf.binding.soap.SoapFault;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.common.i18n.BundleUtils;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.staxutils.StaxUtils;
+
+public class Soap12FaultOutInterceptor extends AbstractSoapInterceptor {
+    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(Soap12FaultOutInterceptor.class);
+
+    public Soap12FaultOutInterceptor() {
+        super();
+        setPhase(Phase.MARSHAL);
+    }
+
+    public void handleMessage(SoapMessage message) throws Fault {
+        XMLStreamWriter writer = message.getContent(XMLStreamWriter.class);
+        Fault f = (Fault)message.getContent(Exception.class);
+
+        SoapFault fault = SoapFault.createFault(f, message.getVersion());
+
+        try {
+            Map<String, String> namespaces = fault.getNamespaces();
+            for (Map.Entry<String, String> e : namespaces.entrySet()) {
+                writer.writeNamespace(e.getKey(), e.getValue());
+            }
+
+            String ns = message.getVersion().getNamespace();
+            String defaultPrefix = StaxUtils.getUniquePrefix(writer, ns, true);
+
+            writer.writeStartElement(defaultPrefix, "Fault", ns);
+
+            writer.writeStartElement("Code");
+            writer.writeStartElement("Value");
+       
+            writer.writeCharacters(fault.getCodeString(getFaultCodePrefix(writer, fault.getFaultCode()),

+                                                       defaultPrefix));
+            writer.writeEndElement();
+            
+            if (fault.getSubCode() != null) {
+                writer.writeStartElement("Subcode");
+                writer.writeCharacters(fault.getSubCodeString(getFaultCodePrefix(writer,
fault.getSubCode()), 
+                                                              defaultPrefix));          
     
+                writer.writeEndElement();
+            }
+            writer.writeEndElement();
+
+            writer.writeStartElement("Reason");
+            writer.writeStartElement("Text");
+            writer.writeAttribute("xml", "http://www.w3.org/XML/1998/namespace", "lang ",
getLangCode());
+            if (fault.getMessage() != null) {
+                writer.writeCharacters(fault.getMessage());
+            } else {
+                writer.writeCharacters("Fault occurred while processing.");
+            }
+            writer.writeEndElement();
+            writer.writeEndElement();
+
+            if (fault.hasDetails()) {
+                Element detail = fault.getDetail();
+                writer.writeStartElement("Detail");
+
+                NodeList details = detail.getChildNodes();
+                for (int i = 0; i < details.getLength(); i++) {
+                    StaxUtils.writeNode(details.item(i), writer, true);
+                }
+
+                // Details
+                writer.writeEndElement();
+            }
+
+            if (fault.getRole() != null) {
+                writer.writeStartElement("faultactor");
+                writer.writeCharacters(fault.getRole());
+                writer.writeEndElement();
+            }
+
+            // Fault
+            writer.writeEndElement();
+        } catch (XMLStreamException xe) {
+            throw new Fault(new Message("XML_WRITE_EXC", BUNDLE), xe);
+        }
+    }
+    
+    private String getLangCode() {        
+        String code = BUNDLE.getLocale().getDisplayLanguage();
+        if (StringUtils.isEmpty(code)) {
+            return "en";
+        }
+        return code;
+    }
+}

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Soap12FaultOutInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
Thu Oct 12 06:21:52 2006
@@ -62,10 +62,10 @@
     }
     
     public void handleMessage(SoapMessage message) {
+        SoapVersion soapVersion = message.getVersion();
         try {
             XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class);
-            message.setContent(XMLStreamWriter.class, xtw);
-            SoapVersion soapVersion = message.getVersion();
+            message.setContent(XMLStreamWriter.class, xtw);            
             
             xtw.setPrefix(soapVersion.getPrefix(), soapVersion.getNamespace());
             xtw.writeStartElement(soapVersion.getPrefix(), 
@@ -97,7 +97,7 @@
             
         } catch (XMLStreamException e) {
             throw new SoapFault(
-                new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE), e, SoapFault.SENDER);
+                new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE), e, soapVersion.getSender());
         }
     }
     
@@ -154,7 +154,7 @@
                         } catch (XMLStreamException e) {
                             throw new SoapFault(
                                 new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE),

-                                e, SoapFault.SENDER);
+                                e, soapVersion.getSender());
                         }
                         
                         startedHeader = true;
@@ -171,7 +171,7 @@
                 } catch (XMLStreamException e) {
                     throw new SoapFault(
                         new org.apache.cxf.common.i18n.Message("XML_WRITE_EXC", BUNDLE),

-                        e, SoapFault.SENDER);
+                        e, soapVersion.getSender());
                 }
             }
         }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
Thu Oct 12 06:21:52 2006
@@ -92,7 +92,7 @@
         if (ie == null) {
             fail("InBound Exception Missing! Exception should be Can't understands QNames:
" + PASSENGER);
         } else {
-            assertEquals(SoapFault.MUST_UNDERSTAND, ie.getFaultCode());
+            assertEquals(soapMessage.getVersion().getMustUnderstand(), ie.getFaultCode());
             assertEquals("Can not understand QNames: " + PASSENGER, ie.getMessage().toString());
         }
     }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
Thu Oct 12 06:21:52 2006
@@ -22,11 +22,14 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 
+import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
 import org.w3c.dom.Document;
 
+import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.binding.soap.Soap12;
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.helpers.DOMUtils;
@@ -37,7 +40,7 @@
 public class SoapFaultSerializerTest extends AbstractCXFTest {
     public void testSoap11Out() throws Exception {
         String faultString = "Hadrian caused this Fault!";
-        SoapFault fault = new SoapFault(faultString, SoapFault.SENDER);
+        SoapFault fault = new SoapFault(faultString, Soap11.getInstance().getSender());
 
         SoapMessage m = new SoapMessage(new MessageImpl());
         m.setContent(Exception.class, fault);
@@ -71,6 +74,54 @@
         SoapFault fault2 = (SoapFault)m.getContent(Exception.class);
         assertNotNull(fault2);
         assertEquals(fault.getMessage(), fault2.getMessage());
-        assertEquals(SoapFault.SOAP11_CLIENT, fault2.getFaultCode());
+        assertEquals(Soap11.getInstance().getSender(), fault2.getFaultCode());
     }
+    
+    public void testSoap12Out() throws Exception {
+        String faultString = "Hadrian caused this Fault!";
+        SoapFault fault = new SoapFault(faultString, Soap12.getInstance().getSender());
+        
+        QName qname = new QName("http://cxf.apache.org/soap/fault", "invalidsoap", "cxffaultcode");
+        fault.setSubCode(qname);
+
+        SoapMessage m = new SoapMessage(new MessageImpl());
+        m.setVersion(Soap12.getInstance());
+        
+        m.setContent(Exception.class, fault);
+
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(out);
+        writer.writeStartDocument();
+        writer.writeStartElement("Body");
+
+        m.setContent(XMLStreamWriter.class, writer);
+
+        Soap12FaultOutInterceptor interceptor = new Soap12FaultOutInterceptor();
+        interceptor.handleMessage(m);
+
+        writer.writeEndElement();
+        writer.writeEndDocument();
+        writer.close();
+
+        Document faultDoc = DOMUtils.readXml(new ByteArrayInputStream(out.toByteArray()));
+        
+        assertValid("//soap12env:Fault/Code/Value[text()='ns1:Sender']", faultDoc);
+        assertValid("//soap12env:Fault/Code/Subcode[text()='ns2:invalidsoap']", faultDoc);
+        assertValid("//soap12env:Fault/Reason/Text[@xml:lang='en']", faultDoc);
+        assertValid("//soap12env:Fault/Reason/Text[text()='" + faultString + "']", faultDoc);
+
+        XMLStreamReader reader = StaxUtils.createXMLStreamReader(new ByteArrayInputStream(out.toByteArray()));
+        m.setContent(XMLStreamReader.class, reader);
+
+        reader.nextTag();
+
+        Soap12FaultInInterceptor inInterceptor = new Soap12FaultInInterceptor();
+        inInterceptor.handleMessage(m);
+
+        SoapFault fault2 = (SoapFault)m.getContent(Exception.class);
+        assertNotNull(fault2);
+        assertEquals(fault.getMessage(), fault2.getMessage());
+        assertEquals(Soap12.getInstance().getSender(), fault2.getFaultCode());
+    }
+    
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/test/AbstractCXFTest.java Thu
Oct 12 06:21:52 2006
@@ -71,7 +71,8 @@
         addNamespace("wsdl", "http://schemas.xmlsoap.org/wsdl/");
         addNamespace("wsdlsoap", "http://schemas.xmlsoap.org/wsdl/soap/");
         addNamespace("soap", "http://schemas.xmlsoap.org/soap/");
-        
+        addNamespace("soap12env", "http://www.w3.org/2003/05/soap-envelope");        
+        addNamespace("xml", "http://www.w3.org/XML/1998/namespace");
     }
     
     public Bus getBus() {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java?view=diff&rev=463242&r1=463241&r2=463242
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
Thu Oct 12 06:21:52 2006
@@ -100,7 +100,7 @@
         }
 
         public void handleMessage(SoapMessage message) throws Fault {
-            throw new SoapFault("I blame Hadrian.", SoapFault.SENDER);
+            throw new SoapFault("I blame Hadrian.", message.getVersion().getSender());
         }
 
     }



Mime
View raw message