You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2008/03/14 16:51:37 UTC

svn commit: r637136 - in /webservices/axis2/trunk/java/modules: jaxws-integration/test/org/apache/axis2/jaxws/dispatch/ jaxws/src/org/apache/axis2/jaxws/handler/ jaxws/src/org/apache/axis2/jaxws/server/ kernel/src/org/apache/axis2/i18n/

Author: dims
Date: Fri Mar 14 08:51:35 2008
New Revision: 637136

URL: http://svn.apache.org/viewvc?rev=637136&view=rev
Log:
Fix for AXIS2-3606 - New MustUnderstand code results in JAXWS Integration test failure : Let the AxisFault trickle back and don't wrap it in a WebServiceException

Modified:
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/handler/HandlerUtils.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java?rev=637136&r1=637135&r2=637136&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java Fri Mar 14 08:51:35 2008
@@ -205,7 +205,7 @@
     /**
      * Test sending a SOAP 1.2 request in MESSAGE mode
      */
-    public void _testSOAP12DispatchMessageMode_MustUnderstand() throws Exception {
+    public void testSOAP12DispatchMessageMode_MustUnderstand() throws Exception {
         // Create the JAX-WS client needed to send the request
         Service service = Service.create(QNAME_SERVICE);
         service.addPort(QNAME_PORT, SOAPBinding.SOAP12HTTP_BINDING, URL_ENDPOINT);

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/handler/HandlerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/handler/HandlerUtils.java?rev=637136&r1=637135&r2=637136&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/handler/HandlerUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/handler/HandlerUtils.java Fri Mar 14 08:51:35 2008
@@ -115,7 +115,8 @@
             for(int i=0; i<qNames.length; i++){
                 headerNames[i] ="{" + qNames[i].getNamespaceURI()+ "}" + qNames[i].getLocalPart();
             }
-            throw new AxisFault(Messages.getMessage("mustunderstandfailed", headerNames)); 
+            QName faultQName = envelope.getVersion().getMustUnderstandFaultCode();
+            throw new AxisFault(Messages.getMessage("mustunderstandfailed2", headerNames), faultQName); 
         }
 
         checkUnprocessed(envelope, unprocessed, understood, msgContext);

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java?rev=637136&r1=637135&r2=637136&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java Fri Mar 14 08:51:35 2008
@@ -19,23 +19,16 @@
 package org.apache.axis2.jaxws.server;
 
 import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axiom.soap.RolePlayer;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.java.security.AccessController;
 import org.apache.axis2.jaxws.ExceptionFactory;
-import org.apache.axis2.jaxws.addressing.util.EndpointKey;
-import org.apache.axis2.jaxws.addressing.util.EndpointContextMap;
-import org.apache.axis2.jaxws.addressing.util.EndpointContextMapManager;
 import org.apache.axis2.jaxws.core.MessageContext;
 import org.apache.axis2.jaxws.core.util.MessageContextUtils;
-import org.apache.axis2.jaxws.description.DescriptionFactory;
 import org.apache.axis2.jaxws.description.EndpointDescription;
-import org.apache.axis2.jaxws.description.ServiceDescription;
 import org.apache.axis2.jaxws.handler.HandlerChainProcessor;
 import org.apache.axis2.jaxws.handler.HandlerInvocationContext;
 import org.apache.axis2.jaxws.handler.HandlerInvoker;
@@ -61,11 +54,9 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.ws.WebServiceException;
 import javax.xml.ws.handler.Handler;
-
 import java.io.StringReader;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
@@ -92,7 +83,7 @@
      * @param eic
      * @return
      */
-    public EndpointInvocationContext invoke(EndpointInvocationContext eic) {
+    public EndpointInvocationContext invoke(EndpointInvocationContext eic) throws AxisFault, WebServiceException {
         if (log.isDebugEnabled()) {
             log.debug("Invocation pattern: synchronous");
         }
@@ -113,6 +104,8 @@
             else {
                 throw ExceptionFactory.makeWebServiceException(Messages.getMessage("invokeErr"));
             }
+        } catch (AxisFault af) {
+            throw af;
         } catch (Exception e) {
             Throwable toBeThrown = InvocationHelper.determineMappedException(e, eic);
             if(toBeThrown == null) {
@@ -196,7 +189,7 @@
         return;
     }
     
-    protected boolean handleRequest(EndpointInvocationContext eic) {
+    protected boolean handleRequest(EndpointInvocationContext eic) throws AxisFault, WebServiceException {
         
 
 
@@ -285,6 +278,8 @@
                 responseReady(eic);
                 return false;
             }
+        } catch (AxisFault af) {
+            throw af;
         } catch (Exception e) {
             // TODO for now, throw it.  We probably should try to make an XMLFault object and set it on the message
             throw ExceptionFactory.makeWebServiceException(e);

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java?rev=637136&r1=637135&r2=637136&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java Fri Mar 14 08:51:35 2008
@@ -201,6 +201,8 @@
                 }
             }
 
+        } catch (AxisFault af) {
+            throw af;
         } catch (Exception e) {
             ThreadContextMigratorUtil.performThreadCleanup(
                     Constants.THREAD_CONTEXT_MIGRATOR_LIST_ID, axisRequestMsgCtx);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties?rev=637136&r1=637135&r2=637136&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties Fri Mar 14 08:51:35 2008
@@ -263,6 +263,7 @@
 servicenamenotvalid=The {0} service name in not valid.
 enginestarted=The Axis engine started.
 mustunderstandfailed=Must Understand check failed for header {0} : {1}
+mustunderstandfailed2=Must Understand check failed for headers: {0}
 receivederrormessage=The system received an error message with the {0} ID. 
 servicenotfoundforepr=The service cannot be found for the endpoint reference (EPR) {0}
 operationnotfoundforepr=The endpoint reference (EPR) for the Operation not found is {0} and the WSA Action = {1}



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