You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ng...@apache.org on 2006/11/02 20:51:55 UTC

svn commit: r470491 - in /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws: client/BaseDispatch.java core/controller/AxisInvocationController.java util/Constants.java

Author: ngallardo
Date: Thu Nov  2 11:51:54 2006
New Revision: 470491

URL: http://svn.apache.org/viewvc?view=rev&rev=470491
Log:
-Adding on to Mike's patch, fixing the NPE in the Dispatch.
-A temporary fix for the async listener not being setup.  The real fix will come in AXIS2-978.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java?view=diff&rev=470491&r1=470490&r2=470491
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/client/BaseDispatch.java Thu Nov  2 11:51:54 2006
@@ -131,6 +131,10 @@
                 XMLFault fault = responseMsg.getXMLFault();
                 throw ExceptionFactory.makeWebServiceException(fault.getReason().getText());
             }
+            else if (responseMsg.getLocalException() != null) {
+                // use the factory, it'll throw the right thing:
+                throw ExceptionFactory.makeWebServiceException(responseMsg.getLocalException());
+            }
         } catch (MessageException e) {
             throw ExceptionFactory.makeWebServiceException(e);
         }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java?view=diff&rev=470491&r1=470490&r2=470491
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java Thu Nov  2 11:51:54 2006
@@ -233,8 +233,17 @@
         Boolean useAsyncMep = (Boolean) request.getProperties().get(Constants.USE_ASYNC_MEP);
         if((useAsyncMep != null && useAsyncMep.booleanValue()) 
                 || opClient.getOptions().isUseSeparateListener()) {
+            if (log.isDebugEnabled()) {
+                log.debug("Enabling asynchronous message exchange.  An asynchronous listener will be establish.");
+            }
+
             opClient.getOptions().setUseSeparateListener(true);
             opClient.getOptions().setTransportInProtocol("http");
+
+            //FIXME: This has to be here so the ThreadContextMigrator can pick it up.
+            //This should go away once AXIS2-978 is fixed.
+            axisRequestMsgCtx.getOptions().setUseSeparateListener(true);
+            
             // Setup the response callback receiver to receive the async response
             // This logic is based on org.apache.axis2.client.ServiceClient.sendReceiveNonBlocking(...)
             AxisOperation op = opClient.getOperationContext().getAxisOperation();
@@ -242,6 +251,12 @@
             if (messageReceiver == null || !(messageReceiver instanceof CallbackReceiver))
                 op.setMessageReceiver(new CallbackReceiver());
         }
+        else {
+            if (log.isDebugEnabled()) {
+                log.debug("Asynchronous message exchange not enabled.  The invocation will be synchronous.");
+            }
+        }
+
         
         // There should be an AsyncListener that is configured and set on the
         // InvocationContext.  We must get this and use it to wait for the 
@@ -368,7 +383,10 @@
     }
     
     private void initOperationClient(OperationClient opClient, MessageContext requestMsgCtx) {
-        setupProperties(requestMsgCtx, opClient.getOptions());
+        org.apache.axis2.context.MessageContext axisRequest = requestMsgCtx.getAxisMessageContext();
+        
+        Options options = opClient.getOptions();
+        setupProperties(requestMsgCtx, options);
         
         if (opClient != null) {
             // Get the target endpoint address and setup the TO endpoint 
@@ -376,27 +394,24 @@
             String targetUrl = (String) requestMsgCtx.getProperties().get(
                     BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
             EndpointReference toEPR = new EndpointReference(targetUrl);
-            opClient.getOptions().setTo(toEPR);
+            options.setTo(toEPR);
             
             // Get the SOAP Action (if needed)
             String soapAction = configureSOAPAction(requestMsgCtx);
-            opClient.getOptions().setAction(soapAction);
+            options.setAction(soapAction);
             
             // Use the OperationClient to send the request and put the contents
             // of the response in the response MessageContext.
             try {
-                //setupRequestMessageContext(requestMsgCtx);
-                org.apache.axis2.context.MessageContext axisRequestMsgCtx = requestMsgCtx.getAxisMessageContext();
-
                 // Setting the ServiceContext will create the association between 
                 // the OperationClient it's MessageContexts and the 
                 // AxisService/AxisOperation that they are tied to.
                 OperationContext opContext = opClient.getOperationContext();
                 ServiceContext svcContext = opContext.getServiceContext();
-                axisRequestMsgCtx.setServiceContext(svcContext);
+                axisRequest.setServiceContext(svcContext);
                 
                 // Set the Axis2 request MessageContext
-                opClient.addMessageContext(axisRequestMsgCtx);
+                opClient.addMessageContext(axisRequest);
             }
             catch (Exception e) {
                 //TODO: Do something

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java?view=diff&rev=470491&r1=470490&r2=470491
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/util/Constants.java Thu Nov  2 11:51:54 2006
@@ -34,9 +34,9 @@
     
     public static final String SCHEMA = "http://www.w3.org/2001/XMLSchema";
     
-    public static final String AXIS2_REPO_PATH = "org.apache.axis2.jaxws.repo.path";
-    public static final String AXIS2_CONFIG_PATH = "org.apache.axis2.jaxws.config.path";
-    public static final String USE_ASYNC_MEP = "org.apache.axis2.jaxws.use.async.mep";
+    public static String AXIS2_REPO_PATH = "org.apache.axis2.jaxws.repo.path";
+    public static String AXIS2_CONFIG_PATH = "org.apache.axis2.jaxws.config.path";
+    public static String USE_ASYNC_MEP = "org.apache.axis2.jaxws.use.async.mep";
     
     public static final String THREAD_CONTEXT_MIGRATOR_LIST_ID = "JAXWS-ThreadContextMigrator-List";
 }



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