axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/client Call.java
Date Wed, 10 Jul 2002 19:32:14 GMT
gdaniels    2002/07/10 12:32:14

  Modified:    java/src/org/apache/axis/deployment/wsdd WSDDService.java
               java/test/soap TestHeaderAttrs.java
               java/src/org/apache/axis/handlers/soap SOAPService.java
               java/src/org/apache/axis/message SOAPHeaderElement.java
                        SOAPHeader.java HeaderBuilder.java
               java/src/org/apache/axis/handlers SimpleSessionHandler.java
                        JWSProcessor.java JWSHandler.java
               java/src/org/apache/axis/transport/http
                        SimpleAxisServer.java
               java/src/org/apache/axis/client Call.java
  Log:
  Fix problem with dealing with the default ("") actor in SOAP 1.1 for headers.
  
  * Attempt to ensure that every SOAPService is connected to an
    AxisEngine.  Then when we ask the service for its actor URIs, we get
    a merged list of the Service actors and the Engine actors.
  
  * Make the "" actor accepted by default.  Later we might have an
    "intermediary" switch which you turn on to switch this off.
  
  * Various bits of cleanup
  
  Revision  Changes    Path
  1.75      +2 -0      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java
  
  Index: WSDDService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- WSDDService.java	1 Jul 2002 19:37:52 -0000	1.74
  +++ WSDDService.java	10 Jul 2002 19:32:13 -0000	1.75
  @@ -388,6 +388,8 @@
               service.setName(getQName().getLocalPart());
           service.setOptions(getParametersTable());
   
  +        service.setEngine(((WSDDDeployment)registry).getEngine());
  +
           if (style != Style.RPC) {
               // No Multirefs/xsi:types
               service.setOption(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
  
  
  
  1.6       +0 -15     xml-axis/java/test/soap/TestHeaderAttrs.java
  
  Index: TestHeaderAttrs.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/soap/TestHeaderAttrs.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestHeaderAttrs.java	31 May 2002 19:08:11 -0000	1.5
  +++ TestHeaderAttrs.java	10 Jul 2002 19:32:13 -0000	1.6
  @@ -5,28 +5,14 @@
   import junit.framework.Test;
   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.configuration.SimpleProvider;
   import org.apache.axis.providers.java.RPCProvider;
   import org.apache.axis.transport.local.LocalTransport;
   import org.apache.axis.client.Call;
   import org.apache.axis.handlers.soap.SOAPService;
  -import org.apache.axis.handlers.EchoHandler;
  -import org.apache.axis.handlers.BasicHandler;
  -import org.apache.axis.message.RPCElement;
  -import org.apache.axis.message.RPCParam;
  -import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHeaderElement;
   import org.apache.axis.server.AxisServer;
   
  -import org.xml.sax.SAXException;
  -
  -import org.w3c.dom.Element;
  -import org.w3c.dom.Text;
  -
  -import java.util.Vector;
   import java.util.Random;
   
   import test.RPCDispatch.Data;
  @@ -59,7 +45,6 @@
       private SimpleProvider provider = new SimpleProvider();
       private AxisServer engine = new AxisServer(provider);
       private LocalTransport localTransport = new LocalTransport(engine);
  -    private Handler RPCDispatcher;
   
       static final String localURL = "local:///testService";
   
  
  
  
  1.73      +37 -5     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.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- SOAPService.java	3 Jul 2002 17:50:35 -0000	1.72
  +++ SOAPService.java	10 Jul 2002 19:32:13 -0000	1.73
  @@ -56,7 +56,6 @@
   
   import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.Constants;
   import org.apache.axis.Handler;
   import org.apache.axis.Message;
  @@ -131,6 +130,37 @@
       private AxisEngine engine;
   
       /**
  +     * Actor list - these are just the service-specific ones
  +     */
  +    ArrayList actors = new ArrayList();
  +
  +    /**
  +     * Get the service-specific actor list
  +     * @return
  +     */
  +    public ArrayList getServiceActors() {
  +        return actors;
  +    }
  +
  +    /**
  +     * Get the merged actor list for this service, including engine-wide
  +     * actor URIs.
  +     *
  +     * @return
  +     */
  +    public ArrayList getActors() {
  +        ArrayList acts = (ArrayList)actors.clone();  // ??? cache this?
  +
  +        // TODO: a SOAPService should always be associated with an engine,
  +        // so this should never be null.... check all paths to ensure that
  +        // constraint is true.
  +        if (engine != null) {
  +            acts.addAll(engine.getActorURIs());
  +        }
  +        return acts;
  +    }
  +
  +    /**
        * SOAPRequestHandler is used to inject SOAP semantics just before
        * the pivot handler.
        */
  @@ -143,13 +173,11 @@
                   this.log.debug( JavaUtils.getMessage("semanticCheck00"));
               }
   
  -            // This needs to be set to the merged list of service-specific and
  -            // enigne-wide actors we should be acting as.
  -            ArrayList actors = msgContext.getAxisEngine().getActorURIs();
  +            ArrayList acts = getActors();
   
               // 1. Check mustUnderstands
               SOAPEnvelope env = msgContext.getRequestMessage().getSOAPEnvelope();
  -            Vector headers = env.getHeadersByActor(actors);
  +            Vector headers = env.getHeadersByActor(acts);
               Vector misunderstoodHeaders = null;
               Enumeration enum = headers.elements();
               while (enum.hasMoreElements()) {
  @@ -205,6 +233,10 @@
       {
           initHashtable(true);
           initTypeMappingRegistry();
  +
  +        // For now, always assume we're the ultimate destination.
  +        // TODO : Handle SOAP 1.2 ultimateDestination actor as well
  +        actors.add("");
       }
   
       /** Constructor with real or null request, pivot, and response
  
  
  
  1.7       +7 -4      xml-axis/java/src/org/apache/axis/message/SOAPHeaderElement.java
  
  Index: SOAPHeaderElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPHeaderElement.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SOAPHeaderElement.java	29 Jun 2002 18:05:19 -0000	1.6
  +++ SOAPHeaderElement.java	10 Jul 2002 19:32:13 -0000	1.7
  @@ -57,15 +57,12 @@
   import org.apache.axis.Constants;
   import org.apache.axis.soap.SOAPConstants;
   import org.apache.axis.encoding.DeserializationContext;
  -import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.utils.JavaUtils;
   import org.w3c.dom.Element;
   import org.xml.sax.Attributes;
  -import org.xml.sax.helpers.AttributesImpl;
   
   import javax.xml.soap.SOAPElement;
   import javax.xml.soap.SOAPException;
  -import javax.xml.namespace.QName;
   import javax.xml.soap.Name;
   
   /** 
  @@ -79,7 +76,7 @@
       implements javax.xml.soap.SOAPHeaderElement {
       protected boolean   processed = false;
   
  -    protected String    actor;
  +    protected String    actor = "";
       protected boolean   mustUnderstand = false;
   
       public SOAPHeaderElement() {
  @@ -110,6 +107,9 @@
   
           actor = elem.getAttributeNS(Constants.URI_SOAP11_ENV,
                                       Constants.ATTR_ACTOR);
  +        if (actor == null) {
  +            actor = "";
  +        }
       }
   
       public void setParentElement(SOAPElement parent) throws SOAPException {
  @@ -143,6 +143,9 @@
   
           actor = attributes.getValue(soapConstants.getEnvelopeURI(),
                                       Constants.ATTR_ACTOR);
  +        if (actor == null) {
  +            actor = "";
  +        }
   
           processed = false;
       }
  
  
  
  1.51      +1 -1      xml-axis/java/src/org/apache/axis/message/SOAPHeader.java
  
  Index: SOAPHeader.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPHeader.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- SOAPHeader.java	3 Jul 2002 17:50:28 -0000	1.50
  +++ SOAPHeader.java	10 Jul 2002 19:32:13 -0000	1.51
  @@ -213,7 +213,7 @@
               if (mc != null) {
                   if (header != null) {
                       String actor = header.getActor();
  -                    ArrayList actors = mc.getAxisEngine().getActorURIs();
  +                    ArrayList actors = mc.getService().getActors();
                       if ((actor != null) &&
                               !Constants.URI_SOAP11_NEXT_ACTOR.equals(actor) &&
                               (actors == null || !actors.contains(actor))) {
  
  
  
  1.18      +0 -1      xml-axis/java/src/org/apache/axis/message/HeaderBuilder.java
  
  Index: HeaderBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/HeaderBuilder.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- HeaderBuilder.java	3 Jul 2002 17:50:28 -0000	1.17
  +++ HeaderBuilder.java	10 Jul 2002 19:32:13 -0000	1.18
  @@ -60,7 +60,6 @@
    * @author Glen Daniels (gdaniels@allaire.com)
    */
   
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.encoding.DeserializationContext;
   
   import org.apache.axis.components.logger.LogFactory;
  
  
  
  1.26      +2 -1      xml-axis/java/src/org/apache/axis/handlers/SimpleSessionHandler.java
  
  Index: SimpleSessionHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/SimpleSessionHandler.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- SimpleSessionHandler.java	3 Jul 2002 17:50:24 -0000	1.25
  +++ SimpleSessionHandler.java	10 Jul 2002 19:32:13 -0000	1.26
  @@ -57,7 +57,6 @@
   
   import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.Constants;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  @@ -224,6 +223,8 @@
                   // Store it away.
                   AxisEngine engine = context.getAxisEngine();
                   engine.setOption(SESSION_ID, id);
  +                // Note that we processed this header!
  +                header.setProcessed(true);
               } catch (Exception e) {
                   throw AxisFault.makeFault(e);
               }
  
  
  
  1.56      +1 -0      xml-axis/java/src/org/apache/axis/handlers/JWSProcessor.java
  
  Index: JWSProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/JWSProcessor.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- JWSProcessor.java	3 Jul 2002 17:50:23 -0000	1.55
  +++ JWSProcessor.java	10 Jul 2002 19:32:13 -0000	1.56
  @@ -277,6 +277,7 @@
               if (rpc == null) {
                   rpc = new SOAPService(new RPCProvider());
                   rpc.setOption(RPCProvider.OPTION_CLASSNAME, clsName );
  +                rpc.setEngine(msgContext.getAxisEngine());
   
                   // Support specification of "allowedMethods" as a parameter.
                   String allowed = (String)getOption(RPCProvider.OPTION_ALLOWEDMETHODS);
  
  
  
  1.22      +6 -2      xml-axis/java/src/org/apache/axis/handlers/JWSHandler.java
  
  Index: JWSHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/JWSHandler.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JWSHandler.java	3 Jul 2002 17:50:23 -0000	1.21
  +++ JWSHandler.java	10 Jul 2002 19:32:13 -0000	1.22
  @@ -55,11 +55,9 @@
   package org.apache.axis.handlers;
   
   import org.apache.axis.AxisFault;
  -import org.apache.axis.AxisProperties;
   import org.apache.axis.Constants;
   import org.apache.axis.MessageContext;
   import org.apache.axis.handlers.soap.SOAPService;
  -import org.apache.axis.utils.JavaUtils;
   
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
  @@ -88,10 +86,16 @@
       JWSProcessor jws = new JWSProcessor();
       SOAPService processor = new SOAPService(jws);
   
  +    boolean firstTime = true;
  +
       public void invoke(MessageContext msgContext) throws AxisFault
       {
           if (log.isDebugEnabled()) {
               log.debug("Enter: JWSHandler::invoke");
  +        }
  +
  +        if (firstTime) {
  +            processor.setEngine(msgContext.getAxisEngine());
           }
   
           // FORCE the targetService to be JWS if the URL is right.
  
  
  
  1.69      +0 -1      xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java
  
  Index: SimpleAxisServer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- SimpleAxisServer.java	3 Jul 2002 17:50:27 -0000	1.68
  +++ SimpleAxisServer.java	10 Jul 2002 19:32:14 -0000	1.69
  @@ -229,7 +229,6 @@
   
       /**
        * Server process.
  -     * @parms args[1] port number (default is 8080)
        */
       public static void main(String args[]) {
   
  
  
  
  1.158     +1 -0      xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.157
  retrieving revision 1.158
  diff -u -r1.157 -r1.158
  --- Call.java	10 Jul 2002 03:36:59 -0000	1.157
  +++ Call.java	10 Jul 2002 19:32:14 -0000	1.158
  @@ -2168,6 +2168,7 @@
               // Call.  So when client-side Handlers get at the MessageContext,
               // the property scoping will be MC -> SOAPService -> Call
               service.setPropertyParent(scopedProperties);
  +            service.setEngine(this.service.getAxisClient());
           }
       }
   
  
  
  

Mime
View raw message