axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/test/RPCDispatch TestRPC.java
Date Thu, 07 Jun 2001 14:02:30 GMT
rubys       01/06/07 07:02:29

  Modified:    java/samples/bidbuy BidService.java deploy.xml
               java/src/org/apache/axis MessageContext.java
               java/src/org/apache/axis/client/http HTTPTransport.java
               java/src/org/apache/axis/encoding BeanSerializer.java
                        DeserializerFactory.java SOAPEncoding.java
                        Serializer.java TypeMappingRegistry.java
               java/src/org/apache/axis/handlers/soap SOAPService.java
               java/src/org/apache/axis/server AxisServer.java
               java/src/org/apache/axis/transport/http
                        SimpleAxisServer.java
               java/src/org/apache/axis/utils Admin.java QName.java
               java/test/RPCDispatch TestRPC.java
  Log:
  1) Deploying beans from deploy.xml now works
  2) Type mappings for deployed services are serialized with the service
  3) Hierarchical type mappings now use: msgContext, service, server, SOAP
  4) MessageContext is once again serially reusable
  
  Revision  Changes    Path
  1.3       +0 -28     xml-axis/java/samples/bidbuy/BidService.java
  
  Index: BidService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/bidbuy/BidService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BidService.java	2001/05/10 01:03:31	1.2
  +++ BidService.java	2001/06/07 14:01:32	1.3
  @@ -44,34 +44,6 @@
       }
   
       /**
  -     * Register the serializers and deserializers required to implement
  -     * a Buy service
  -     * @param map the TypeMappingRegistry to update
  -     */
  -    public void BuyTypeMap(TypeMappingRegistry map) throws Exception {
  -
  -        // register the PurchaseOrder class
  -        QName poqn = new QName("http://www.soapinterop.org/Bid", 
  -                               "PurchaseOrder");
  -        Class cls = PurchaseOrder.class;
  -        map.addSerializer(cls, poqn, new BeanSerializer(cls));
  -        map.addDeserializerFactory(poqn, cls, BeanSerializer.getFactory(cls));
  -
  -        // register the Address class
  -        QName aqn = new QName("http://www.soapinterop.org/Bid", "Address");
  -        cls = Address.class;
  -        map.addSerializer(cls, aqn, new BeanSerializer(cls));
  -        map.addDeserializerFactory(aqn, cls, BeanSerializer.getFactory(cls));
  -
  -        // register the LineItem class
  -        QName liqn = new QName("http://www.soapinterop.org/Bid", "LineItem");
  -        cls = LineItem.class;
  -        map.addSerializer(cls, liqn, new BeanSerializer(cls));
  -        map.addDeserializerFactory(liqn, cls, BeanSerializer.getFactory(cls));
  -
  -    }
  -
  -    /**
        * Process a purchase order.
        * @return Receipt
        */
  
  
  
  1.4       +6 -5      xml-axis/java/samples/bidbuy/deploy.xml
  
  Index: deploy.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/bidbuy/deploy.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- deploy.xml	2001/05/22 21:26:47	1.3
  +++ deploy.xml	2001/06/07 14:01:33	1.4
  @@ -7,7 +7,7 @@
   <!--      after the axis server is running                      -->
   <!-- This file will be replaced by WSDD once it's ready         -->
   
  -<deploy xmlns:bid="http://www.soapinterop.org/Bid">
  +<deploy>
     <chain   name="bid"     flow="RPCDispatcher" />
   
     <service name="http://www.soapinterop.org/RequestForQuote" pivot="bid" >
  @@ -23,7 +23,6 @@
     <service name="http://www.soapinterop.org/Buy" pivot="bid" >
       <option name="className" value="samples.bidbuy.BidService" />
       <option name="methodName" value="Buy" />
  -    <option name="typemap" value="BuyTypeMap" />
     </service>
   
     <service name="http://www.soapinterop.org/Ping" pivot="bid" >
  @@ -31,7 +30,9 @@
       <option name="methodName" value="Ping" />
     </service>
   
  -  <bean name="samples.bidbuy.PurchaseOrder" qname="bid:PurchaseOrder"/>
  -  <bean name="samples.bidbuy.Address"       qname="bid:Address"/>
  -  <bean name="samples.bidbuy.LineItem"      qname="bid:LineItem"/>
  +  <bean xmlns:bid="http://www.soapinterop.org/Bid">
  +    <bid:PurchaseOrder classname="samples.bidbuy.PurchaseOrder"/>
  +    <bid:Address       classname="samples.bidbuy.Address"/>
  +    <bid:LineItem      classname="samples.bidbuy.LineItem"/>
  +  </bean>
   </deploy>
  
  
  
  1.28      +46 -51    xml-axis/java/src/org/apache/axis/MessageContext.java
  
  Index: MessageContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/MessageContext.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- MessageContext.java	2001/06/02 04:01:16	1.27
  +++ MessageContext.java	2001/06/07 14:01:39	1.28
  @@ -211,22 +211,18 @@
        * @param tServ the name of the target service.
        * @exception AxisFault
        */
  -    public void setTargetService(String tServ) throws AxisFault {
  -      targetService = tServ ;
  -      HandlerRegistry sr = (HandlerRegistry)
  -                            getProperty(Constants.SERVICE_REGISTRY);
  -      if (sr == null)
  -        return;
  -      
  -      Handler service = sr.find(tServ);
  -        /* Do NOT throw an exception if the service handler is not found,
  -           since we may be on the client!  -- yow... this is messy. -- RobJ
  -         */
  -      if (service == null) {
  -        // throw new AxisFault("No service named '" + tServ + "' in registry!");
  -      } else {
  -        setServiceHandler(service);
  -      }
  +    public void setTargetService(String tServ) {
  +        targetService = tServ ;
  +
  +        HandlerRegistry sr = (HandlerRegistry)
  +                              getProperty(Constants.SERVICE_REGISTRY);
  +
  +        if (sr == null || targetService == null)
  +            setServiceHandler(null);
  +        else
  +            // Do NOT throw an exception if the service handler is not found,
  +            // since we may be on the client!  -- yow... this is messy. -- RobJ
  +            setServiceHandler(sr.find(tServ));
       }
   
       /** ServiceHandler is the handler that is the "service".  This handler
  @@ -242,41 +238,38 @@
   
       public Handler getServiceHandler() {
           if (serviceHandler == null) {
  -            try {
  -                if (targetService != null) {
  -                    /** This is a bit kludgey for now - what might have
  -                    *  happened is that someone set the target service name
  -                    *  before the registry was set, or before the service
  -                    *  was registered.  So just to make sure, we set it
  -                    *  again here and see if that causes the serviceHandler
  -                    *  to be set correctly.
  -                    */
  -                    setTargetService(targetService);
  -                } else if (!parsing) {
  -                    // No target service was set.  So here's where we want to
  -                    // potentially try to dispatch off the QName of the first
  -                    // appropriate <Body> element.  Might also hook this to
  -                    // another configurable piece of code to avoid SOAP
  -                    // specifics in this class.
  -                    SOAPEnvelope env = (SOAPEnvelope)
  -                                        inMessage.getAs("SOAPEnvelope");
  -                    Vector bodies = env.getBodyElements();
  -                    Enumeration e = bodies.elements();
  -                    while (e.hasMoreElements()) {
  -                        SOAPBodyElement body = (SOAPBodyElement)
  -                                                e.nextElement();
  -                        /** The algorithm we use here is to find the first
  -                         * element without an ID attribute (assuming that
  -                         * ID'ed attributes are multi-ref encodings).
  -                         */
  -                        if (body.getID() == null) {
  -                            //Debug.Print(2, "Dispatching to body namespace '"
  -                            //            + body.getNamespaceURI() + "'");
  -                            setTargetService(body.getNamespaceURI());
  -                        }
  +            if (targetService != null) {
  +                /** This is a bit kludgey for now - what might have
  +                *  happened is that someone set the target service name
  +                *  before the registry was set, or before the service
  +                *  was registered.  So just to make sure, we set it
  +                *  again here and see if that causes the serviceHandler
  +                *  to be set correctly.
  +                */
  +                setTargetService(targetService);
  +            } else if (!parsing) {
  +                // No target service was set.  So here's where we want to
  +                // potentially try to dispatch off the QName of the first
  +                // appropriate <Body> element.  Might also hook this to
  +                // another configurable piece of code to avoid SOAP
  +                // specifics in this class.
  +                SOAPEnvelope env = (SOAPEnvelope)
  +                                    inMessage.getAs("SOAPEnvelope");
  +                Vector bodies = env.getBodyElements();
  +                Enumeration e = bodies.elements();
  +                while (e.hasMoreElements()) {
  +                    SOAPBodyElement body = (SOAPBodyElement)
  +                                            e.nextElement();
  +                    /** The algorithm we use here is to find the first
  +                     * element without an ID attribute (assuming that
  +                     * ID'ed attributes are multi-ref encodings).
  +                     */
  +                    if (body.getID() == null) {
  +                        //Debug.Print(2, "Dispatching to body namespace '"
  +                        //            + body.getNamespaceURI() + "'");
  +                        setTargetService(body.getNamespaceURI());
                       }
                   }
  -            } catch (AxisFault f) {
               }
         }
         return( serviceHandler );
  @@ -285,9 +278,11 @@
       public void setServiceHandler(Handler sh)
       {
         serviceHandler = sh;
  -      if (sh instanceof SOAPService) {
  +      if (sh != null && sh instanceof SOAPService) {
           TypeMappingRegistry tmr = ((SOAPService)sh).getTypeMappingRegistry();
  -        setTypeMappingRegistry(tmr);
  +        getTypeMappingRegistry().setParent(tmr);
  +      } else {
  +        getTypeMappingRegistry().setParent(soapTMR);
         }
       }
   
  
  
  
  1.3       +1 -6      xml-axis/java/src/org/apache/axis/client/http/HTTPTransport.java
  
  Index: HTTPTransport.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/http/HTTPTransport.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HTTPTransport.java	2001/06/02 04:01:18	1.2
  +++ HTTPTransport.java	2001/06/07 14:01:44	1.3
  @@ -136,12 +136,7 @@
       {
           if (url != null) mc.setProperty(URL, url);
           if (action != null) mc.setProperty(ACTION, action);
  -        try {
  -            mc.setTargetService( (String)mc.getProperty(ACTION) );
  -        } catch (AxisFault f) {
  -            System.err.println("HTTPTransport.setupMessageContext: Could not set target
service to "+serviceClient.get(ACTION));
  -            throw f;
  -        }
  +        mc.setTargetService( (String)mc.getProperty(ACTION) );
           
           if ( doLocal && ((String)mc.getProperty(URL)).endsWith( ".jws") ) {
               mc.setProperty( "JWSFileName", serviceClient.get(URL).substring(11) );
  
  
  
  1.5       +10 -13    xml-axis/java/src/org/apache/axis/encoding/BeanSerializer.java
  
  Index: BeanSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/BeanSerializer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BeanSerializer.java	2001/06/05 15:24:40	1.4
  +++ BeanSerializer.java	2001/06/07 14:01:48	1.5
  @@ -156,6 +156,12 @@
   
               return bs;
           }
  +
  +        /**
  +         * Override serialization - all that is needed is the class
  +         */
  +        private static final ObjectStreamField[] serialPersistentFields = 
  +            {new ObjectStreamField("cls", Class.class)};
       }
   
       /**
  @@ -262,18 +268,9 @@
       }
   
       /**
  -     * Write the serializer out to disk.  Actually, all we need is enough
  -     * to reconsitute the object from scratch, namely 
  +     * Override serialization - all that is needed is the class
        */
  -    private void writeObject(ObjectOutputStream out) throws IOException {
  -        out.writeObject(cls.getName());
  -    }
  -          
  -    private void readObject(ObjectInputStream stream) 
  -        throws IOException, ClassNotFoundException
  -    {
  -        String clsName = (String) stream.readObject();
  -        setCls(Class.forName(clsName));
  -    }
  -          
  +    private static final ObjectStreamField[] serialPersistentFields = 
  +        {new ObjectStreamField("cls", Class.class)};
  + 
   }
  
  
  
  1.2       +1 -1      xml-axis/java/src/org/apache/axis/encoding/DeserializerFactory.java
  
  Index: DeserializerFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializerFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeserializerFactory.java	2001/05/03 14:31:46	1.1
  +++ DeserializerFactory.java	2001/06/07 14:01:49	1.2
  @@ -1,6 +1,6 @@
   package org.apache.axis.encoding;
   
  -public interface DeserializerFactory
  +public interface DeserializerFactory extends java.io.Serializable
   {
       public DeserializerBase getDeserializer();
   }
  
  
  
  1.5       +1 -1      xml-axis/java/src/org/apache/axis/encoding/SOAPEncoding.java
  
  Index: SOAPEncoding.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SOAPEncoding.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SOAPEncoding.java	2001/05/08 15:35:07	1.4
  +++ SOAPEncoding.java	2001/06/07 14:01:51	1.5
  @@ -10,7 +10,7 @@
   import java.io.IOException;
   import java.math.BigDecimal;
   
  -public class SOAPEncoding implements Serializer { 
  +public class SOAPEncoding implements Serializer, java.io.Serializable { 
       private Hashtable typemap = new Hashtable();
       private Hashtable namemap = new Hashtable();
       
  
  
  
  1.5       +1 -1      xml-axis/java/src/org/apache/axis/encoding/Serializer.java
  
  Index: Serializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/Serializer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Serializer.java	2001/05/03 14:31:52	1.4
  +++ Serializer.java	2001/06/07 14:01:54	1.5
  @@ -65,7 +65,7 @@
   /**
    * @author James Snell (jasnell@us.ibm.com)
    */
  -public interface Serializer { 
  +public interface Serializer extends java.io.Serializable { 
       public void serialize(QName name, Attributes attributes,
                             Object value, SerializationContext context)
           throws IOException;
  
  
  
  1.12      +26 -1     xml-axis/java/src/org/apache/axis/encoding/TypeMappingRegistry.java
  
  Index: TypeMappingRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/TypeMappingRegistry.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TypeMappingRegistry.java	2001/05/22 21:26:59	1.11
  +++ TypeMappingRegistry.java	2001/06/07 14:01:56	1.12
  @@ -70,7 +70,7 @@
    * @author James Snell (jasnell@us.ibm.com)
    * @author Sam Ruby (rubys@us.ibm.com)
    */
  -public class TypeMappingRegistry implements Serializer { 
  +public class TypeMappingRegistry implements Serializer, Serializable { 
   
       // default location for save/load
       private String fileName = null;
  @@ -128,6 +128,16 @@
        */
       public void setParent(TypeMappingRegistry parent) {
           this.parent = parent;
  +        
  +        // debug assertions: every tmr must have exactly one
  +        // SOAPTypeMappingRegistry at the top.
  +        if (parent == null)
  +            new Exception("null parent!").printStackTrace();
  +        if (this instanceof SOAPTypeMappingRegistry)
  +            new Exception("SOAPTypeMappingRegistry w/parent").printStackTrace();
  +        for (TypeMappingRegistry t = parent; t!=null; t=t.getParent())
  +            if (t instanceof SOAPTypeMappingRegistry) return;
  +        new Exception("no SOAPTypeMappingRegistry parent").printStackTrace();
       }
   
       public TypeMappingRegistry getParent() {
  @@ -276,6 +286,21 @@
           // !!! Write out a generic null, or get type info from somewhere else?
       }
   
  +    public void dump(PrintStream out, String header) {
  +        out.println(header);
  +        if (fileName != null) 
  +           out.println("  File: " + fileName);
  +        out.println("  Deserializers:");
  +        if (d != null) {
  +            java.util.Enumeration e = d.keys();
  +            while (e.hasMoreElements()) {
  +                Object key = e.nextElement();
  +                out.println("    " + key + " => " + d.get(key));
  +            }
  +        }
  +        if (parent != null)
  +            parent.dump(out, "Parent");
  +    }
       //public MessageElement serialize(QName name, Object value, NSStack nsStack, Message
message) {
       //    if (value != null) {
       //        Class _class = value.getClass();
  
  
  
  1.5       +8 -8      xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java
  
  Index: SOAPService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SOAPService.java	2001/05/31 16:02:44	1.4
  +++ SOAPService.java	2001/06/07 14:02:06	1.5
  @@ -70,20 +70,20 @@
   public class SOAPService extends SimpleTargetedChain
   {
       public static final String OPTION_PIVOT = "pivot";
  -    
  +
  +    private static final SOAPTypeMappingRegistry soapTMR =
  +        new SOAPTypeMappingRegistry();
  +
       /** Service-specific type mappings
  -     * 
  -     * !!! This is just a test for now, these do not get serialized (and thus
  -     * restored) with the registered services.  This should come out of our
  -     * XML storage eventually.
  -     * 
        */
  -    private transient TypeMappingRegistry typeMap = new SOAPTypeMappingRegistry();
  +    private TypeMappingRegistry typeMap;
       
       /** Standard, no-arg constructor.
        */
       public SOAPService()
       {
  +        typeMap = new TypeMappingRegistry();
  +        typeMap.setParent(soapTMR);
       }
       
       public TypeMappingRegistry getTypeMappingRegistry()
  @@ -101,7 +101,7 @@
        */
       public SOAPService(Handler serviceHandler, String pivotName)
       {
  -        super();
  +        this();
           setPivotHandler(serviceHandler);
           addOption(OPTION_PIVOT, pivotName);
       }
  
  
  
  1.14      +4 -0      xml-axis/java/src/org/apache/axis/server/AxisServer.java
  
  Index: AxisServer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/server/AxisServer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AxisServer.java	2001/05/31 20:29:17	1.13
  +++ AxisServer.java	2001/06/07 14:02:11	1.14
  @@ -59,6 +59,7 @@
   import org.apache.axis.* ;
   import org.apache.axis.utils.* ;
   import org.apache.axis.handlers.* ;
  +import org.apache.axis.handlers.soap.* ;
   import org.apache.axis.registries.* ;
   import org.apache.axis.encoding.SOAPTypeMappingRegistry;
   import org.apache.axis.encoding.TypeMappingRegistry;
  @@ -113,6 +114,9 @@
           TypeMappingRegistry tmr = new TypeMappingRegistry("typemap-supp.reg");
           tmr.setParent(new SOAPTypeMappingRegistry());
           addOption( Constants.TYPEMAP_REGISTRY, tmr );
  +        Handler admin = sr.find("AdminService");
  +        if (admin != null && admin instanceof SOAPService)
  +          ((SOAPService)admin).setTypeMappingRegistry(tmr);
   
           Debug.Print( 1, "Exit: AxisServer::init" );
       }
  
  
  
  1.8       +24 -23    xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java
  
  Index: SimpleAxisServer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SimpleAxisServer.java	2001/05/31 09:24:45	1.7
  +++ SimpleAxisServer.java	2001/06/07 14:02:15	1.8
  @@ -139,7 +139,7 @@
           Message faultMsg = new Message(null, "AxisFault");
   
           // Accept and process requests from the socket
  -    while (!stopped) {
  +        while (!stopped) {
               Socket socket = null;
   
               // prepare request (do as much as possible while waiting for the
  @@ -149,14 +149,15 @@
               //   msgContext = new MessageContext();
               //   requestMsg = new Message("", "String");
               msgContext.setServiceDescription(null);
  +            msgContext.setTargetService(null);
               msgContext.setRequestMessage(requestMsg);
               msgContext.setResponseMessage(null);
               msgContext.clearProperties();
               msgContext.setProperty(MessageContext.TRANS_INPUT, transportInName);
               msgContext.setProperty(MessageContext.TRANS_OUTPUT, transportOutName);
  -        try {
  +            try {
                   try {
  -                socket = serverSocket.accept();
  +                    socket = serverSocket.accept();
                   } catch (IOException ioe) {
                       break;
                   }
  @@ -217,31 +218,31 @@
                   byte[] response = (byte[]) responseMsg.getAs("Bytes");
   
                   // Send it on its way...
  -        OutputStream out = socket.getOutputStream();
  -        out.write(HTTP);
  -        out.write(status);
  -        out.write(MIME_STUFF);
  -            putInt(out, response.length);
  -        out.write(SEPARATOR);
  +                OutputStream out = socket.getOutputStream();
  +                out.write(HTTP);
  +                out.write(status);
  +                out.write(MIME_STUFF);
  +                putInt(out, response.length);
  +                out.write(SEPARATOR);
                   out.write(response);
                   out.flush();
               
  -            if (msgContext.getProperty(msgContext.QUIT_REQUESTED) != null) {
  -                // why then, quit!
  -                this.stop();
  -            }
  +                if (msgContext.getProperty(msgContext.QUIT_REQUESTED) != null) {
  +                    // why then, quit!
  +                    this.stop();
  +                }
   
  -        } catch (InterruptedIOException iie) {
  -        break;
  -        } catch (Exception e) {
  -        e.printStackTrace();
  -        } finally {
  -        try {
  -            if (socket!=null) socket.close();
  -        } catch (Exception e) {
  -        }
  +            } catch (InterruptedIOException iie) {
  +                break;
  +            } catch (Exception e) {
  +                e.printStackTrace();
  +            } finally {
  +                try {
  +                    if (socket!=null) socket.close();
  +                } catch (Exception e) {
  +                }
  +            }
           }
  -    }
           System.out.println("SimpleAxisServer quitting.");
       }
   
  
  
  
  1.36      +32 -37    xml-axis/java/src/org/apache/axis/utils/Admin.java
  
  Index: Admin.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Admin.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- Admin.java	2001/06/02 04:01:19	1.35
  +++ Admin.java	2001/06/07 14:02:19	1.36
  @@ -385,6 +385,9 @@
             if ( service == null ) service = new SOAPService();
             else              service.clear();
             
  +          if (tmr != null)
  +            service.getTypeMappingRegistry().setParent(tmr.getParent());
  +
             if ( input != null && !"".equals(input) ) {
               st = new StringTokenizer( input, " \t\n\r\f," );
               c  = null ;
  @@ -451,51 +454,43 @@
       return( doc );
     }
   
  -  private void registerTypeMapping(Element elem, TypeMappingRegistry map)
  +  private void registerTypeMapping(Element root, TypeMappingRegistry map)
       throws Exception
     {
  -    String name = elem.getAttribute("name");
  -    if ((name == null) || name.equals(""))
  -      throw new AxisFault("Server.Admin.error",
  -                          "No name attribute in type mapping",
  -                          null, null);
  +    NodeList  list = root.getChildNodes();
  +    for ( int i = 0 ; list != null && i < list.getLength() ; i++ ) {
  +      Node    node  = list.item(i);
  +      if ( node.getNodeType() != Node.ELEMENT_NODE ) continue ;
  +      Element elem  = (Element) node ;
  +
  +      // Retrieve classname attribute
  +
  +      String classname = elem.getAttribute("classname");
  +      if ((classname == null) || classname.equals(""))
  +        throw new AxisFault("Server.Admin.error",
  +                            "No classname attribute in bean mapping",
  +                            null, null);
       
  -    // Resolve class name
  -
  -    Class cls;
  -    try {
  -      cls = Class.forName(name);
  -    } catch (Exception e) {
  -      throw new AxisFault( "Admin.error", e.toString(), null, null);
  -    }
  +      // Resolve class name
   
  -    // Resolve qname based on prefix and localpart
  +      Class cls;
  +      try {
  +        cls = Class.forName(classname);
  +      } catch (Exception e) {
  +        throw new AxisFault( "Admin.error", e.toString(), null, null);
  +      }
   
  -    String qname = elem.getAttribute( "qname" );
  -    if (qname == null)
  -      throw new AxisFault( "Admin.error",
  -        "Missing qname in bean " + name, null, null);
  -
  -    int pos = qname.indexOf(':');
  -    if (pos < 0)
  -      throw new AxisFault( "Admin.error",
  -        "Missing namespace in qname " + qname,
  -        null, null);
  -
  -    String prefix = qname.substring(0, pos);
  -    String localPart = qname.substring(pos+1);
  -    String namespace = XMLUtils.getNamespace(prefix, elem);
  -    if (namespace == null)
  -      throw new AxisFault( "Admin.error",
  -        "Unknown namespace in qname " + qname,
  -        null, null);
  +      // Resolve qname based on prefix and localpart
   
  -    QName qn = new QName(namespace, localPart);
  +      String namespaceURI = elem.getNamespaceURI();
  +      String localName    = elem.getLocalName();
  +      QName qn = new QName(namespaceURI, localName);
   
  -    // register both serializers and deserializers for this bean
  +      // register both serializers and deserializers for this bean
   
  -    map.addSerializer(cls, qn, new BeanSerializer(cls));
  -    map.addDeserializerFactory(qn, cls, BeanSerializer.getFactory(cls));
  +      map.addSerializer(cls, qn, new BeanSerializer(cls));
  +      map.addDeserializerFactory(qn, cls, BeanSerializer.getFactory(cls));
  +    }
     }
     
     public static void main(String args[]) throws Exception {
  
  
  
  1.10      +1 -1      xml-axis/java/src/org/apache/axis/utils/QName.java
  
  Index: QName.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/QName.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- QName.java	2001/05/22 23:52:19	1.9
  +++ QName.java	2001/06/07 14:02:20	1.10
  @@ -61,7 +61,7 @@
    * @author Doug Davis (dug@us.ibm.com)
    * @author James Snell (jasnell@us.ibm.com)
    */
  -public class QName {
  +public class QName implements java.io.Serializable {
    
       private String namespaceURI ;
       private String localPart ;
  
  
  
  1.7       +1 -6      xml-axis/java/test/RPCDispatch/TestRPC.java
  
  Index: TestRPC.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/RPCDispatch/TestRPC.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestRPC.java	2001/06/04 18:56:55	1.6
  +++ TestRPC.java	2001/06/07 14:02:26	1.7
  @@ -70,12 +70,7 @@
           MessageContext msgContext = new MessageContext();
           msgContext.setProperty(Constants.SERVICE_REGISTRY, sr);
           msgContext.setRequestMessage(new Message(envelope, "SOAPEnvelope"));
  -        try {
  -                msgContext.setTargetService(SOAPAction);
  -        } catch (AxisFault f) {
  -            System.err.println("Faulted when setting target service to SOAPAction");
  -            throw f;
  -        }
  +        msgContext.setTargetService(SOAPAction);
   
           // Invoke the Axis engine
           try {
  
  
  

Mime
View raw message