axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/handlers/soap SOAPService.java
Date Mon, 02 Sep 2002 00:13:21 GMT
dims        2002/09/01 17:13:21

  Modified:    java/src/org/apache/axis/providers/java JavaProvider.java
               java/src/org/apache/axis/handlers/soap SOAPService.java
  Log:
  Update from " Greg Truty <gtruty@us.ibm.com>" for "JAX-RPC Handler Support in Axis".
  
  Note from Greg:
  Ok... further tests indicate that I had an issue w/my implementation.
  Essentially, I am writing a testcase to contribute which add's headers,
  checks headers, and modifies the soap body as part of doing this from a
  JAX-RPC handler.  It showed that my JAX-RPC intercepters are in the wrong
  spot on the server side.  They need to be moved so they run AFTER the pivot
  point.  Sending a header in the SOAP response was not possible.  I moved
  them to SOAPService and it works fine.
  
  Revision  Changes    Path
  1.76      +10 -26    xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
  
  Index: JavaProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- JavaProvider.java	29 Aug 2002 21:02:39 -0000	1.75
  +++ JavaProvider.java	2 Sep 2002 00:13:21 -0000	1.76
  @@ -57,33 +57,28 @@
   
   import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
  +import org.apache.axis.Constants;
   import org.apache.axis.Handler;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  +import org.apache.axis.components.logger.LogFactory;
  +import org.apache.axis.description.ServiceDesc;
  +import org.apache.axis.encoding.TypeMapping;
  +import org.apache.axis.enum.Scope;
  +import org.apache.axis.enum.Style;
  +import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.providers.BasicProvider;
  -import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.ClassUtils;
  -import org.apache.axis.utils.cache.JavaClass;
  +import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.cache.ClassCache;
  +import org.apache.axis.utils.cache.JavaClass;
   import org.apache.axis.wsdl.fromJava.Emitter;
  -import org.apache.axis.encoding.TypeMapping;
  -import org.apache.axis.enum.Style;
  -import org.apache.axis.enum.Scope;
  -import org.apache.axis.Constants;
  -import org.apache.axis.description.ServiceDesc;
  -import org.apache.axis.handlers.soap.SOAPService;
  -
  -import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
  -
  -import org.apache.axis.handlers.HandlerChainImpl;
  -import org.apache.axis.handlers.HandlerInfoChainFactory;
  -
   import org.w3c.dom.Document;
   
  -import javax.xml.rpc.server.ServiceLifecycle;
   import javax.xml.rpc.holders.IntHolder;
  +import javax.xml.rpc.server.ServiceLifecycle;
   import java.net.URL;
   import java.util.ArrayList;
   import java.util.StringTokenizer;
  @@ -268,11 +263,6 @@
                   msgContext.setResponseMessage( resMsg );
               }
   
  -        HandlerInfoChainFactory handlerFactory = (HandlerInfoChainFactory) service.getOption(Constants.ATTR_HANDLERINFOCHAIN);

  -        HandlerChainImpl handlerImpl = null;
  -        if (handlerFactory != null) handlerImpl = (HandlerChainImpl) handlerFactory.createHandlerChain();

  -            if (handlerImpl != null) handlerImpl.handleRequest(msgContext);
  -
               try {
                   processMessage(msgContext, reqEnv,
                                  resEnv, obj);
  @@ -286,12 +276,6 @@
                       ((ServiceLifecycle)obj).destroy();
                   }
               }
  -
  -            if ( handlerImpl != null) {
  -                handlerImpl.handleResponse(msgContext);
  -                handlerImpl.destroy();
  -            }
  -
           }
           catch( Exception exp ) {
               entLog.debug( JavaUtils.getMessage("toAxisFault00"), exp);
  
  
  
  1.79      +17 -1     xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java
  
  Index: SOAPService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- SOAPService.java	25 Aug 2002 14:00:02 -0000	1.78
  +++ SOAPService.java	2 Sep 2002 00:13:21 -0000	1.79
  @@ -61,12 +61,14 @@
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
   import org.apache.axis.SimpleTargetedChain;
  +import org.apache.axis.attachments.Attachments;
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.description.ServiceDesc;
   import org.apache.axis.encoding.TypeMappingRegistry;
   import org.apache.axis.enum.Style;
  -import org.apache.axis.attachments.Attachments;
   import org.apache.axis.handlers.BasicHandler;
  +import org.apache.axis.handlers.HandlerChainImpl;
  +import org.apache.axis.handlers.HandlerInfoChainFactory;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHeaderElement;
   import org.apache.axis.providers.BasicProvider;
  @@ -419,4 +421,18 @@
       public void setSendType(int sendType) {
           this.sendType = sendType;
       }
  +
  +	public void invoke(MessageContext msgContext) throws AxisFault {
  +		HandlerInfoChainFactory handlerFactory = (HandlerInfoChainFactory) this.getOption(Constants.ATTR_HANDLERINFOCHAIN);
  +		HandlerChainImpl handlerImpl = null;
  +		if (handlerFactory != null) handlerImpl = (HandlerChainImpl) handlerFactory.createHandlerChain();
  +		if (handlerImpl != null) handlerImpl.handleRequest(msgContext);
  +
  +		super.invoke(msgContext);
  +
  +		if ( handlerImpl != null) {
  +			handlerImpl.handleResponse(msgContext);
  +				handlerImpl.destroy();
  +		}
  +	}
   }
  
  
  

Mime
View raw message