axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/client Call.java
Date Tue, 18 Dec 2001 21:34:15 GMT
tomj        01/12/18 13:34:15

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
               java/src/org/apache/axis/client Call.java
  Log:
  Update the JAX-RPC Call API to support some of the properties specified in the spec.
  Specifically, http.auth.user and http.auth.password are now set correctly in the Call object
in the stub.
  This allows users of the stubs to set username and password.
  The Call api will set the correct messageContext properties.
  
  In addition, we support the soap.http.soapaction.uri and soap.http.soapaction.use properties.
  This is kind of tricky since the default in JAX-RPC is to NOT use the soapaction property
unless
  the "use" flag is set to true.  I modified the stubs to set the use flag and soapaction
if it is non-null.
  
  TBD is support for:  security.auth.subject, soap.operation.style and encodingstyle.namespace.uri
  Probably the right thing is to have MessageContext support these properties directly.
  
  Revision  Changes    Path
  1.6       +28 -2     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JavaStubWriter.java	2001/12/14 17:31:19	1.5
  +++ JavaStubWriter.java	2001/12/18 21:34:15	1.6
  @@ -149,6 +149,20 @@
   
           pw.println("    }");
           pw.println();
  +        pw.println("    /**");
  +        pw.println("     * Sets the value for a named property. JAX-RPC 1.0 specification");

  +        pw.println("     * specifies a standard set of properties that may be passed ");
  +        pw.println("     * <UL>");
  +        pw.println("     * <LI>http.auth.username: Username for the HTTP Basic Authentication");
  +        pw.println("     * <LI>http.auth.password: Password for the HTTP Basic Authentication");
  +        pw.println("     * <LI>security.auth.subject: JAAS Subject that carries client
principal and its credentials");
  +        pw.println("     * <LI>encodingstyle.namespace.uri: Encoding style specified
as a namespace URI");
  +        //pw.println("     * <LI>[TBD: Additional properties]");
  +        pw.println("     * </UL>");
  +        pw.println("     *");
  +        pw.println("     * @param name - Name of the property");
  +        pw.println("     * @param value - Value of the property");
  +        pw.println("     */");
           pw.println("    public void _setProperty(String name, Object value) {");
           pw.println("        properties.put(name, value);");
           pw.println("    }");
  @@ -402,10 +416,22 @@
               pw.println();
           }
   
  -        pw.println("        call.setProperty(org.apache.axis.transport.http.HTTPTransport.ACTION,
\"" + soapAction + "\");");
  +        // username and password
  +        pw.println("        call.setProperty(\"http.auth.username\", _getProperty(\"http.auth.username\"));");
  +        pw.println("        call.setProperty(\"http.auth.password\", _getProperty(\"http.auth.password\"));");
  +
  +        // SoapAction and Namespace
  +        if (soapAction != null) {
  +            pw.println("        call.setProperty(\"soap.http.soapaction.use\", new Boolean(true));");
  +            pw.println("        call.setProperty(\"soap.http.soapaction.uri\", \"" + soapAction
+ "\");");
  +        }
           pw.println("        call.setProperty(call.NAMESPACE, \"" + namespace
                                                    + "\");" );
  -        pw.println("        call.setOperationName( \"" + operation.getName() + "\");" );
  +        // Operation name
  +        pw.println("        call.setOperationName(\"" + operation.getName() + "\");" );
  +        
  +        // Invoke the operation
  +        pw.println();
           pw.print("        Object resp = call.invoke(");
           pw.print("new Object[] {");
   
  
  
  
  1.53      +25 -3     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.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- Call.java	2001/12/12 18:17:52	1.52
  +++ Call.java	2001/12/18 21:34:15	1.53
  @@ -108,6 +108,7 @@
   import java.util.List;
   import java.util.Map;
   import java.util.Set;
  +import java.util.HashMap;
   
   /**
    * Axis' JAXRPC Dynamic Invocation Interface implementation of the Call
  @@ -1189,8 +1190,14 @@
           msgContext.setProperty( MessageContext.CALL, this );
           msgContext.setMaintainSession(maintainSession);
   
  -        // Go thru the properties and ones that are Axis specific, and
  -        // need to be moved to the msgContext - do so.
  +        /**
  +         * Go thru the properties and ones that are Axis specific, and
  +         * need to be moved to the msgContext - do so.
  +         * TBD:
  +         *   security.auth.subject
  +         *   soap.operation.style
  +         *   encodingstyle.namespace.uri
  +         */
           if (myProperties != null) {
               Enumeration enum = myProperties.keys();
               while (enum.hasMoreElements()) {
  @@ -1206,7 +1213,22 @@
   
                       msgContext.setTimeout( intValue );
                   }
  -                else
  +                else if (name.equals("http.auth.user")) {
  +                    msgContext.setProperty(MessageContext.USERID, value);
  +                }
  +                else if (name.equals("http.auth.password")) {
  +                    msgContext.setProperty(MessageContext.PASSWORD, value);
  +                }
  +                else if (name.equals("soap.http.soapaction.uri")) {
  +                    Object b = getProperty("soap.http.soapaction.use");
  +                    boolean use = false;  
  +                    if (b != null && b instanceof Boolean) {
  +                        use = ((Boolean)b).booleanValue();
  +                    }
  +                    if (use == true) 
  +                        msgContext.setProperty(HTTPConstants.MC_HTTP_SOAPACTION, value);
  +                }
  +                else // Just pass the property through to the message context
                       msgContext.setProperty(name, value);
               }
           }
  
  
  

Mime
View raw message