axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/i18n resource.properties
Date Mon, 13 Oct 2003 18:04:06 GMT
dims        2003/10/13 11:04:06

  Modified:    java/src/org/apache/axis/wsdl/toJava
                        JavaServiceImplWriter.java
               java/src/org/apache/axis/i18n resource.properties
  Log:
  Slightly modified Fix for Bug 23761 - Cannot change the Port's endpoint url from ServiceLocator
  from guillaume.sauthier@bull.net (Guillaume Sauthier)
  
  Revision  Changes    Path
  1.33      +51 -1     ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaServiceImplWriter.java
  
  Index: JavaServiceImplWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaServiceImplWriter.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- JavaServiceImplWriter.java	30 Sep 2003 19:08:09 -0000	1.32
  +++ JavaServiceImplWriter.java	13 Oct 2003 18:04:06 -0000	1.33
  @@ -237,12 +237,14 @@
               writeGetPortName(pw, bindingType, portName);
               writeGetPortNameURL(pw, bindingType, portName, stubClass,
                       wsddServiceName);
  +            writeSetPortEndpointAddress(pw, portName);
           }
           writeGetPortClass(pw, getPortIfaces, getPortStubClasses,
                   getPortPortNames, printGetPortNotice);
           writeGetPortQNameClass(pw, getPortPortNames);
           writeGetServiceName(pw, sEntry.getQName());
           writeGetPorts(pw, getPortPortNames);
  +        writeSetEndpointAddress(pw, getPortPortNames);
       } // writeFileBody
   
       /**
  @@ -254,7 +256,7 @@
           pw.println();
           pw.println("    // " + Messages.getMessage("getProxy00", portName));
           writeComment(pw, p.getDocumentationElement());
  -        pw.println("    private final java.lang.String " + portName + "_address = \"" +
address + "\";");
  +        pw.println("    private java.lang.String " + portName + "_address = \"" + address
+ "\";");
   
           // Write the public address getter for this field
           pw.println();
  @@ -323,6 +325,17 @@
       } // writeGetPortNameURL
   
       /**
  +     * Write the set<portName>EndpointAddress(String) method.
  +     */
  +    protected void writeSetPortEndpointAddress(PrintWriter pw, String portName) {
  +
  +        pw.println("    public void set" + portName + "EndpointAddress(java.lang.String
address) {");
  +        pw.println("        " + portName + "_address = address;");
  +        pw.println("    }");
  +        pw.println();
  +    } // writeSetPortEndpointAddress
  +
  +    /**
        * Write the getPort(Class serviceInterfaceWriter) method.
        */
       protected void writeGetPortClass(PrintWriter pw, Vector getPortIfaces,
  @@ -427,5 +440,42 @@
           pw.println("    }");
           pw.println();
       } // writeGetPorts
  +
  +    /**
  +     * Write the setEndpointAddress(String portName, String newAddress)
  +     * and setEndpointAddress(QName portName, String newAddress) methods.
  +     */
  +    protected void writeSetEndpointAddress(PrintWriter pw, Vector portNames) {
  +        if (portNames.isEmpty()) 
  +            return;
  +        
  +        // String method
  +        pw.println("    /**");
  +        pw.println("    * " + Messages.getMessage("setEndpointDoc00"));
  +        pw.println("    */");
  +        pw.println("    public void setEndpointAddress(java.lang.String portName, java.lang.String
address) throws " + javax.xml.rpc.ServiceException.class.getName() + " {");
  +        for (Iterator p = portNames.iterator(); p.hasNext(); ) {
  +            String name = (String) p.next();
  +            pw.println("        if (\"" + name + "\".equals(portName)) {");
  +            pw.println("            set" + name + "EndpointAddress(address);");
  +            pw.println("        }");
  +        }
  +        pw.println("        else { // Unknown Port Name");
  +        pw.println("            throw new " + javax.xml.rpc.ServiceException.class.getName()

  +                   + "(\" " + Messages.getMessage("unknownPortName")+ "\" + portName);");
  +        pw.println("        }");
  +        pw.println("    }");
  +        pw.println();
  +
  +        // QName method
  +        pw.println("    /**");
  +        pw.println("    * " + Messages.getMessage("setEndpointDoc00"));
  +        pw.println("    */");
  +        pw.println("    public void setEndpointAddress(javax.xml.namespace.QName portName,
java.lang.String address) throws " + javax.xml.rpc.ServiceException.class.getName() + " {");
  +        pw.println("        setEndpointAddress(portName.getLocalPart(), address);");
  +        pw.println("    }");
  +        pw.println();
  +
  +    } // writeSetEndpointAddress
   
   } // class JavaServiceImplWriter
  
  
  
  1.71      +3 -0      ws-axis/java/src/org/apache/axis/i18n/resource.properties
  
  Index: resource.properties
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/i18n/resource.properties,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- resource.properties	6 Oct 2003 19:49:25 -0000	1.70
  +++ resource.properties	13 Oct 2003 18:04:06 -0000	1.71
  @@ -913,6 +913,9 @@
   getPortDoc04=the proxy implementation returned may be indeterminate.
   noStub=There is no stub implementation for the interface:
   CantGetSerializer=unable to get serializer for class {0}
  +unknownPortName=Cannot set Endpoint Address for Unknown Port
  +setEndpointDoc00=Set the endpoint address for the specified port name.
  +
   
   noVector00={0}:  {1} is not a vector
   badVector00=Circular reference in Vector 
  
  
  

Mime
View raw message