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 du...@apache.org on 2001/04/30 20:39:39 UTC

cvs commit: xml-axis/java/src/org/apache/axis/handlers/http HTTPActionHandler.java JWSHandler.java

dug         01/04/30 11:39:38

  Modified:    java/src/org/apache/axis/handlers/http
                        HTTPActionHandler.java JWSHandler.java
  Log:
  re-enable jws file support
  
  Revision  Changes    Path
  1.2       +24 -18    xml-axis/java/src/org/apache/axis/handlers/http/HTTPActionHandler.java
  
  Index: HTTPActionHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/http/HTTPActionHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTTPActionHandler.java	2001/04/29 00:38:25	1.1
  +++ HTTPActionHandler.java	2001/04/30 18:39:32	1.2
  @@ -78,27 +78,33 @@
       public void invoke(MessageContext msgContext) throws AxisFault
       {
           Debug.Print( 1, "Enter: HTTPActionHandler::invoke" );
  -        String action = (String) msgContext.getProperty(
  -                                            HTTPConstants.MC_HTTP_SOAPACTION);
  -        Debug.Print( 2, "  HTTP SOAPAction: " + action );
  -        
  -        /** The idea is that this handler only goes in the chain IF this
  -         * service does a mapping between SOAPAction and target.  Therefore
  -         * if we get here with no action, we're in trouble.
  -         */
  -        if (action == null)
  -            throw new AxisFault( "Server.NoHTTPAction",
  -                "No HTTPAction property in context",
  -                null, null );
  -        
  -        action = action.trim();
   
  -        if (action.charAt(0) == '\"') {
  -            // assert(action.endsWith("\"")
  -            action = action.substring(1, action.length() - 1);
  +        /** If there's already a targetService (ie. JWSProcessor) then
  +         *  just return.
  +         */
  +        if ( msgContext.getTargetService() == null ) {
  +            String action = (String) msgContext.getProperty(
  +                                              HTTPConstants.MC_HTTP_SOAPACTION);
  +            Debug.Print( 2, "  HTTP SOAPAction: " + action );
  +            
  +            /** The idea is that this handler only goes in the chain IF this
  +             * service does a mapping between SOAPAction and target.  Therefore
  +             * if we get here with no action, we're in trouble.
  +             */
  +            if (action == null)
  +                throw new AxisFault( "Server.NoHTTPAction",
  +                    "No HTTPAction property in context",
  +                    null, null );
  +            
  +            action = action.trim();
  +    
  +            if (action.charAt(0) == '\"') {
  +                // assert(action.endsWith("\"")
  +                action = action.substring(1, action.length() - 1);
  +            }
  +            msgContext.setTargetService( action );
           }
   
  -        msgContext.setTargetService( action );
           Debug.Print( 1, "Exit : HTTPActionHandler::invoke" );
       }
   
  
  
  
  1.2       +25 -20    xml-axis/java/src/org/apache/axis/handlers/http/JWSHandler.java
  
  Index: JWSHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/http/JWSHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JWSHandler.java	2001/04/29 00:38:25	1.1
  +++ JWSHandler.java	2001/04/30 18:39:33	1.2
  @@ -73,27 +73,32 @@
       public void invoke(MessageContext msgContext) throws AxisFault
       {
           Debug.Print( 1, "Enter: JWSHandler::invoke" );
  -        
  -        HttpServlet        servlet = (HttpServlet) msgContext.getProperty(
  -                                             HTTPConstants.MC_HTTP_SERVLET);
  -        ServletConfig      config  = servlet.getServletConfig();
  -        ServletContext     context = config.getServletContext();
  -        HttpServletRequest req = (HttpServletRequest) msgContext.getProperty(
  -                                        HTTPConstants.MC_HTTP_SERVLETREQUEST);
  -        String URL = req.getServletPath();
  -        Debug.Print(3, "URL: " + URL );
   
  -        String   opt     = (String) getOption("JWSProcessor");
  -        boolean  skipJWS = false ;
  -        if ( opt != null && (opt.equals("0") || opt.equalsIgnoreCase("NO") ||
  -                             opt.equalsIgnoreCase("OFF")) )
  -          skipJWS = true ;
  -
  -        if ( !skipJWS && URL.endsWith(".jws") ) {
  -            String pathName = context.getRealPath( URL );
  -            Debug.Print(2, "Path: " + pathName );
  -            msgContext.setProperty( "JWSFileName", pathName );
  -            msgContext.setTargetService( Constants.JWSPROCESSOR_TARGET ) ;
  +        /** If there's already a targetService just return.
  +         */
  +        if ( msgContext.getTargetService() == null ) {
  +            HttpServlet        servlet = (HttpServlet) msgContext.getProperty(
  +                                               HTTPConstants.MC_HTTP_SERVLET);
  +            ServletConfig      config  = servlet.getServletConfig();
  +            ServletContext     context = config.getServletContext();
  +            HttpServletRequest req = (HttpServletRequest)msgContext.getProperty(
  +                                          HTTPConstants.MC_HTTP_SERVLETREQUEST);
  +            String URL = req.getServletPath();
  +            Debug.Print(3, "URL: " + URL );
  +    
  +            String   opt     = (String) getOption("JWSProcessor");
  +            boolean  skipJWS = false ;
  +            Debug.Print(3, "JWSProcessor Opt: " + opt );
  +            if (opt != null && (opt.equals("0") || opt.equalsIgnoreCase("NO") ||
  +                                 opt.equalsIgnoreCase("OFF")) )
  +              skipJWS = true ;
  +    
  +            if ( !skipJWS && URL.endsWith(".jws") ) {
  +                String pathName = context.getRealPath( URL );
  +                Debug.Print(2, "Path: " + pathName );
  +                msgContext.setProperty( "JWSFileName", pathName );
  +                msgContext.setTargetService( Constants.JWSPROCESSOR_TARGET ) ;
  +            }
           }
   
           Debug.Print( 1, "Exit : JWSHandler::invoke" );