You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2007/01/15 17:32:47 UTC

svn commit: r496393 - in /webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing: MessageHeaders.java WsaConstants.java

Author: danj
Date: Mon Jan 15 08:32:46 2007
New Revision: 496393

URL: http://svn.apache.org/viewvc?view=rev&rev=496393
Log:
I have made the WS-A 1.0 faults that are thrown in muse-core more standards compliant - they now have all of 
the proper codes and sub-codes filled in, as well as the optional 'detail' section when appropriate. it was 
easier to just fill in the values using the SoapFault API than to create WSA fault classes - it would not 
have saved us any lines of code.

Modified:
    webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/MessageHeaders.java
    webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/WsaConstants.java

Modified: webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/MessageHeaders.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/MessageHeaders.java?view=diff&rev=496393&r1=496392&r2=496393
==============================================================================
--- webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/MessageHeaders.java (original)
+++ webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/MessageHeaders.java Mon Jan 15 08:32:46 2007
@@ -128,13 +128,13 @@
         if (toURI == null)
         {
             Object[] filler = { WsaConstants.TO_QNAME };
-            throw new SoapFault(_MESSAGES.get("HeaderMissing", filler));
+            throwInvalidAddressingHeaderFault(_MESSAGES.get("HeaderMissing", filler));
         }
         
         if (_action == null)
         {
             Object[] filler = { WsaConstants.ACTION_QNAME };
-            throw new SoapFault(_MESSAGES.get("HeaderMissing", filler));
+            throwInvalidAddressingHeaderFault(_MESSAGES.get("HeaderMissing", filler));
         }
         
         //
@@ -150,7 +150,7 @@
         _replyTo = getEPR(soapHeaders, WsaConstants.REPLY_TO_QNAME);
         
         if (_messageID == null && (_from != null || _replyTo != null))
-            throw new SoapFault(_MESSAGES.get("MessageIDMissing"));
+            throwInvalidAddressingHeaderFault(_MESSAGES.get("MessageIDMissing"));
         
         Element[] children = XmlUtils.getAllElements(soapHeaders);
         
@@ -592,6 +592,15 @@
             throw new NullPointerException(_MESSAGES.get("NullToEPR"));
         
         _to = to;
+    }
+    
+    protected void throwInvalidAddressingHeaderFault(String message)
+        throws SoapFault
+    {
+        SoapFault fault = new SoapFault(message);
+        fault.setCode(SoapConstants.SENDER_QNAME);
+        fault.setSubCode(WsaConstants.INVALID_HEADER_FAULT_QNAME);
+        throw fault;
     }
     
     /**

Modified: webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/WsaConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/WsaConstants.java?view=diff&rev=496393&r1=496392&r2=496393
==============================================================================
--- webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/WsaConstants.java (original)
+++ webservices/muse/trunk/modules/muse-wsa-soap/src/org/apache/muse/ws/addressing/WsaConstants.java Mon Jan 15 08:32:46 2007
@@ -62,11 +62,13 @@
     public static final QName ADDRESS_QNAME = 
         new QName(NAMESPACE_URI, "Address", PREFIX);
     
-    //
-    // This is the default identifier used for the implied resource pattern. 
-    // This is preferred to something like MUWS P1 ResourceId because it is 
-    // generic to all resource types.
-    //
+    /**
+     * 
+     * The default identifier used for the implied resource pattern. This is 
+     * preferred to something like MUWS P1 ResourceId because it is generic 
+     * to all resource types.
+     * 
+     */
     public static final QName DEFAULT_RESOURCE_ID_QNAME = 
         new QName(MUSE_ADDRESSING_URI, "ResourceId", MUSE_ADDRESSING_PREFIX);    
     
@@ -136,6 +138,18 @@
     
     public static final QName TO_QNAME = 
         new QName(NAMESPACE_URI, "To", PREFIX);
+    
+    public static final QName DESTINATION_UNREACHABLE_FAULT_QNAME = 
+        new QName(NAMESPACE_URI, "DestinationUnreachable", PREFIX);
+    
+    public static final QName ACTION_NOT_SUPPORTED_FAULT_QNAME = 
+        new QName(NAMESPACE_URI, "ActionNotSupported", PREFIX);
+    
+    public static final QName PROBLEM_ACTION_QNAME = 
+        new QName(NAMESPACE_URI, "ProblemAction", PREFIX);
+    
+    public static final QName INVALID_HEADER_FAULT_QNAME = 
+        new QName(NAMESPACE_URI, "InvalidAddressingHeader", PREFIX);
     
     /**
      * 



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org