You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by du...@apache.org on 2001/10/02 16:10:07 UTC

cvs commit: xml-axis/java/src/org/apache/axis/rpc/namespace QName.java

dug         01/10/02 07:10:07

  Modified:    java/src/org/apache/axis Constants.java
               java/src/org/apache/axis/client ServiceClient.java
               java/src/org/apache/axis/encoding ServiceDescription.java
               java/src/org/apache/axis/rpc JAXRPCException.java
                        Service.java
               java/src/org/apache/axis/rpc/namespace QName.java
  Added:       java/samples/stock GetQuote1.java
               java/src/org/apache/axis/client Call.java Service.java
               java/src/org/apache/axis/encoding XMLType.java
  Log:
  First pass at the Axis impl of a Service and Call object.
  Plus a sample (GetQuote1) that uses 'em.
  Not using WSDL yet - but that's next...
  
  Revision  Changes    Path
  1.1                  xml-axis/java/samples/stock/GetQuote1.java
  
  Index: GetQuote1.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Axis" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package samples.stock ;
  
  import java.net.*;
  import java.io.*;
  import java.util.*;
  
  import org.apache.axis.AxisFault ;
  import org.apache.axis.Constants ;
  import org.apache.axis.client.Service ;
  import org.apache.axis.rpc.Call ;
  import org.apache.axis.encoding.XMLType ;
  
  import org.apache.axis.client.Transport ;
  import org.apache.axis.transport.http.HTTPConstants;
  
  import org.apache.axis.utils.Options ;
  
  /**
   *
   * @author Doug Davis (dug@us.ibm.com.com)
   */
  public class GetQuote1 {
      public  String symbol ;
      
      public float getQuote (String args[]) throws Exception {
        Options opts = new Options( args );
  
        args = opts.getRemainingArgs();
  
        if ( args == null ) {
          System.err.println( "Usage: GetQuote <symbol>" );
          System.exit(1);
        }
  
        Service service = new Service();
        Call    call    = service.createCall();
  
        call.setTargetEndpointAddress( new URL(opts.getURL()) );
        call.setOperationName( "getQuote" );
        call.addParameter( "symbol", XMLType.XSD_STRING, call.PARAM_MODE_IN );
        call.setReturnType( XMLType.XSD_FLOAT );
  
        call.setProperty( Constants.NAMESPACE, "urn:xmltoday-delayed-quotes" );
        call.setProperty( HTTPConstants.MC_HTTP_SOAPACTION, "getQuote" );
        call.setProperty( Transport.USER, opts.getUser() );
        call.setProperty( Transport.PASSWORD, opts.getPassword() );
  
        Object result = call.invoke( new Object[] { symbol = args[0] } );
  
        return( ((Float) result).floatValue() );
      }
  
      public static void main(String args[]) {
        try {
            GetQuote1 gq = new GetQuote1();
            float val = gq.getQuote(args);
            System.out.println(gq.symbol + ": " + val);
        }
        catch( Exception e ) {
            if ( e instanceof AxisFault ) {
                ((AxisFault)e).dump();
            } else
                e.printStackTrace();
        }
      }
  };
  
  
  
  1.32      +2 -0      xml-axis/java/src/org/apache/axis/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Constants.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Constants.java	2001/10/01 16:38:26	1.31
  +++ Constants.java	2001/10/02 14:10:06	1.32
  @@ -193,4 +193,6 @@
   
       public static final String SERVER_CONFIG_FILE = "server-config.xml";
       public static final String CLIENT_CONFIG_FILE = "client-config.xml";
  +
  +    public static final String NAMESPACE = "namespace" ;
   }
  
  
  
  1.52      +17 -0     xml-axis/java/src/org/apache/axis/client/ServiceClient.java
  
  Index: ServiceClient.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/ServiceClient.java,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- ServiceClient.java	2001/09/16 19:58:45	1.51
  +++ ServiceClient.java	2001/10/02 14:10:06	1.52
  @@ -292,6 +292,14 @@
       }
   
       /**
  +     * Returns the URL of the transport
  +     */
  +    public String getURL() {
  +      if ( transport == null ) return( null );
  +      return( transport.getUrl() );
  +    }
  +
  +    /**
        * Set the name of the transport chain to use.
        */
       public void setTransportName(String name) {
  @@ -344,6 +352,15 @@
       public Object get (String name) {
           return (name == null || myProperties == null) ? null :
                                                           myProperties.get(name);
  +    }
  +
  +    /**
  +     * Removes the named property
  +     * @param name the property name to remove
  +     */
  +    public void remove(String name) {
  +        if ( name == null || myProperties == null ) return ;
  +        myProperties.remove( name );
       }
   
       /**
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  /*
  * The Apache Software License, Version 1.1
  *
  *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
  * 3. The end-user documentation included with the redistribution,
  *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
  * 4. The names "Axis" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written
  *    permission, please contact apache@apache.org.
  *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
  */
  
  package org.apache.axis.client ;
  
  /**
   * Axis' JAXRPC Dynamic Invocation Interface implementation of the Call
   * interface.
   *
   * @author Doug Davis (dug@us.ibm.com)
   */
  
  import java.lang.String ;
  
  import org.apache.axis.AxisFault ;
  import org.apache.axis.Constants ;
  import org.apache.axis.client.ServiceClient ;
  import org.apache.axis.encoding.ServiceDescription ;
  
  import org.apache.axis.rpc.namespace.QName ;
  import org.apache.axis.rpc.encoding.XMLType ;
  
  
  public class Call implements org.apache.axis.rpc.Call {
      private QName              portTypeName  = null ;
      private ServiceClient      client        = null ;
      private ServiceDescription serviceDesc   = null ;
      private String             operationName = null ;
  
      public Call() {
          client = new ServiceClient();
          serviceDesc = new ServiceDescription(null, true);
      }
  
      public String getEncodingStyle() {
          return( serviceDesc.getEncodingStyleURI() );
      }
  
      public void setEncodingStyle(String namespaceURI) {
          serviceDesc.setEncodingStyleURI( namespaceURI );
      }
  
      public void addParameter(String paramName, XMLType paramType,
                               int parameterMode) {
  
          QName qn = paramType.getType();
  
          switch( parameterMode ) {
              case PARAM_MODE_IN: 
                       serviceDesc.addInputParam( paramName,
                           new org.apache.axis.utils.QName(qn.getNamespaceURI(),
                                                           qn.getLocalPart() ) );
                       break ;
  
              case PARAM_MODE_OUT:
                       serviceDesc.addOutputParam( paramName,
                           new org.apache.axis.utils.QName(qn.getNamespaceURI(),
                                                           qn.getLocalPart() ) );
                       break ;
  
              case PARAM_MODE_INOUT:
              default:                // Unsupported - but can't throw anything!
                        throw new RuntimeException( "Unsupport parameter type" );
          }
      }
  
      public void setReturnType(XMLType type) {
          QName qn = type.getType();
          serviceDesc.setOutputType(
              new org.apache.axis.utils.QName(qn.getNamespaceURI(),
                                              qn.getLocalPart()));
      }
  
      public void removeAllParameters() {
          serviceDesc.removeAllParams();
      }
  
      public String getOperationName() {
          return( operationName );
      }
  
      public void setOperationName(String opName) {
          operationName = opName ;
      }
  
      public QName getPortTypeName() {
          return( portTypeName );
      }
  
      public void setPortTypeName(QName portType) {
          portTypeName = portType ;
      }
  
      public void setTargetEndpointAddress(java.net.URL address) {
          try {
              client.setURL( address.toString() );
          }
          catch( org.apache.axis.AxisFault exp ) {
              // do what?
          }
      }
  
      public java.net.URL getTargetEndpointAddress() {
          try {
              return( new java.net.URL(client.getURL()) );
          }
          catch( Exception exp ) {
              return( null );
          }
      }
  
      public void setProperty(String name, Object value) {
          client.set( name, value );
      }
  
      public Object getProperty(String name) {
          return( client.get( name ) );
      }
  
      public void removeProperty(String name) {
          client.remove( name );
      }
  
      // Remote Method Invocation methods
      public Object invoke(Object[] params)
                             throws java.rmi.RemoteException {
          if ( operationName == null )
              throw new java.rmi.RemoteException( "No operation name specified" );
          try {
              String ns = (String) client.get( Constants.NAMESPACE );
              if ( ns == null )
                  return( client.invoke( operationName, params ) );
              else
                  return( client.invoke( ns, operationName, params ) );
          }
          catch( AxisFault exp ) {
              throw new java.rmi.RemoteException( "Error invoking operation",
                                                  exp );
          }
      }
  
      public void invokeOneWay(Object[] params)
                             throws org.apache.axis.rpc.JAXRPCException {
          try {
              invoke( params );
          }
          catch( java.rmi.RemoteException exp ) {
              throw new org.apache.axis.rpc.JAXRPCException( exp.toString() );
          }
      }
  }
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/client/Service.java
  
  Index: Service.java
  ===================================================================
  /*
  * The Apache Software License, Version 1.1
  *
  *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
  * 3. The end-user documentation included with the redistribution,
  *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
  * 4. The names "Axis" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written
  *    permission, please contact apache@apache.org.
  *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
  */
  
  package org.apache.axis.client ;
  
  /**
   * Axis' JAXRPC Dynamic Invocation Interface implementation of the Service
   * interface.
   *
   * @author Doug Davis (dug@us.ibm.com)
   */
  
  import java.net.URL ;
  import java.lang.String ;
  import java.util.List ;
  import java.util.Iterator ;
  
  import org.apache.axis.utils.XMLUtils ;
  
  import org.apache.axis.rpc.JAXRPCException ;
  import org.apache.axis.rpc.namespace.QName ;
  
  import javax.wsdl.Definition ;
  import javax.wsdl.PortType ;
  import javax.wsdl.Operation ;
  
  import com.ibm.wsdl.xml.WSDLReader ;
  
  public class Service implements org.apache.axis.rpc.Service {
      private URL         wsdlLocation   = null ;
      private Definition  wsdlDefinition = null ;
  
      public Service() throws JAXRPCException { 
          this.wsdlLocation   = null ;
          this.wsdlDefinition = null ;
      }
  
      public Service(URL WSDLdoc) throws JAXRPCException {
          try {
              org.w3c.dom.Document doc = XMLUtils.newDocument(WSDLdoc.toString());
              WSDLReader           reader = new WSDLReader();
              Definition           def    = reader.readWSDL( null, doc );
  
              this.wsdlLocation = WSDLdoc ;
              this.wsdlDefinition = def ;
          }
          catch( Exception exp ) {
              throw new JAXRPCException( "Error processing WSDL document: " + 
                                         WSDLdoc + "\n" + exp.toString() );
          }
      }
  
      public Service(String wsdlLocation) throws JAXRPCException {
          try {
              org.w3c.dom.Document doc = XMLUtils.newDocument(wsdlLocation);
              WSDLReader           reader = new WSDLReader();
              Definition           def    = reader.readWSDL( null, doc );
  
              this.wsdlLocation = new URL(wsdlLocation) ;
              this.wsdlDefinition = def ;
          }
          catch( java.net.MalformedURLException exp ) {
              throw new JAXRPCException( "Malformed WSDL URI: " + wsdlLocation +
                                         "\n" + exp.toString() );
          }
          catch( Exception exp ) {
              throw new JAXRPCException( "Error processing WSDL document: " + 
                                         wsdlLocation + "\n" + exp.toString() );
          }
      }
  
      public java.rmi.Remote getPort(QName portName, Class proxyInterface)
                             throws JAXRPCException {
          // Not implemented yet 
          return( null );
      }
  
      public org.apache.axis.rpc.Call createCall(QName portName) 
                              throws JAXRPCException {
          javax.wsdl.QName qn = new javax.wsdl.QName( portName.getNamespaceURI(),
                                                      portName.getLocalPart() );
          if ( wsdlDefinition == null )
              throw new JAXRPCException( "Missing WSDL document" );
          PortType portType = wsdlDefinition.getPortType( qn );
          if ( portType == null )
              throw new JAXRPCException( "Can't find portType: " + portName );
          org.apache.axis.client.Call call = new org.apache.axis.client.Call();
          call.setPortTypeName( portName );
          return( call );
      }
  
      public org.apache.axis.rpc.Call createCall(QName portName, 
                                                 String operationName)
                             throws JAXRPCException {
          javax.wsdl.QName qn = new javax.wsdl.QName( portName.getNamespaceURI(),
                                                      portName.getLocalPart() );
          if ( wsdlDefinition == null )
              throw new JAXRPCException( "Missing WSDL document" );
          PortType portType = wsdlDefinition.getPortType( qn );
          if ( portType == null )
              throw new JAXRPCException( "Can't find portType: " + portName );
          List operations = portType.getOperations();
          if ( operations == null )
              throw new JAXRPCException( "Can't find operation: " + 
                                         operationName + " - none defined" );
          Operation op = null ;
          for ( int i = 0 ; i < operations.size() ; i++, op=null ) {
              op = (Operation) operations.get( i );
              if ( operationName.equals( op.getName() ) ) break ;
          }
          if ( op == null )
              throw new JAXRPCException( "Can't find operation: " + 
                                         operationName );
  
          org.apache.axis.client.Call call = new org.apache.axis.client.Call();
          call.setPortTypeName( portName );
          call.setOperationName( operationName );
  
          // set other fields from WSDL  - dug
  
          return( call );
      }
  
      public org.apache.axis.rpc.Call createCall() throws JAXRPCException {
          return( new org.apache.axis.client.Call() );
      }
  
      public URL getWSDLDocumentLocation() {
          return wsdlLocation ;
      }
  
      public QName getServiceName() {
          // not implemented yet
          return( null );
      }
  
      public Iterator getPorts() {
          // not implemented yet
          return( null );
      }
  
      public javax.naming.Reference getReference() {
          // not implementated yet
          return( null );
      }
  }
  
  
  
  1.8       +6 -0      xml-axis/java/src/org/apache/axis/encoding/ServiceDescription.java
  
  Index: ServiceDescription.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ServiceDescription.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ServiceDescription.java	2001/08/07 20:05:19	1.7
  +++ ServiceDescription.java	2001/10/02 14:10:06	1.8
  @@ -137,6 +137,12 @@
       {
           outputParams.addElement(new Param(name, type));
       }
  +
  +    public void removeAllParams()
  +    {
  +        inputParams.clear();
  +        outputParams.clear();
  +    }
       
       public void setOutputType(QName type)
       {
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/encoding/XMLType.java
  
  Index: XMLType.java
  ===================================================================
  /*
  * The Apache Software License, Version 1.1
  *
  *
  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  * reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  *    the documentation and/or other materials provided with the
  *    distribution.
  *
  * 3. The end-user documentation included with the redistribution,
  *    if any, must include the following acknowledgment:
  *       "This product includes software developed by the
  *        Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself,
  *    if and wherever such third-party acknowledgments normally appear.
  *
  * 4. The names "Axis" and "Apache Software Foundation" must
  *    not be used to endorse or promote products derived from this
  *    software without prior written permission. For written
  *    permission, please contact apache@apache.org.
  *
  * 5. Products derived from this software may not be called "Apache",
  *    nor may "Apache" appear in their name, without prior written
  *    permission of the Apache Software Foundation.
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * ====================================================================
  *
  * This software consists of voluntary contributions made by many
  * individuals on behalf of the Apache Software Foundation.  For more
  * information on the Apache Software Foundation, please see
  * <http://www.apache.org/>.
  */
  
  package org.apache.axis.encoding ;
  
  /**
   *
   * @author Doug Davis (dug@us.ibm.com)
   */
  
  import org.apache.axis.rpc.namespace.QName ;
  
  import org.apache.axis.Constants;
  import org.apache.axis.message.SOAPHandler;
  import org.apache.axis.rpc.namespace.QName;
  import org.xml.sax.*;
  
  import java.util.Date;
  import java.util.List;
  import java.math.BigDecimal;
  import java.io.IOException;
  
  
  public class XMLType implements org.apache.axis.rpc.encoding.XMLType {
      private QName type ;
  
      public static final XMLType XSD_STRING = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "string"));
      public static final XMLType XSD_BOOLEAN = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "boolean"));
      public static final XMLType XSD_DOUBLE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "double"));
      public static final XMLType XSD_FLOAT = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "float"));
      public static final XMLType XSD_INT = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "int"));
      public static final XMLType XSD_LONG = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "long"));
      public static final XMLType XSD_SHORT = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "short"));
      public static final XMLType XSD_BYTE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "byte"));
      public static final XMLType XSD_DECIMAL = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "decimal"));
      public static final XMLType XSD_BASE64 = new XMLType(new QName(Constants.URI_2001_SCHEMA_XSD, "base64Binary"));
      public static final XMLType XSD_ANYTYPE = new XMLType(new QName(Constants.URI_2001_SCHEMA_XSD, "anyType"));
      public static final XMLType SOAP_BASE64 = new XMLType(new QName(Constants.URI_SOAP_ENC, "base64"));
  
      public static final XMLType SOAP_STRING = new XMLType(new QName(Constants.URI_SOAP_ENC, "string"));
      public static final XMLType SOAP_BOOLEAN = new XMLType(new QName(Constants.URI_SOAP_ENC, "boolean"));
      public static final XMLType SOAP_DOUBLE = new XMLType(new QName(Constants.URI_SOAP_ENC, "double"));
      public static final XMLType SOAP_FLOAT = new XMLType(new QName(Constants.URI_SOAP_ENC, "float"));
      public static final XMLType SOAP_INT = new XMLType(new QName(Constants.URI_SOAP_ENC, "int"));
      public static final XMLType SOAP_LONG = new XMLType(new QName(Constants.URI_SOAP_ENC, "long"));
      public static final XMLType SOAP_SHORT = new XMLType(new QName(Constants.URI_SOAP_ENC, "short"));
      public static final XMLType SOAP_BYTE = new XMLType(new QName(Constants.URI_SOAP_ENC, "byte"));
      public static final XMLType SOAP_ARRAY = new XMLType(new QName(Constants.URI_SOAP_ENC, "Array"));
  
      public static final XMLType TYPE_MAP = new XMLType(new QName("http://xml.apache.org/xml-soap", "Map"));
  
      public static       XMLType XSD_DATE;
      
      static {
          if (Constants.URI_CURRENT_SCHEMA_XSD.equals(Constants.URI_1999_SCHEMA_XSD))
              XSD_DATE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "timeInstant"));
          else if (Constants.URI_CURRENT_SCHEMA_XSD.equals(Constants.URI_2000_SCHEMA_XSD))
              XSD_DATE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "timeInstant"));
          else
              XSD_DATE = new XMLType(new QName(Constants.URI_CURRENT_SCHEMA_XSD, "dateTime"));
      }
  
      // temporary
      public XMLType(org.apache.axis.utils.QName type) {
          this.type = new QName( type.getNamespaceURI(), type.getLocalPart() );
      }
  
      public XMLType(QName type) {
          this.type = type ;
      }
  
      public QName getType() {
          return( type );
      }
  
      public void setType(QName type) {
          this.type = type ;
      }
  }
  
  
  
  
      
  
  
  
  1.2       +6 -0      xml-axis/java/src/org/apache/axis/rpc/JAXRPCException.java
  
  Index: JAXRPCException.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/rpc/JAXRPCException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JAXRPCException.java	2001/09/26 20:06:53	1.1
  +++ JAXRPCException.java	2001/10/02 14:10:06	1.2
  @@ -5,4 +5,10 @@
   package org.apache.axis.rpc ;
   
   public class JAXRPCException extends Exception {
  +  public JAXRPCException() {
  +  }
  +
  +  public JAXRPCException(String exp) {
  +     super( exp );
  +  }
   }
  
  
  
  1.2       +1 -1      xml-axis/java/src/org/apache/axis/rpc/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/rpc/Service.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Service.java	2001/09/26 20:06:53	1.1
  +++ Service.java	2001/10/02 14:10:06	1.2
  @@ -4,7 +4,7 @@
   // package javax.xml.rpc ;
   package org.apache.axis.rpc ;
   
  -import org.apache.axis.utils.QName ;
  +import org.apache.axis.rpc.namespace.QName ;
   
   public interface Service 
         extends java.io.Serializable, javax.naming.Referenceable {
  
  
  
  1.2       +45 -0     xml-axis/java/src/org/apache/axis/rpc/namespace/QName.java
  
  Index: QName.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/rpc/namespace/QName.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- QName.java	2001/09/26 20:06:53	1.1
  +++ QName.java	2001/10/02 14:10:07	1.2
  @@ -1,8 +1,53 @@
   // temporary Service interface definition - replace with JAX-RPC
   // when it is ready.
  +// for now - stolen from the Axis version of QName
   
   // package javax.xml.rpc ;
   package org.apache.axis.rpc.namespace ;
   
   public class QName {
  +    private String namespaceURI ;
  +    private String localPart ;
  +
  +    public QName() {};
  +    public QName(String namespaceURI, String localPart) {
  +        setNamespaceURI(namespaceURI);
  +        setLocalPart(localPart);
  +    }
  +    
  +    public void setNamespaceURI(String namespaceURI) {
  +        this.namespaceURI = namespaceURI ;
  +    };
  +
  +    public String getNamespaceURI() { 
  +        return( namespaceURI );
  +    };
  +
  +    public void setLocalPart(String localPart) {
  +        this.localPart = localPart ;
  +    };
  +
  +    public String getLocalPart() {
  +        return( localPart );
  +    };
  +    
  +    public String toString() {
  +        if (namespaceURI == null) {
  +            return localPart;
  +        } else {
  +            return namespaceURI + ":" + localPart;
  +        }
  +    };
  +    
  +    public boolean equals(Object p1) {
  +        if (!(p1 instanceof QName)) return false;
  +
  +        if (namespaceURI == null) {
  +            if (((QName)p1).namespaceURI != null) return false;
  +        } else {
  +            if (!namespaceURI.equals(((QName)p1).namespaceURI)) return false;
  +        }
  +
  +        return localPart.equals(((QName)p1).localPart);
  +    };
   }