dims        2002/06/27 11:06:17

  Modified:    java/src/org/apache/axis/utils axisNLS.properties
               java/test/wsdl/types DynamicProxyTestCase.java
               java/src/org/apache/axis/client Service.java
                        ServiceFactory.java
  Log:
  TCK compliance fixes.
  
  Revision  Changes    Path
  1.17      +1 -0      xml-axis/java/src/org/apache/axis/utils/axisNLS.properties
  
  Index: axisNLS.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/axisNLS.properties,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- axisNLS.properties        27 Jun 2002 16:36:08 -0000      1.16
  +++ axisNLS.properties        27 Jun 2002 18:06:17 -0000      1.17
  @@ -57,6 +57,7 @@
   badParmMode00=Invalid Parameter mode {0}.
   badPosition00=Malformed position attribute ''{0}''.
   badProxy00=Proxy port number, "{0}", incorrectly formatted
  +badPort00=portName should not be null
   
   # NOTE:  in badRequest00, do not translate "GET", "POST"
   badRequest00=Cannot handle non-GET, non-POST request
  
  
  
  1.7       +3 -5      xml-axis/java/test/wsdl/types/DynamicProxyTestCase.java
  
  Index: DynamicProxyTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/types/DynamicProxyTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DynamicProxyTestCase.java 18 Jun 2002 16:53:10 -0000      1.6
  +++ DynamicProxyTestCase.java 27 Jun 2002 18:06:17 -0000      1.7
  @@ -78,12 +78,10 @@
               Stub binding = (Stub) service.getPort(TypeTest.class);
               binding._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY,
                       "http://localhost:8080/axis/services/TypeTest";);
  -            return (TypeTest) binding;
  -            
  +            throw new AssertionFailedError("Should not get a binding");
           }
           catch (ServiceException jre) {
  -            jre.printStackTrace();
  -            throw new AssertionFailedError("ServiceException caught: " + jre);
  +            return null;
           }
       } // getProxy
   
  @@ -125,7 +123,7 @@
           TypeTest binding = getProxyWithWSDL();
           allPrimitivesIn(binding);
           binding = getProxy();
  -        allPrimitivesIn(binding);
  +        assertTrue(binding == null);
       } // test2TypeTestAllPrimitivesInout
   
       private void allPrimitivesInout(TypeTest binding) {
  
  
  
  1.62      +32 -9     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.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- Service.java      25 Jun 2002 19:11:21 -0000      1.61
  +++ Service.java      27 Jun 2002 18:06:17 -0000      1.62
  @@ -112,6 +112,7 @@
       private transient EngineConfiguration config =
           (new DefaultEngineConfigurationFactory()).getClientEngineConfig();
   
  +    private QName               serviceName     = null ;
       private URL                 wsdlLocation    = null ;
       private Definition          wsdlDefinition  = null ;
       private javax.wsdl.Service  wsdlService     = null ;
  @@ -149,6 +150,16 @@
       }
   
       /**
  +     * Constructs a new Service object - this assumes the caller will set
  +     * the appropriate fields by hand rather than getting them from the
  +     * WSDL.
  +     */
  +    public Service(QName serviceName) {
  +        this.serviceName = serviceName;
  +        engine = getAxisClient();
  +    }
  +
  +    /**
        * Constructs a new Service object as above, but also passing in
        * the EngineConfiguration which should be used to set up the
        * AxisClient.
  @@ -167,6 +178,7 @@
        * @throws ServiceException If there's an error finding or parsing the WSDL
        */
       public Service(URL wsdlDoc, QName serviceName) throws ServiceException {
  +        this.serviceName = serviceName;
           engine = getAxisClient();
           this.wsdlLocation = wsdlDoc;
           Definition def = null ;
  @@ -194,6 +206,7 @@
        */
       public Service(String wsdlLocation, QName serviceName)
                              throws ServiceException {
  +        this.serviceName = serviceName;
           engine = getAxisClient();
           try {
               this.wsdlLocation = new URL(wsdlLocation);
  @@ -289,6 +302,14 @@
        */
       public Remote getPort(QName portName, Class proxyInterface)
                              throws ServiceException {
  +
  +        if (wsdlLocation == null)
  +            throw new ServiceException(JavaUtils.getMessage("wsdlMissing00"));
  +
  +        Port port = wsdlService.getPort( portName.getLocalPart() );
  +        if ( port == null )
  +            throw new ServiceException( JavaUtils.getMessage("noPort00", "" + 
portName) );
  +
           // First, try to find a generated stub.  If that
           // returns null, then find a dynamic stub.
           Remote stub = getGeneratedStub(portName, proxyInterface);
  @@ -340,6 +361,9 @@
        * @throws ServiceException If there's an error
        */
       public Remote getPort(Class proxyInterface) throws ServiceException {
  +        if (wsdlLocation == null)
  +            throw new ServiceException(JavaUtils.getMessage("wsdlMissing00"));
  +
           return getPort(null, null, proxyInterface);
       }
   
  @@ -509,12 +533,14 @@
        * to the required WSDL metadata or if an illegal portName is specified.
        */
       public javax.xml.rpc.Call[] getCalls(QName portName) throws ServiceException {
  -        if (wsdlLocation == null) {
  +        if (portName == null)
  +            throw new ServiceException(JavaUtils.getMessage("badPort00"));
  +
  +        if (wsdlLocation == null) 
               throw new ServiceException(JavaUtils.getMessage("wsdlMissing00"));
  -        }
  -        else {
  -            return new javax.xml.rpc.Call[0];
  -        }
  +
  +        javax.xml.rpc.Call[] array = new javax.xml.rpc.Call[]{createCall(portName)};
  +        return array;
       }
   
       /**
  @@ -550,6 +576,7 @@
        * @return QName Fully qualified name of this service.
        */
       public QName getServiceName() {
  +        if ( serviceName != null ) return serviceName;
           if ( wsdlService == null ) return( null );
           QName  qn = wsdlService.getQName();
           return( new QName( qn.getNamespaceURI(), qn.getLocalPart() ) );
  @@ -565,10 +592,6 @@
        *         required WSDL metadata
        */
       public Iterator getPorts() throws ServiceException {
  -        if ( wsdlService == null ) {
  -            throw new ServiceException(JavaUtils.getMessage("wsdlMissing00"));
  -        }
  -
           Map map = wsdlService.getPorts();
   
           if ( map == null ) {
  
  
  
  1.13      +1 -1      xml-axis/java/src/org/apache/axis/client/ServiceFactory.java
  
  Index: ServiceFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/ServiceFactory.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ServiceFactory.java       20 Jun 2002 16:48:17 -0000      1.12
  +++ ServiceFactory.java       27 Jun 2002 18:06:17 -0000      1.13
  @@ -247,6 +247,6 @@
        */
       public javax.xml.rpc.Service createService(QName serviceName)
               throws ServiceException {
  -        return new Service();
  +        return new Service(serviceName);
       } // createService
   }
  
  
  


Reply via email to