axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bu...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
Date Mon, 08 Jul 2002 16:37:39 GMT
butek       2002/07/08 09:37:38

  Modified:    java/src/org/apache/axis AxisEngine.java
               java/src/org/apache/axis/client Call.java Service.java
                        Stub.java
               java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
  Log:
  This problem was discovered while running the TCK.
  
  If you add handlers, then call service.getPort(QName, Class) and get a real
  stub (as opposed to a dynamic proxy), then those handlers never get
  called.
  
  Problem 1:  The port name never got propagated from the stub to the
  MessageContext.  Handlers are registered with portName as key.
  AxisEngine.invokeJAXRPCHandlers gets the handlers using the portName
  property in MessageContext.  No problem, just call stub.setPortName in
  Service.getGeneratedStub.
  
  Problem 2:  There IS no Stub.setPortName.  No problem.  Just add it.
  
  Problem 3:  Call doesn't have setPortName.  It has setPortTypeName.  This
  is a bad name since the method really deals with port name, not portType
  name.  I've deprecated Call.set/getPortTypeName (and related constants)
  and added Call.set/getPortName (and related constants).
  
  Revision  Changes    Path
  1.88      +5 -4      xml-axis/java/src/org/apache/axis/AxisEngine.java
  
  Index: AxisEngine.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- AxisEngine.java	3 Jul 2002 17:50:30 -0000	1.87
  +++ AxisEngine.java	8 Jul 2002 16:37:36 -0000	1.88
  @@ -405,19 +405,20 @@
       }
       
       protected void invokeJAXRPCHandlers(MessageContext context){
  -        org.apache.axis.client.Service service = (org.apache.axis.client.Service) context.getProperty(org.apache.axis.client.Call.JAXRPC_SERVICE);
  +        org.apache.axis.client.Service service = (org.apache.axis.client.Service) context.getProperty(org.apache.axis.client.Call.WSDL_SERVICE);
           if(service == null)
               return;
   
  -        QName operationName = (QName) context.getProperty(org.apache.axis.client.Call.JAXRPC_PORTTYPE_NAME);
  -        if(operationName == null)
  +        QName portName = (QName) context.getProperty(org.apache.axis.client.Call.WSDL_PORT_NAME);
  +        if(portName == null)
               return;
   
           javax.xml.rpc.handler.HandlerRegistry registry = service.getHandlerRegistry();
           if(registry == null)
               return;
   
  -        java.util.List chain = registry.getHandlerChain(operationName);
  +        java.util.List chain = registry.getHandlerChain(portName);
  +
           if(chain == null || chain.isEmpty())
               return;
   
  
  
  
  1.156     +43 -8     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.155
  retrieving revision 1.156
  diff -u -r1.155 -r1.156
  --- Call.java	3 Jul 2002 17:50:31 -0000	1.155
  +++ Call.java	8 Jul 2002 16:37:37 -0000	1.156
  @@ -148,7 +148,7 @@
   
       private boolean            parmAndRetReq   = true ;
       private Service            service         = null ;
  -    private QName              portTypeName    = new QName("");
  +    private QName              portName        = new QName("");
       private QName              operationName   = null ;
       private QName              returnType      = null ;
   
  @@ -192,8 +192,16 @@
       public static final String SEND_TYPE_ATTR    = "send_type_attr" ;
       public static final String TRANSPORT_NAME    = "transport_name" ;
       public static final String TRANSPORT_PROPERTY= "java.protocol.handler.pkgs";
  -    public static final String JAXRPC_SERVICE    = "jaxrpc.service";
  -    public static final String JAXRPC_PORTTYPE_NAME = "jaxrpc.porttype.name";
  +
  +    public static final String WSDL_SERVICE      = "wsdl.service";
  +
  +    public static final String WSDL_PORT_NAME    = "wsdl.portName";
  +
  +    // @deprecated use WSDL_SERVICE instead.
  +    public static final String JAXRPC_SERVICE    = WSDL_SERVICE;
  +
  +    // @deprected use WSDL_PORT_NAME instead.
  +    public static final String JAXRPC_PORTTYPE_NAME = WSDL_PORT_NAME;
   
       // If true, the code will throw a fault if there is no
       // response message from the server.  Otherwise, the
  @@ -948,7 +956,7 @@
               throw new JAXRPCException( JavaUtils.getMessage("noService04") );
   
           // Make sure we're making a fresh start.
  -        this.setPortTypeName( portName );
  +        this.setPortName( portName );
           this.setOperationName( opName );
           this.setTargetEndpointAddress( (URL) null );
           this.setEncodingStyle( null );
  @@ -1141,8 +1149,32 @@
        *
        * @return QName Fully qualified name of the port (or null if not set)
        */
  +    public QName getPortName() {
  +        return( portName );
  +    } // getPortName
  +
  +    /**
  +     * Sets the port name of this Call object.  This call will not set
  +     * any additional fields, nor will it do any checking to verify that
  +     * this port name is actually defined in the WSDL - for now anyway.
  +     *
  +     * @param portName Fully qualified name of the port
  +     */
  +    public void setPortName(QName portName) {
  +        this.portName = portName;
  +    } // setPortName
  +
  +    /**
  +     * Returns the fully qualified name of the port for this Call object
  +     * (if there is one).
  +     *
  +     * @return QName Fully qualified name of the port (or null if not set)
  +     *
  +     * @deprected This is really the service's port name, not portType name.
  +     *            Use getPortName instead.
  +     */
       public QName getPortTypeName() {
  -        return( portTypeName );
  +        return getPortName();
       }
   
       /**
  @@ -1151,9 +1183,12 @@
        * this port type is actually defined in the WSDL - for now anyway.
        *
        * @param portType Fully qualified name of the portType
  +     *
  +     * @deprected This is really the service's port name, not portType name.
  +     *            Use setPortName instead.
        */
       public void setPortTypeName(QName portType) {
  -        portTypeName = portType ;
  +        setPortName(portType);
       }
   
       /**
  @@ -1921,8 +1956,8 @@
           msgContext.reset();
           msgContext.setResponseMessage(null);
           msgContext.setProperty( MessageContext.CALL, this );
  -        msgContext.setProperty( JAXRPC_SERVICE, service );
  -        msgContext.setProperty( JAXRPC_PORTTYPE_NAME, getPortTypeName() );
  +        msgContext.setProperty( WSDL_SERVICE, service );
  +        msgContext.setProperty( WSDL_PORT_NAME, getPortTypeName() );
   
           if (username != null) {
               msgContext.setUsername(username);
  
  
  
  1.64      +1 -0      xml-axis/java/src/org/apache/axis/client/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Service.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- Service.java	27 Jun 2002 19:37:00 -0000	1.63
  +++ Service.java	8 Jul 2002 16:37:37 -0000	1.64
  @@ -341,6 +341,7 @@
                   stub._setProperty(
                           Stub.ENDPOINT_ADDRESS_PROPERTY,
                           WSDLUtils.getAddressFromPort(port));
  +                stub.setPortName(portName);
                   return (Remote) stub;
               }
               else {
  
  
  
  1.13      +17 -0     xml-axis/java/src/org/apache/axis/client/Stub.java
  
  Index: Stub.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Stub.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Stub.java	19 Jun 2002 16:13:16 -0000	1.12
  +++ Stub.java	8 Jul 2002 16:37:37 -0000	1.13
  @@ -61,6 +61,8 @@
   import java.util.Iterator;
   import java.util.Properties;
   
  +import javax.xml.namespace.QName;
  +
   import javax.xml.rpc.Service;
   
   import org.apache.axis.AxisFault;
  @@ -89,6 +91,7 @@
       protected String     cachedPassword     = null;
       protected URL        cachedEndpoint     = null;
       protected Integer    cachedTimeout      = null;
  +    protected QName      cachedPortName     = null;
   
       // Flag to determine whether this is the first call to register type mappings.
       // This need not be synchronized because firstCall is ONLY called from within
  @@ -247,6 +250,20 @@
       public void setTimeout(int timeout) {
           cachedTimeout = new Integer(timeout);
       } // setTimeout
  +
  +    /**
  +     * Get the port name.
  +     */
  +    public QName getPortName() {
  +        return cachedPortName;
  +    } // getPortName
  +
  +    /**
  +     * Set the port name.
  +     */
  +    public void setPortName(QName portName) {
  +        cachedPortName = portName;
  +    } // setPortName
   
       /**
        * If set to true, session is maintained; if false, it is not.
  
  
  
  1.74      +3 -0      xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
  
  Index: JavaStubWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- JavaStubWriter.java	25 Jun 2002 17:48:35 -0000	1.73
  +++ JavaStubWriter.java	8 Jul 2002 16:37:37 -0000	1.74
  @@ -197,6 +197,9 @@
           pw.println("            if (super.cachedTimeout != null) {");
           pw.println("                call.setTimeout(super.cachedTimeout);");
           pw.println("            }");
  +        pw.println("            if (super.cachedPortName != null) {");
  +        pw.println("                call.setPortName(super.cachedPortName);");
  +        pw.println("            }");
           pw.println("            java.util.Enumeration keys = super.cachedProperties.keys();");
           pw.println("            while (keys.hasMoreElements()) {");
           pw.println("                String key = (String) keys.nextElement();");
  
  
  

Mime
View raw message