axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r436640 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: context/ description/ engine/ util/
Date Fri, 25 Aug 2006 04:22:53 GMT
Author: deepal
Date: Thu Aug 24 21:22:51 2006
New Revision: 436640

URL: http://svn.apache.org/viewvc?rev=436640&view=rev
Log:
- added AxisMessgage into message context
- Fixing AXIS2-1059

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutOnlyAxisOperation.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java?rev=436640&r1=436639&r2=436640&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
Thu Aug 24 21:22:51 2006
@@ -25,16 +25,9 @@
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.client.Options;
-import org.apache.axis2.description.AxisModule;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.description.ModuleConfiguration;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.description.TransportInDescription;
-import org.apache.axis2.description.TransportOutDescription;
+import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.ws.policy.Policy;
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
@@ -71,7 +64,6 @@
 
     /**
      * Field CHARACTER_SET_ENCODING
-     * @deprecated please use org.apache.axis2.Constants.Configuration.CHARACTER_SET_ENCODING
      */
     public static final String CHARACTER_SET_ENCODING = "CHARACTER_SET_ENCODING";
 
@@ -136,6 +128,8 @@
     // Are we doing MTOM now?
     private boolean doingMTOM;
 
+    private transient AxisMessage axisMessage;
+
     private transient AxisOperation axisOperation;
 
     private transient AxisService axisService;
@@ -676,13 +670,21 @@
         return serverSide;
     }
 
+    public AxisMessage getAxisMessage() {
+        return axisMessage;
+    }
+
+    public void setAxisMessage(AxisMessage axisMessage) {
+        this.axisMessage = axisMessage;
+    }
+
     public void setAxisOperation(AxisOperation axisOperation) {
         this.axisOperation = axisOperation;
     }
 
     public void setAxisService(AxisService axisService) {
         this.axisService = axisService;
-        this.axisServiceGroup = (AxisServiceGroup)this.axisService.getParent();
+        this.axisServiceGroup = (AxisServiceGroup) this.axisService.getParent();
     }
 
     public void setAxisServiceGroup(AxisServiceGroup axisServiceGroup) {
@@ -955,6 +957,21 @@
     public void setRelationships(RelatesTo[] list) {
         options.setRelationships(list);
     }
+
+
+    public Policy getEffectivePolicy() {
+        if (axisMessage != null) {
+            return axisMessage.getPolicyInclude().getEffectivePolicy();
+        }
+        if (axisOperation != null) {
+            return axisOperation.getPolicyInclude().getEffectivePolicy();
+        }
+        if (axisService != null) {
+            return axisService.getPolicyInclude().getEffectivePolicy();
+        }
+        return configurationContext.getAxisConfiguration().getPolicyInclude().getEffectivePolicy();
+    }
+
 
     public boolean isEngaged(QName moduleName) {
         boolean enegage;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java?rev=436640&r1=436639&r2=436640&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java
Thu Aug 24 21:22:51 2006
@@ -226,12 +226,13 @@
         if (mc == null) {
             throw new AxisFault(Messages.getMessage("outmsgctxnull"));
         }
-
+        //setting AxisMessage
+        mc.setAxisMessage(axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE));
         mc.setOptions(options);
-        
+
         // do Target Resolution
         cc.getAxisConfiguration().getTargetResolverChain().resolveTarget(mc);
-        
+
         // if the transport to use for sending is not specified, try to find it
         // from the URL
         TransportOutDescription transportOut = options.getTransportOut();
@@ -278,7 +279,7 @@
             AxisEngine engine = new AxisEngine(cc);
             mc.getConfigurationContext().registerOperationContext(mc.getMessageID(), oc);
             engine.send(mc);
-            
+
             // Options object reused so soapAction needs to be removed so
             // that soapAction+wsa:Action on response don't conflict
             options.setAction("");
@@ -332,11 +333,11 @@
     }
 
     /**
+     * @return Returns MessageContext.
+     * @throws AxisFault
      * Sends the message using a two way transport and waits for a response
      *
      * @param msgctx
-     * @return Returns MessageContext.
-     * @throws AxisFault
      */
     protected MessageContext send(MessageContext msgctx) throws AxisFault {
 
@@ -352,6 +353,9 @@
         responseMessageContext.setServerSide(false);
         responseMessageContext.setMessageID(msgctx.getMessageID());
         addMessageContext(responseMessageContext);
+        responseMessageContext.setServiceContext(msgctx.getServiceContext());
+        responseMessageContext.setAxisMessage(
+                axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
 
         //sending the message
         engine.send(msgctx);
@@ -365,7 +369,7 @@
         // Options object reused above so soapAction needs to be removed so
         // that soapAction+wsa:Action on response don't conflict
         responseMessageContext.setSoapAction("");
-        
+
         if (responseMessageContext.getEnvelope() == null) {
             // If request is REST we assume the responseMessageContext is REST, so
             // set the variable

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutOnlyAxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutOnlyAxisOperation.java?rev=436640&r1=436639&r2=436640&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutOnlyAxisOperation.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutOnlyAxisOperation.java
Thu Aug 24 21:22:51 2006
@@ -318,13 +318,14 @@
             throw new AxisFault(Messages.getMessage("mepiscomplted"));
         }
         ConfigurationContext cc = sc.getConfigurationContext();
-        
+
         // set options on the message context
         mc.setOptions(options);
-        
+        mc.setAxisMessage(axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE));
+
         // do Target Resolution
         cc.getAxisConfiguration().getTargetResolverChain().resolveTarget(mc);
-        
+
         // setting messge ID if it null
         // if the transport to use for sending is not specified, try to find it
         // from the URL

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java?rev=436640&r1=436639&r2=436640&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java
Thu Aug 24 21:22:51 2006
@@ -25,6 +25,7 @@
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.transport.TransportUtils;
+import org.apache.axis2.wsdl.WSDLConstants;
 
 import javax.xml.namespace.QName;
 import java.io.InputStream;
@@ -63,6 +64,9 @@
             responseMessageContext.setServerSide(false);
             responseMessageContext.setMessageID(msgctx.getMessageID());
             addMessageContext(responseMessageContext);
+            responseMessageContext.setServiceContext(msgctx.getServiceContext());
+            responseMessageContext.setAxisMessage(
+                    msgctx.getAxisOperation().getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
 
             //sending the message
             engine.send(msgctx);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java?rev=436640&r1=436639&r2=436640&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
Thu Aug 24 21:22:51 2006
@@ -24,6 +24,7 @@
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -42,7 +43,7 @@
      * Field NAME
      */
     public static final QName NAME = new QName("http://ws.apache.org/axis2/", "AbstractDispatcher");
-	private static final Log log = LogFactory.getLog(AbstractDispatcher.class);
+    private static final Log log = LogFactory.getLog(AbstractDispatcher.class);
 
     public AbstractDispatcher() {
         init(new HandlerDescription(NAME));
@@ -99,6 +100,9 @@
                 }
 
                 msgctx.setAxisOperation(axisOperation);
+                //setting axisMessage into messageContext
+                msgctx.setAxisMessage(axisOperation.getMessage(
+                        WSDLConstants.MESSAGE_LABEL_IN_VALUE));
             }
         }
     }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java?rev=436640&r1=436639&r2=436640&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java Thu Aug
24 21:22:51 2006
@@ -67,11 +67,11 @@
 
         newmsgCtx.setMessageID(UUIDGenerator.getUUID());
         newmsgCtx.setTo(oldOptions.getReplyTo());
-        
+
         // do Target Resolution
         newmsgCtx.getConfigurationContext().getAxisConfiguration().getTargetResolverChain().resolveTarget(newmsgCtx);
 
-        
+
         newmsgCtx.getOptions().setAction(oldOptions.getAction());
 
         // add the service group id as a reference parameter
@@ -85,14 +85,14 @@
 
         newmsgCtx.setFaultTo(oldOptions.getTo());
         newmsgCtx.addRelatesTo(new RelatesTo(oldOptions.getMessageId())); //Uses the default
relationship type
-                
+
         AxisOperation ao = inMessageContext.getAxisOperation();
-        if(ao!=null && ao.getOutputAction()!=null){
-           newmsgCtx.setWSAAction(ao.getOutputAction());
-        }else{
-           newmsgCtx.setWSAAction(oldOptions.getAction());
+        if (ao.getOutputAction() != null) {
+            newmsgCtx.setWSAAction(ao.getOutputAction());
+        } else {
+            newmsgCtx.setWSAAction(oldOptions.getAction());
         }
-        
+        newmsgCtx.setAxisMessage(ao.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE));
         newmsgCtx.setOperationContext(inMessageContext.getOperationContext());
         newmsgCtx.setServiceContext(inMessageContext.getServiceContext());
         newmsgCtx.setProperty(MessageContext.TRANSPORT_OUT,



---------------------------------------------------------------------
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