axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r415245 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: description/OutInAxisOperation.java engine/AxisEngine.java
Date Mon, 19 Jun 2006 05:05:54 GMT
Author: deepal
Date: Sun Jun 18 22:05:54 2006
New Revision: 415245

URL: http://svn.apache.org/viewvc?rev=415245&view=rev
Log:
- minor modification 

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java?rev=415245&r1=415244&r2=415245&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutInAxisOperation.java
Sun Jun 18 22:05:54 2006
@@ -327,42 +327,44 @@
 
         AxisEngine engine = new AxisEngine(msgctx.getConfigurationContext());
 
-        engine.send(msgctx);
-
         // create the responseMessageContext
         MessageContext responseMessageContext = new MessageContext();
-        responseMessageContext.setTransportIn(msgctx.getTransportIn());
-        responseMessageContext.setTransportOut(msgctx.getTransportOut());
 
         // This is a hack - Needs to change
         responseMessageContext.setOptions(options);
 
 
-        responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgctx
-                .getProperty(MessageContext.TRANSPORT_IN));
         responseMessageContext.setServerSide(false);
         responseMessageContext.setDoingREST(msgctx.isDoingREST());
         addMessageContext(responseMessageContext);
 
-        // If request is REST we assume the responseMessageContext is REST, so
-        // set the variable
+        //sending the message
+        engine.send(msgctx);
 
+        responseMessageContext.setProperty(MessageContext.TRANSPORT_IN, msgctx
+                .getProperty(MessageContext.TRANSPORT_IN));
+        responseMessageContext.setTransportIn(msgctx.getTransportIn());
+        responseMessageContext.setTransportOut(msgctx.getTransportOut());
 
-        SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(
-                responseMessageContext, msgctx.getEnvelope().getNamespace()
-                .getName());
-        if (resenvelope != null) {
-            responseMessageContext.setEnvelope(resenvelope);
-            engine = new AxisEngine(msgctx.getConfigurationContext());
-            engine.receive(responseMessageContext);
-            if (responseMessageContext.getReplyTo() != null) {
-                sc.setTargetEPR(responseMessageContext.getReplyTo());
+        if (responseMessageContext.getEnvelope() == null) {
+            // If request is REST we assume the responseMessageContext is REST, so
+            // set the variable
+
+            SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(
+                    responseMessageContext, msgctx.getEnvelope().getNamespace()
+                    .getName());
+            if (resenvelope != null) {
+                responseMessageContext.setEnvelope(resenvelope);
+                engine = new AxisEngine(msgctx.getConfigurationContext());
+                engine.receive(responseMessageContext);
+                if (responseMessageContext.getReplyTo() != null) {
+                    sc.setTargetEPR(responseMessageContext.getReplyTo());
+                }
+            } else {
+                throw new AxisFault(Messages
+                        .getMessage("blockingInvocationExpectsResponse"));
             }
-        } else {
-            throw new AxisFault(Messages
-                    .getMessage("blockingInvocationExpectsResponse"));
         }
-
         return responseMessageContext;
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java?rev=415245&r1=415244&r2=415245&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
Sun Jun 18 22:05:54 2006
@@ -53,7 +53,7 @@
     /**
      * Field log
      */
-	private static final Log log = LogFactory.getLog(AxisEngine.class);
+    private static final Log log = LogFactory.getLog(AxisEngine.class);
     private ConfigurationContext engineContext;
 
     /**
@@ -64,7 +64,7 @@
     }
 
     private void checkMustUnderstand(MessageContext msgContext) throws AxisFault {
-        if(!msgContext.isHeaderPresent()) {
+        if (!msgContext.isHeaderPresent()) {
             return;
         }
         SOAPEnvelope se = msgContext.getEnvelope();
@@ -126,24 +126,24 @@
      * WSDL that WS-Addressing headers were found on the inbound message
      */
     private void checkUsingAddressing(MessageContext msgContext)
-			throws AxisFault {
-		String addressingFlag = msgContext.getAxisService().getWSAddressingFlag();
-		if(log.isTraceEnabled())
-			log.trace("checkUsingAddressing: WSAddressingFlag="+ addressingFlag);
-		if (AddressingConstants.ADDRESSING_REQUIRED.equals(addressingFlag)) {
-			Object flag = msgContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
-			if(log.isTraceEnabled())
-				log.trace("checkUsingAddressing: WS_ADDRESSING_VERSION=" + flag);
-			if (flag == null) {
-				String message = Messages.getMessage("wsaddressingrequirednotpresent");
-				AxisFault af = new AxisFault(message);
-				af.printStackTrace();
-				log.debug(message, af);
-				throw af;
-			}
-		}
+            throws AxisFault {
+        String addressingFlag = msgContext.getAxisService().getWSAddressingFlag();
+        if (log.isTraceEnabled())
+            log.trace("checkUsingAddressing: WSAddressingFlag=" + addressingFlag);
+        if (AddressingConstants.ADDRESSING_REQUIRED.equals(addressingFlag)) {
+            Object flag = msgContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
+            if (log.isTraceEnabled())
+                log.trace("checkUsingAddressing: WS_ADDRESSING_VERSION=" + flag);
+            if (flag == null) {
+                String message = Messages.getMessage("wsaddressingrequirednotpresent");
+                AxisFault af = new AxisFault(message);
+                af.printStackTrace();
+                log.debug(message, af);
+                throw af;
+            }
+        }
     }
-    
+
     /**
      * This method is called to handle any error that occurs at inflow or outflow. But if
the
      * method is called twice, it implies that sending the error handling has failed, in
which case
@@ -473,7 +473,7 @@
 
             // invoke the Message Receivers
             checkMustUnderstand(msgContext);
-            
+
             checkUsingAddressing(msgContext);
 
             MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver();
@@ -490,7 +490,7 @@
      * @param msgContext
      * @throws AxisFault
      */
-    public void invoke(MessageContext   msgContext) throws AxisFault {
+    public void invoke(MessageContext msgContext) throws AxisFault {
         if (msgContext.getCurrentHandlerIndex() == -1) {
             msgContext.setCurrentHandlerIndex(0);
         }
@@ -531,7 +531,7 @@
      *
      * @param msgContext
      */
-    public void resumeSend(MessageContext   msgContext) throws AxisFault {
+    public void resumeSend(MessageContext msgContext) throws AxisFault {
         //invoke the phases
         invoke(msgContext);
         //Invoking Tarnsport Sender
@@ -584,7 +584,7 @@
      * @see Phase
      * @see Handler
      */
-    public void send(MessageContext  msgContext) throws AxisFault {
+    public void send(MessageContext msgContext) throws AxisFault {
 
         // find and invoke the Phases
         OperationContext operationContext = msgContext.getOperationContext();
@@ -624,7 +624,7 @@
      * @param msgContext
      * @throws AxisFault
      */
-    public void sendFault(MessageContext  msgContext) throws AxisFault {
+    public void sendFault(MessageContext msgContext) throws AxisFault {
         OperationContext opContext = msgContext.getOperationContext();
 
         // find and execute the Fault Out Flow Handlers
@@ -651,7 +651,7 @@
         }
     }
 
-    private String getSenderFaultCode(OMNamespace  soapNamespace) {
+    private String getSenderFaultCode(OMNamespace soapNamespace) {
         return SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapNamespace.getName())
                 ? SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX + ":"
                 + SOAP12Constants.FAULT_CODE_SENDER
@@ -666,6 +666,7 @@
     private class TransportNonBlockingInvocationWorker implements Runnable {
         private MessageContext msgctx;
         private TransportSender sender;
+        private boolean done;
 
         public TransportNonBlockingInvocationWorker(MessageContext msgctx,
                                                     TransportSender sender) {
@@ -675,7 +676,10 @@
 
         public void run() {
             try {
-                sender.invoke(msgctx);
+                while (!done) {
+                    sender.invoke(msgctx);
+                    done = true;
+                }
             } catch (Exception e) {
                 log.info(e.getMessage());
             }



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


Mime
View raw message