axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: xml-axis/java/test/faults FaultDecode.java
Date Fri, 02 Nov 2001 03:07:43 GMT
robj        01/11/01 19:07:43

  Modified:    java     build.xml
               java/samples/transport FileReader.java FileSender.java
               java/samples/transport/tcp TCPListener.java TCPSender.java
               java/src/org/apache/axis Message.java
               java/src/org/apache/axis/client Call.java
               java/src/org/apache/axis/encoding SerializationContext.java
               java/src/org/apache/axis/handlers DebugHandler.java
                        EchoHandler.java LogHandler.java
                        SimpleSessionHandler.java
               java/src/org/apache/axis/handlers/soap SOAPService.java
               java/src/org/apache/axis/message MessageElement.java
               java/src/org/apache/axis/providers/java JavaProvider.java
               java/src/org/apache/axis/server AxisServer.java
               java/src/org/apache/axis/transport/http AxisServlet.java
                        HTTPSender.java SimpleAxisServer.java
               java/src/org/apache/axis/transport/local LocalResponder.java
                        LocalSender.java
               java/test put.java
               java/test/RPCDispatch Service.java TestRPC.java
                        TestSerializedRPC.java
               java/test/encoding TestBody.java TestDOM.java TestDeser.java
                        TestHrefs.java TestSer.java
               java/test/faults FaultDecode.java
  Added:       java/src/org/apache/axis Part.java SOAPPart.java
               java/src/org/apache/axis/attachments AttachmentPart.java
                        Attachments.java AttachmentsImpl.java
  Log:
  First pass at support classes for attachments.
  Does not actually do any MIME yet!
  - Added Part, with SOAPPart and AttachmentPart subclasses, paralleling JAXM.
  - Message now simply gives access to Parts.
  - SOAPPart has the various getAs...() methods formerly in Message.
  - activation.jar is optional -- if you do not have it on your classpath, most of the
    attachments classes will not get built, and you will have no access to
    attachments.
  I have not repackaged any existing classes.  Yet.  I plan to, as the feedback
  seemed generally positive.
  Next up: fleshing out the MIME methods, and actually using writeTo() in
  appropriate places.
  After that: actually sending MIME envelopes!
  
  Revision  Changes    Path
  1.74      +8 -0      xml-axis/java/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/build.xml,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- build.xml	2001/10/31 23:50:18	1.73
  +++ build.xml	2001/11/02 03:07:40	1.74
  @@ -124,6 +124,10 @@
         classname="org.apache.avalon.excalibur.cli.CLUtil"
         classpathref="classpath"/>
   
  +    <available property="activation.present"
  +      classname="javax.activation.DataHandler"
  +      classpathref="classpath"/>
  +
       <available property="post-compile.present" file="post-compile.xml" />
   
       <echo message="--- Build environment for ${Name} ---" />
  @@ -138,6 +142,7 @@
       <echo message="--- Optional Libraries ---" />
       <echo message="servlet.present=${servlet.present}" />
       <echo message="junit.present=${junit.present}" />
  +    <echo message="activation.present=${activation.present}" />
       <echo message=""/>
       <echo message="--- Property values ---" />
       <echo message="debug=${debug}" />
  @@ -159,6 +164,9 @@
         classpathref="classpath">
         <exclude name="**/old/**/*" />
         <exclude name="**/bak/**"/>
  +      <exclude name="org/apache/axis/attachments/AttachmentsImpl.java" unless="activation.present"/>
  +      <exclude name="org/apache/axis/attachments/AttachmentPart.java" unless="activation.present"/>
  +      <exclude name="org/apache/axis/attachments/MimeUtil.java" unless="activation.present"/>
         <exclude name="org/apache/axis/transport/http/AdminServlet.java" unless="servlet.present"/>
         <exclude name="org/apache/axis/transport/http/AxisHttpSession.java" unless="servlet.present"/>
         <exclude name="org/apache/axis/transport/http/AxisServlet.java" unless="servlet.present"/>
  
  
  
  1.19      +2 -2      xml-axis/java/samples/transport/FileReader.java
  
  Index: FileReader.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/FileReader.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- FileReader.java	2001/10/30 16:46:32	1.18
  +++ FileReader.java	2001/11/02 03:07:40	1.19
  @@ -96,7 +96,7 @@
           int thisNum = nextNum++; // increment early to avoid infinite loops
           
           Message msg = new Message( fis );
  -        msg.getAsBytes();
  +        msg.getSOAPPart().getAsBytes();
   
           fis.close();
           file.delete();
  @@ -115,7 +115,7 @@
               msg.setMessageContext(msgContext);
           }
           
  -        byte[] buf = (byte[]) msg.getAsBytes();
  +        byte[] buf = (byte[]) msg.getSOAPPart().getAsBytes();
           FileOutputStream fos = new FileOutputStream( "xml" + thisNum + ".res" );
           fos.write( buf );
           fos.close();
  
  
  
  1.11      +2 -2      xml-axis/java/samples/transport/FileSender.java
  
  Index: FileSender.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/FileSender.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FileSender.java	2001/10/30 16:46:32	1.10
  +++ FileSender.java	2001/11/02 03:07:40	1.11
  @@ -81,7 +81,7 @@
   
     public void invoke(MessageContext msgContext) throws AxisFault {
       Message  msg = msgContext.getRequestMessage();
  -    byte[]   buf = (byte[]) msg.getAsBytes();
  +    byte[]   buf = (byte[]) msg.getSOAPPart().getAsBytes();
       boolean timedOut = false;
       try {
         FileOutputStream fos = new FileOutputStream( "xml" + nextNum + ".req" );
  @@ -109,7 +109,7 @@
           Thread.sleep( 100 );   // let the other side finish writing
           FileInputStream fis = new FileInputStream( "xml" + nextNum + ".res" );
           msg = new Message( fis );
  -        msg.getAsBytes();  // just flush the buffer
  +        msg.getSOAPPart().getAsBytes();  // just flush the buffer
           fis.close();
            Thread.sleep( 100 );
           (new File("xml" + nextNum + ".res")).delete();
  
  
  
  1.12      +1 -1      xml-axis/java/samples/transport/tcp/TCPListener.java
  
  Index: TCPListener.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/tcp/TCPListener.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TCPListener.java	2001/11/01 13:12:31	1.11
  +++ TCPListener.java	2001/11/02 03:07:40	1.12
  @@ -258,7 +258,7 @@
               /* Send it back along the wire...  */
               /***********************************/
               msg = msgContext.getResponseMessage();
  -            String response = (String) msg.getAsString();
  +            String response = (String) msg.getSOAPPart().getAsString();
               if (msg == null) response="No data";
               try {
                   OutputStream buf = new BufferedOutputStream(socket.getOutputStream());
  
  
  
  1.11      +2 -2      xml-axis/java/samples/transport/tcp/TCPSender.java
  
  Index: TCPSender.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/tcp/TCPSender.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TCPSender.java	2001/10/30 16:46:32	1.10
  +++ TCPSender.java	2001/11/02 03:07:40	1.11
  @@ -96,7 +96,7 @@
               sock    = new Socket( host, port );
               category.info( "Created an insecure HTTP connection");
   
  -            reqEnv  = (String) msgContext.getRequestMessage().getAsString();
  +            reqEnv  = (String) msgContext.getRequestMessage().getSOAPPart().getAsString();
   
               //System.out.println("Msg: " + reqEnv);
   
  @@ -128,7 +128,7 @@
                   category.debug( "\nNo Content-Length" );
                   category.debug( "\nXML received:" );
                   category.debug( "-----------------------------------------------");
  -                category.debug( (String) outMsg.getAsString() );
  +                category.debug( (String) outMsg.getSOAPPart().getAsString() );
               }
   
               msgContext.setResponseMessage( outMsg );
  
  
  
  1.50      +112 -238  xml-axis/java/src/org/apache/axis/Message.java
  
  Index: Message.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Message.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- Message.java	2001/10/30 16:46:34	1.49
  +++ Message.java	2001/11/02 03:07:40	1.50
  @@ -53,23 +53,25 @@
    * <http://www.apache.org/>.
    */
   
  -package org.apache.axis ;
  +package org.apache.axis;
   
  -import org.apache.axis.encoding.DeserializationContext;
  -import org.apache.axis.encoding.SerializationContext;
  -import org.apache.axis.message.InputStreamBody;
  -import org.apache.axis.message.SOAPEnvelope;
   import org.apache.log4j.Category;
  -import org.xml.sax.InputSource;
  -import org.xml.sax.SAXException;
   
  -import java.io.ByteArrayOutputStream;
  +import org.apache.axis.attachments.Attachments;
  +
   import java.io.InputStream;
  -import java.io.StringReader;
  -import java.io.StringWriter;
  +import java.lang.reflect.Constructor;
  +import java.lang.reflect.InvocationTargetException;
   
   /**
  + * A complete SOAP (and/or XML-RPC, eventually) message.
  + * Includes both the root part (as a SOAPPart), and zero or
  + * more MIME attachments (as AttachmentParts).
  + * <p>
  + * Eventually should be refactored to generalize SOAPPart
  + * for multiple protocols (XML-RPC?).
    *
  + * @author Rob Jellinghaus (robj@unrealities.com)
    * @author Doug Davis (dug@us.ibm.com)
    * @author Glen Daniels (gdaniels@allaire.com)
    */
  @@ -77,82 +79,29 @@
       static Category category =
               Category.getInstance(Message.class.getName());
   
  -    /**
  -     * Just a placeholder until we figure out what the actual Message
  -     * object is.
  -     */
  -    private Object originalMessage ;
  -    private Object currentMessage ;
  -
       public static final String REQUEST  = "request" ;
       public static final String RESPONSE = "response" ;
   
  -    private static final int FORM_STRING       = 1;
  -    private static final int FORM_INPUTSTREAM  = 2;
  -    private static final int FORM_SOAPENVELOPE = 3;
  -    private static final int FORM_BYTES        = 4;
  -    private static final int FORM_BODYINSTREAM = 5;
  -    private static final int FORM_FAULT        = 6;
  -    private int currentForm ;
  -
  -    private static final String[] formNames =
  -    { "", "FORM_STRING", "FORM_INPUTSTREAM", "FORM_SOAPENVELOPE",
  -      "FORM_BYTES", "FORM_BODYINSTREAM", "FORM_FAULT" };
  -
  -    private String messageType ;
  -    private MessageContext msgContext;
  -
       /**
  -     * Just something to us working...
  +     * The messageType indicates whether this is request or response.
        */
  -    public Message(String stringForm) {
  -        category.debug( "Enter Message ctor (String)" );
  -        originalMessage = stringForm;
  -        setCurrentMessage(stringForm, FORM_STRING);
  -    }
  -
  -    public Message(SOAPEnvelope env) {
  -        category.debug( "Enter Message ctor (SOAPEnvelope)" );
  -        originalMessage = env;
  -        setCurrentMessage(env, FORM_SOAPENVELOPE);
  -    }
  -
  -    public Message(InputStream inputStream) {
  -        category.debug( "Enter Message ctor (InputStream)" );
  -        originalMessage = inputStream;
  -        setCurrentMessage(inputStream, FORM_INPUTSTREAM);
  -    }
  -
  -    public Message(InputStream inputStream, boolean isBody) {
  -        category.debug( "Enter Message ctor (BodyInputStream)" );
  -        originalMessage = inputStream;
  -        setCurrentMessage(inputStream, isBody ? FORM_BODYINSTREAM :
  -                                                FORM_INPUTSTREAM);
  -    }
  -
  -    public Message(byte [] bytes) {
  -        category.debug("Enter Message ctor (byte[])" );
  -        originalMessage = bytes;
  -        setCurrentMessage(bytes, FORM_BYTES);
  -    }
  -
  -    public Message(AxisFault fault) {
  -        category.debug("Enter Message ctor (AxisFault)" );
  -        originalMessage = fault;
  -        setCurrentMessage(fault, FORM_FAULT);
  -    }
  -
  -    public Object getOriginalMessage() {
  -        return( originalMessage );
  -    }
  -
  -    public Object getCurrentMessage() {
  -        return( currentMessage );
  -    }
  -
  -    private int getCurrentForm() {
  -        return( currentForm );
  -    }
  +    private String messageType;
  +    
  +    /**
  +     * This Message's SOAPPart.  Will always be here.
  +     */
  +    private SOAPPart mSOAPPart;
  +    
  +    /**
  +     * This Message's Attachments object, which manages the attachments
  +     * contained in this Message.
  +     */
  +    private Attachments mAttachments;
  +    
  +    /**
  +     * The MessageContext we are associated with.
  +     */
  +    private MessageContext msgContext;
   
       public String getMessageType()
       {
  @@ -172,165 +121,90 @@
       {
           this.msgContext = msgContext;
       }
  -
  -    private void setCurrentMessage(Object currMsg, int form) {
  -        category.debug( "Setting current message form to: " +
  -                        formNames[form] +" (currentMessage is now " +
  -                        currMsg + ")" );
  -        currentMessage = currMsg ;
  -        currentForm = form ;
  -    }
  -
  -    public byte[] getAsBytes() {
  -        category.debug( "Enter: Message::getAsBytes" );
  -        if ( currentForm == FORM_BYTES ) {
  -            category.debug( "Exit: Message::getAsBytes" );
  -            return( (byte[]) currentMessage );
  -        }
  -
  -        if ( currentForm == FORM_BODYINSTREAM ) {
  -            try {
  -                getAsSOAPEnvelope();
  -            } catch (Exception e) {
  -                category.fatal("Couldn't make envelope", e);
  -                return null;
  -            }
  -        }
  -
  -        if ( currentForm == FORM_INPUTSTREAM ) {
  -            // Assumes we don't need a content length
  -            try {
  -                InputStream  inp = (InputStream) currentMessage ;
  -                ByteArrayOutputStream  baos = new ByteArrayOutputStream();
  -                byte[]  buf = new byte[4096];
  -                int len ;
  -                while ( (len = inp.read(buf,0,4096)) != -1 )
  -                    baos.write( buf, 0, len );
  -                buf = baos.toByteArray();
  -                // int len = inp.available();
  -                // byte[]  buf = new byte[ len ];
  -                // inp.read( buf );
  -                setCurrentMessage( buf, FORM_BYTES );
  -                category.debug( "Exit: Message::getAsByes" );
  -                return( (byte[]) currentMessage );
  -            }
  -            catch( Exception e ) {
  -                e.printStackTrace( System.err );
  -            }
  -            category.debug( "Exit: Message::getAsByes" );
  -            return( null );
  -        }
  -
  -        if ( currentForm == FORM_SOAPENVELOPE ||
  -             currentForm == FORM_FAULT )
  -            getAsString();
  -
  -        if ( currentForm == FORM_STRING ) {
  -            setCurrentMessage( ((String)currentMessage).getBytes(),
  -                               FORM_BYTES );
  -            category.debug( "Exit: Message::getAsBytes" );
  -            return( (byte[]) currentMessage );
  -        }
  -
  -        System.err.println("Can't convert " + currentForm + " to Bytes" );
  -        category.debug( "Exit: Message::getAsBytes" );
  -        return( null );
  +    
  +    /**
  +     * Get this message's Content-Length in bytes (which will include any
  +     * MIME part dividers, but will not include any transport headers).
  +     */
  +    public int getContentLength () {
  +        // TODO: something real!
  +		return mSOAPPart.getContentLength();
       }
  -
  -    public String getAsString() {
  -        category.debug( "Enter: Message::getAsString" );
  -        if ( currentForm == FORM_STRING ) {
  -            category.debug( "Exit: Message::getAsString, currentMessage is "+
  -                            currentMessage );
  -            return( (String) currentMessage );
  -        }
  -
  -        if ( currentForm == FORM_INPUTSTREAM ||
  -             currentForm == FORM_BODYINSTREAM ) {
  -            getAsBytes();
  -            // Fall thru to "Bytes"
  -        }
  -
  -        if ( currentForm == FORM_BYTES ) {
  -            setCurrentMessage( new String((byte[]) currentMessage),
  -                               FORM_STRING );
  -            category.debug( "Exit: Message::getAsString, currentMessage is "+
  -                            currentMessage );
  -            return( (String) currentMessage );
  -        }
  -
  -        if ( currentForm == FORM_FAULT ) {
  -            StringWriter writer = new StringWriter();
  -            AxisFault env = (AxisFault)currentMessage;
  -            try {
  -                env.output(new SerializationContext(writer, msgContext));
  -            } catch (Exception e) {
  -                e.printStackTrace();
  -                return null;
  -            }
  -            setCurrentMessage(writer.getBuffer().toString(), FORM_STRING);
  -            return (String)currentMessage;
  -        }
  -
  -        if ( currentForm == FORM_SOAPENVELOPE ) {
  -            StringWriter writer = new StringWriter();
  -            SOAPEnvelope env = (SOAPEnvelope)currentMessage;
  -            try {
  -                env.output(new SerializationContext(writer, msgContext));
  -            } catch (Exception e) {
  -                e.printStackTrace();
  -                return null;
  -            }
  -            setCurrentMessage(writer.getBuffer().toString(), FORM_STRING);
  -            return (String)currentMessage;
  -        }
  -
  -        System.err.println("Can't convert form " + currentForm +
  -                           " to String" );
  -        category.debug( "Exit: Message::getAsString" );
  -        return( null );
  +    
  +    /**
  +     * Construct a Message, using the provided initialContents as the
  +     * contents of the Message's SOAPPart.
  +     * <p>
  +     * Eventually, genericize this to
  +     * return the RootPart instead, which will have some kind of
  +     * EnvelopeFactory to enable support for things other than SOAP.
  +     * But that all will come later, with lots of additional refactoring.
  +	 *
  +	 * @param initialContents may be String, byte[], InputStream, SOAPEnvelope, or AxisFault.
  +     * @param bodyInStream is true if initialContents is an InputStream containing just
  +     * the SOAP body (no SOAP-ENV).
  +     */
  +    public Message (Object initialContents, boolean bodyInStream) {
  +		setup(initialContents, bodyInStream);
       }
  -
  -    public SOAPEnvelope getAsSOAPEnvelope()
  -        throws AxisFault
  -    {
  -        category.debug( "Enter: Message::getAsSOAPEnvelope; currentForm is "+
  -                        formNames[currentForm] );
  -        if ( currentForm == FORM_SOAPENVELOPE )
  -            return( (SOAPEnvelope) currentMessage );
  -
  -        if (currentForm == FORM_BODYINSTREAM) {
  -            InputStreamBody bodyEl =
  -                             new InputStreamBody((InputStream)currentMessage);
  -            SOAPEnvelope env = new SOAPEnvelope();
  -            env.addBodyElement(bodyEl);
  -            setCurrentMessage(env, FORM_SOAPENVELOPE);
  -            return env;
  -        }
  -
  -        InputSource is;
  -
  -        if ( currentForm == FORM_INPUTSTREAM ) {
  -            is = new InputSource( (InputStream) currentMessage );
  -        } else {
  -            is = new InputSource(new StringReader(getAsString()));
  -        }
  -        DeserializationContext dser =
  -            new DeserializationContext(is, msgContext, messageType);
  -
  -        // This may throw a SAXException
  +	
  +	/**
  +	 * Construct a Message.  An overload of Message(Object, boolean),
  +	 * defaulting bodyInStream to false.
  +	 */
  +	public Message (Object initialContents) {
  +		setup(initialContents, false);
  +	}
  +    
  +	/**
  +	 * Do the work of construction.
  +	 */
  +	private void setup (Object initialContents, boolean bodyInStream) {
  +        mSOAPPart = new SOAPPart(this, initialContents, bodyInStream);
  +        
  +        // Try to construct an AttachmentsImpl object for attachment functionality.
  +        // If there is no org.apache.axis.attachments.AttachmentsImpl class,
  +        // it must mean activation.jar is not present and attachments are not
  +        // supported.
           try {
  -            dser.parse();
  -        } catch (SAXException e) {
  -            Exception real = e.getException();
  -            if (real == null)
  -                real = e;
  -            throw new AxisFault(real);
  +            Class attachImpl = Class.forName("org.apache.axis.attachments.AttachmentsImpl");
  +            // Construct one, and cast to Attachments.
  +            // There must be exactly one constructor of AttachmentsImpl, which must
  +            // take an org.apache.axis.Message!
  +            Constructor attachImplConstr = attachImpl.getConstructors()[0];
  +            Object[] args = new Object[1];
  +            args[0] = this;
  +            mAttachments = (Attachments)attachImplConstr.newInstance(args);
  +        } catch (ClassNotFoundException ex) {
  +            // no support for it, leave mAttachments null.
  +        } catch (InvocationTargetException ex) {
  +            // no support for it, leave mAttachments null.
  +        } catch (InstantiationException ex) {
  +            // no support for it, leave mAttachments null.
  +        } catch (IllegalAccessException ex) {
  +            // no support for it, leave mAttachments null.
           }
  -
  -        setCurrentMessage(dser.getEnvelope(), FORM_SOAPENVELOPE);
  -        category.debug( "Exit: Message::getAsSOAPEnvelope" );
  -        return( (SOAPEnvelope) currentMessage );
  +	}
  +	
  +    /**
  +     * Get this message's SOAPPart.
  +	 * <p>
  +	 * Eventually, this should be generalized beyond just SOAP,
  +	 * but it's hard to know how to do that without necessitating
  +	 * a lot of casts in client code.  Refactoring keeps getting
  +	 * easier anyhow.
  +     */
  +    public SOAPPart getSOAPPart () {
  +        return mSOAPPart;
       }
  -
  -};
  +            
  +    /**
  +     * Get the Attachments of this Message.
  +     * If this returns null, then NO ATTACHMENT SUPPORT EXISTS in this
  +     * configuration of Axis, and no attachment operations may be
  +     * performed.
  +     */
  +    public Attachments getAttachments () {
  +        return mAttachments;
  +    }
  +}
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/Part.java
  
  Index: Part.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;
  
  import java.io.IOException;
  import java.io.OutputStream;
  import java.util.Hashtable;
  
  /**
   * A MIME component of an Axis Message.
   * <p>
   * Loosely based on javax.xml.soap.SOAPPart and javax.xml.soap.AttachmentPart.
   * (Why don't <i>they</i> have a Part superclass?)
   * <p>
   * In general, all methods of Part and its subclasses are (or should
   * be) implemented as efficiently as possible.  No buffering is done
   * unless necessary.  (Look-ahead (and hence buffering) is necessary
   * when calculating content length.)
   *
   * @author Rob Jellinghaus (robj@unrealities.com)
   */
  
  public abstract class Part {
  
      private Message msg;
      private Hashtable headers = new Hashtable();
      private String contentId;
      private String contentLocation;
      
      private static String CONTENT_ID_HEADER = "Content-Id";
      private static String CONTENT_LOCATION_HEADER = "Content-Location";
      
      /**
       * Fill in the Message field.  (Of course this can only be called by
       * subclass constructors since Part itself is abstract.)
       */
      public Part (Message parent) {
          msg = parent;
      }
  
      /**
       * Add the specified MIME header, as per JAXM.
       */
      public void addMimeHeader (String header, String value) {
          headers.put(header, value);
      }
  
      /**
       * Get the specified MIME header.
       */
      public String getMimeHeader (String header) {
          return (String) headers.get(header);
      }
      
      /**
       * Get the Message for this Part.
       */
      public Message getMessage () {
          return msg;
      }
      
      /**
       * Add getAllMimeHeaders later....
       */ 
      
      /**
       * Content length (length in bytes of the encoded content only, no headers).
       */
      public abstract int getContentLength();
  
      /**
       * Total size in bytes (of all content and headers, as encoded).
       */
      public abstract int getSize();
  
      /**
       * Content location.
       */
      public String getContentLocation() {
          return getMimeHeader(CONTENT_LOCATION_HEADER);
      }
  
      /**
       * Set content location.
       */
      public void setContentLocation(String loc) {
          addMimeHeader(CONTENT_LOCATION_HEADER, loc);
      }
  
      /**
       * Content ID.
       */
      public String getContentId() {
          return getMimeHeader(CONTENT_ID_HEADER);
      }
  
      /**
       * Set content ID.
       */
      public void setContentId(String id) {
          addMimeHeader(CONTENT_ID_HEADER, id);
      }
  
      /**
       * Content type.
       */
      public abstract String getContentType();
  
      /**
       * Writing.  Writes all bytes, including headers (i.e. writes
       * getSize() bytes).
       * 
       * ROBJDO: make this package method?
       */
      public abstract void writeTo(OutputStream out) throws IOException;
  }
  
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/SOAPPart.java
  
  Index: SOAPPart.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 ;
  
  import org.apache.axis.encoding.DeserializationContext;
  import org.apache.axis.encoding.SerializationContext;
  import org.apache.axis.message.InputStreamBody;
  import org.apache.axis.message.SOAPEnvelope;
  import org.apache.log4j.Category;
  import org.xml.sax.InputSource;
  import org.xml.sax.SAXException;
  
  import java.io.*;
  
  /**
   * The SOAPPart provides access to the root part of the Message which
   * contains the envelope.
   * <p>
   * SOAPPart implements Part, providing common MIME operations.
   * <p>
   * SOAPPart also allows access to its envelope,
   * as a string, byte[], InputStream, or SOAPEnvelope.  (This functionality
   * used to be in Message, and has been moved here more or less verbatim
   * pending further cleanup.)
   *
   * @author Rob Jellinghaus (robj@unrealities.com)
   * @author Doug Davis (dug@us.ibm.com)
   * @author Glen Daniels (gdaniels@allaire.com)
   */
  public class SOAPPart extends Part {
      static Category category = Category.getInstance(Message.class.getName());
  
      private static final int FORM_STRING       = 1;
      private static final int FORM_INPUTSTREAM  = 2;
      private static final int FORM_SOAPENVELOPE = 3;
      private static final int FORM_BYTES        = 4;
      private static final int FORM_BODYINSTREAM = 5;
      private static final int FORM_FAULT        = 6;
      private int currentForm;
  
      private static final String[] formNames =
      { "", "FORM_STRING", "FORM_INPUTSTREAM", "FORM_SOAPENVELOPE",
        "FORM_BYTES", "FORM_BODYINSTREAM", "FORM_FAULT" };
  
      /**
       * The current representation of the SOAP contents of this part.
       * May be a String, byte[], InputStream, or SOAPEnvelope, depending
       * on whatever was last asked for.  (ack)
       * <p>
       * currentForm must have the corresponding value.
       * <p>
       * As someone once said:  "Just a placeholder until we figure out what the actual Message
       * object is."
       */
      private Object currentMessage ;
      
      /**
       * The original message.  Again, may be String, byte[], InputStream,
       * or SOAPEnvelope.
       */
      private Object originalMessage ;
  
      /**
       * Do not call this directly!  Should only be called by Message.
       * As this method's comment once read:
       * "Just something to us working..."
       */
      public SOAPPart(Message parent, Object initialContents, boolean isBodyStream) {
          super(parent);
          originalMessage = initialContents;
          int form = FORM_STRING;
          if (initialContents instanceof SOAPEnvelope) {
              form = FORM_SOAPENVELOPE;
          } else if (initialContents instanceof InputStream) {
              form = isBodyStream ? FORM_BODYINSTREAM : FORM_INPUTSTREAM;
          } else if (initialContents instanceof byte[]) {
              form = FORM_BYTES;
          } else if (initialContents instanceof AxisFault) {
              form = FORM_FAULT;
          }
          if (category.isDebugEnabled()) {
              category.debug( "Enter SOAPPart ctor ("+formNames[form]+")" );
          }
          setCurrentMessage(initialContents, form);
      }
  
      public Object getOriginalMessage() {
          return( originalMessage );
      }
  
      /**
       * Content type is always "text/xml" for SOAPParts.
       */
      public String getContentType() {
          return "text/xml";
      }
  
      /**
       * Get the content length for this SOAPPart.
       * This will force buffering of the SOAPPart, but it will
       * also cache the byte[] form of the SOAPPart.
       */
      public int getContentLength() {
          byte[] bytes = this.getAsBytes();
          return bytes.length;
      }
  
      /**
       * Get the total size in bytes, including headers, of this Part.
       * TODO: For now, since we aren't actually doing MIME yet,
       * this is the same as getContentLength().  Soon it will be
       * different.
       */
      public int getSize() {
          // for now, we don't ever do headers!  ha ha
          return this.getContentLength();
      }
  
      /**
       * Write out the contents & headers to out.
       * TODO: actually write headers!  probably also add parameter
       * to indicate whether to bother....
       */
      public void writeTo(OutputStream out) throws IOException {
          out.write(this.getAsBytes());
          // easy, huh?
      }
  
      /**
       * Get the current message, in whatever form it happens to be right now.
       * Will return a String, byte[], InputStream, or SOAPEnvelope, depending
       * on circumstances.
       * <p>
       * The method name is historical.
       * TODO: rename this for clarity; should be more like getContents.
       */
      public Object getCurrentMessage() {
          return( currentMessage );
      }
  
      /**
       * Set the current contents of this Part.
       * The method name is historical.
       * TODO: rename this for clarity to something more like setContents???
       */
      private void setCurrentMessage(Object currMsg, int form) {
          if (category.isDebugEnabled()) {
              category.debug( "Setting current message form to: " +
                          formNames[form] +" (currentMessage is now " +
                          currMsg + ")" );
          }
          currentMessage = currMsg ;
          currentForm = form ;
      }
  
      /**
       * Get the contents of this Part (not the headers!), as a byte
       * array.  This will force buffering of the message.
       */
      public byte[] getAsBytes() {
          category.debug( "Enter: SOAPPart::getAsBytes" );
          if ( currentForm == FORM_BYTES ) {
              category.debug( "Exit: SOAPPart::getAsBytes" );
              return( (byte[]) currentMessage );
          }
  
          if ( currentForm == FORM_BODYINSTREAM ) {
              try {
                  getAsSOAPEnvelope();
              } catch (Exception e) {
                  category.fatal("Couldn't make envelope", e);
                  return null;
              }
          }
  
          if ( currentForm == FORM_INPUTSTREAM ) {
              // Assumes we don't need a content length
              try {
                  InputStream  inp = (InputStream) currentMessage ;
                  ByteArrayOutputStream  baos = new ByteArrayOutputStream();
                  byte[]  buf = new byte[4096];
                  int len ;
                  while ( (len = inp.read(buf,0,4096)) != -1 )
                      baos.write( buf, 0, len );
                  buf = baos.toByteArray();
                  // int len = inp.available();
                  // byte[]  buf = new byte[ len ];
                  // inp.read( buf );
                  setCurrentMessage( buf, FORM_BYTES );
                  category.debug( "Exit: SOAPPart::getAsByes" );
                  return( (byte[]) currentMessage );
              }
              catch( Exception e ) {
                  e.printStackTrace( System.err );
              }
              category.debug( "Exit: SOAPPart::getAsByes" );
              return( null );
          }
  
          if ( currentForm == FORM_SOAPENVELOPE ||
               currentForm == FORM_FAULT )
              getAsString();
  
          if ( currentForm == FORM_STRING ) {
              setCurrentMessage( ((String)currentMessage).getBytes(),
                                 FORM_BYTES );
              category.debug( "Exit: SOAPPart::getAsBytes" );
              return( (byte[]) currentMessage );
          }
  
          System.err.println("Can't convert " + currentForm + " to Bytes" );
          category.debug( "Exit: SOAPPart::getAsBytes" );
          return( null );
      }
  
      /**
       * Get the contents of this Part (not the headers!), as a String.
       * This will force buffering of the message.
       */
      public String getAsString() {
          category.debug( "Enter: SOAPPart::getAsString" );
          if ( currentForm == FORM_STRING ) {
              category.debug( "Exit: SOAPPart::getAsString, currentMessage is "+
                              currentMessage );
              return( (String) currentMessage );
          }
  
          if ( currentForm == FORM_INPUTSTREAM ||
               currentForm == FORM_BODYINSTREAM ) {
              getAsBytes();
              // Fall thru to "Bytes"
          }
  
          if ( currentForm == FORM_BYTES ) {
              setCurrentMessage( new String((byte[]) currentMessage),
                                 FORM_STRING );
              category.debug( "Exit: SOAPPart::getAsString, currentMessage is "+
                              currentMessage );
              return( (String) currentMessage );
          }
  
          if ( currentForm == FORM_FAULT ) {
              StringWriter writer = new StringWriter();
              AxisFault env = (AxisFault)currentMessage;
              try {
                  env.output(new SerializationContext(writer, getMessage().getMessageContext()));
              } catch (Exception e) {
                  e.printStackTrace();
                  return null;
              }
              setCurrentMessage(writer.getBuffer().toString(), FORM_STRING);
              return (String)currentMessage;
          }
  
          if ( currentForm == FORM_SOAPENVELOPE ) {
              StringWriter writer = new StringWriter();
              SOAPEnvelope env = (SOAPEnvelope)currentMessage;
              try {
                  env.output(new SerializationContext(writer, getMessage().getMessageContext()));
              } catch (Exception e) {
                  e.printStackTrace();
                  return null;
              }
              setCurrentMessage(writer.getBuffer().toString(), FORM_STRING);
              return (String)currentMessage;
          }
  
          System.err.println("Can't convert form " + currentForm +
                             " to String" );
          category.debug( "Exit: SOAPPart::getAsString" );
          return( null );
      }
  
      /**
       * Get the contents of this Part (not the MIME headers!), as a
       * SOAPEnvelope.  This will force a complete parse of the
       * message.
       */
      public SOAPEnvelope getAsSOAPEnvelope()
          throws AxisFault
      {
          category.debug( "Enter: SOAPPart::getAsSOAPEnvelope; currentForm is "+
                          formNames[currentForm] );
          if ( currentForm == FORM_SOAPENVELOPE )
              return( (SOAPEnvelope) currentMessage );
  
          if (currentForm == FORM_BODYINSTREAM) {
              InputStreamBody bodyEl =
                               new InputStreamBody((InputStream)currentMessage);
              SOAPEnvelope env = new SOAPEnvelope();
              env.addBodyElement(bodyEl);
              setCurrentMessage(env, FORM_SOAPENVELOPE);
              return env;
          }
  
          InputSource is;
  
          if ( currentForm == FORM_INPUTSTREAM ) {
              is = new InputSource( (InputStream) currentMessage );
          } else {
              is = new InputSource(new StringReader(getAsString()));
          }
          DeserializationContext dser =
              new DeserializationContext(is, getMessage().getMessageContext(), getMessage().getMessageType());
  
          // This may throw a SAXException
          try {
              dser.parse();
          } catch (SAXException e) {
              Exception real = e.getException();
              if (real == null)
                  real = e;
              throw new AxisFault(real);
          }
  
          setCurrentMessage(dser.getEnvelope(), FORM_SOAPENVELOPE);
          category.debug( "Exit: SOAPPart::getAsSOAPEnvelope" );
          return( (SOAPEnvelope) currentMessage );
      }
  
  }
  
  
  
  
  1.31      +4 -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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Call.java	2001/10/30 16:46:35	1.30
  +++ Call.java	2001/11/02 03:07:40	1.31
  @@ -60,6 +60,7 @@
   import org.apache.axis.Constants;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  +import org.apache.axis.SOAPPart;
   import org.apache.axis.configuration.FileProvider;
   import org.apache.axis.encoding.DeserializerFactory;
   import org.apache.axis.encoding.SerializationContext;
  @@ -411,7 +412,7 @@
               if (msg == null)
                   throw new AxisFault(new Exception("Null response message!"));
   
  -            env = msg.getAsSOAPEnvelope();
  +            env = msg.getSOAPPart().getAsSOAPEnvelope();
               return( env.getBodyElements() );
           }
   
  @@ -479,7 +480,7 @@
               msg = msgContext.getResponseMessage();
               if (msg == null)
                   throw new AxisFault(new Exception("Null response message!"));
  -            return( msg.getAsSOAPEnvelope() );
  +            return( msg.getSOAPPart().getAsSOAPEnvelope() );
           }
           catch( Exception exp ) {
               if ( exp instanceof AxisFault ) throw (AxisFault) exp ;
  @@ -901,7 +902,7 @@
            */
           resMsg.setMessageType(Message.RESPONSE);
   
  -        resEnv = (SOAPEnvelope)resMsg.getAsSOAPEnvelope();
  +        resEnv = (SOAPEnvelope)resMsg.getSOAPPart().getAsSOAPEnvelope();
   
           SOAPBodyElement respBody = resEnv.getFirstBody();
           if (respBody instanceof SOAPFaultElement) {
  
  
  
  1.51      +8 -0      xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java
  
  Index: SerializationContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- SerializationContext.java	2001/10/31 23:50:21	1.50
  +++ SerializationContext.java	2001/11/02 03:07:40	1.51
  @@ -181,6 +181,14 @@
                   sendXSIType = false ;
           }
       }
  +    
  +    /**
  +     * Set whether we are doing multirefs, overriding property setting.
  +     */ 
  +    public void setDoMultiRefs (boolean shouldDo)
  +    {
  +        doMultiRefs = shouldDo;
  +    }
   
       public void setSendDecl(boolean sendDecl)
       {
  
  
  
  1.24      +1 -1      xml-axis/java/src/org/apache/axis/handlers/DebugHandler.java
  
  Index: DebugHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/DebugHandler.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DebugHandler.java	2001/10/30 16:46:37	1.23
  +++ DebugHandler.java	2001/11/02 03:07:41	1.24
  @@ -77,7 +77,7 @@
           try {
               Message       msg = msgContext.getRequestMessage();
   
  -            SOAPEnvelope message = (SOAPEnvelope)msg.getAsSOAPEnvelope();
  +            SOAPEnvelope message = (SOAPEnvelope)msg.getSOAPPart().getAsSOAPEnvelope();
               SOAPHeader header = message.getHeaderByName(Constants.URI_DEBUG,
                                                           "Debug");
   
  
  
  
  1.22      +1 -1      xml-axis/java/src/org/apache/axis/handlers/EchoHandler.java
  
  Index: EchoHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/EchoHandler.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- EchoHandler.java	2001/10/30 16:46:37	1.21
  +++ EchoHandler.java	2001/11/02 03:07:41	1.22
  @@ -73,7 +73,7 @@
           category.debug("Enter: EchoHandler::invoke" );
           try {
               Message  msg = msgContext.getRequestMessage();
  -            SOAPEnvelope env = (SOAPEnvelope) msg.getAsSOAPEnvelope();
  +            SOAPEnvelope env = (SOAPEnvelope) msg.getSOAPPart().getAsSOAPEnvelope();
               msgContext.setResponseMessage( new Message( env ) );
           }
           catch( Exception e ) {
  
  
  
  1.21      +2 -2      xml-axis/java/src/org/apache/axis/handlers/LogHandler.java
  
  Index: LogHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/LogHandler.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- LogHandler.java	2001/10/30 16:46:38	1.20
  +++ LogHandler.java	2001/11/02 03:07:41	1.21
  @@ -87,8 +87,8 @@
   
                   pw.println( "=======================================================" );
                   pw.println( "= Elapsed: " + (System.currentTimeMillis() - start) + " milliseconds");
  -                pw.println( "= InMsg: " + (inMsg == null ? "null" : inMsg.getAsString()));
  -                pw.println( "= OutMsg: " + (outMsg == null ? "null" : outMsg.getAsString()));
  +                pw.println( "= InMsg: " + (inMsg == null ? "null" : inMsg.getSOAPPart().getAsString()));
  +                pw.println( "= OutMsg: " + (outMsg == null ? "null" : outMsg.getSOAPPart().getAsString()));
                   pw.println( "=======================================================" );
   
                   pw.close();
  
  
  
  1.5       +12 -12    xml-axis/java/src/org/apache/axis/handlers/SimpleSessionHandler.java
  
  Index: SimpleSessionHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/SimpleSessionHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SimpleSessionHandler.java	2001/10/30 14:19:29	1.4
  +++ SimpleSessionHandler.java	2001/11/02 03:07:41	1.5
  @@ -71,10 +71,10 @@
   import java.util.Set;
   
   /** This handler uses SOAP headers to do simple session management.
  - * 
  + *
    * <p>Essentially, you install it on both the request and response chains of
    * your service, on both the client and the server side.</p>
  - * 
  + *
    * <p>ON THE SERVER:</p>
    * <ul>
    * <li>The REQUEST is checked for a session ID header.  If present, we
  @@ -97,7 +97,7 @@
    *     in the AxisClient associated with the MessageContext.  If so, we
    *     insert a session ID header with the appropriate ID.
    * </ul>
  - * 
  + *
    * <p>SimpleSessions are "reaped" periodically via a very simplistic
    * mechanism.  Each time the handler is invoke()d we check to see if more
    * than <b>reapPeriodicity</b> milliseconds have elapsed since the last
  @@ -128,7 +128,7 @@
       
       /**
        * Process a MessageContext.
  -     */ 
  +     */
       public void invoke(MessageContext context) throws AxisFault
       {
           // Should we reap timed out sessions?
  @@ -167,7 +167,7 @@
   
       /**
        * Client side of processing.
  -     */ 
  +     */
       public void doClient(MessageContext context) throws AxisFault
       {
           if (context.getPastPivot()) {
  @@ -175,7 +175,7 @@
               Message msg = context.getResponseMessage();
               if (msg == null)
                   return;
  -            SOAPEnvelope env = msg.getAsSOAPEnvelope();
  +            SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
               SOAPHeader header = env.getHeaderByName(SESSION_NS,
                                                       SESSION_LOCALPART);
               if (header == null)
  @@ -202,7 +202,7 @@
               if (msg == null)
                   throw new AxisFault("No request message in MessageContext?");
               
  -            SOAPEnvelope env = msg.getAsSOAPEnvelope();
  +            SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
               SOAPHeader header = new SOAPHeader(SESSION_NS,
                                                  SESSION_LOCALPART,
                                                  id);
  @@ -212,7 +212,7 @@
   
       /**
        * Server side of processing.
  -     */ 
  +     */
       public void doServer(MessageContext context) throws AxisFault
       {
           if (context.getPastPivot()) {
  @@ -225,7 +225,7 @@
               Message msg = context.getResponseMessage();
               if (msg == null)
                   return;
  -            SOAPEnvelope env = msg.getAsSOAPEnvelope();
  +            SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
               SOAPHeader header = new SOAPHeader(SESSION_NS,
                                                  SESSION_LOCALPART,
                                                  id);
  @@ -236,7 +236,7 @@
               if (msg == null)
                   throw new AxisFault("No request message?");
               
  -            SOAPEnvelope env = msg.getAsSOAPEnvelope();
  +            SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
               SOAPHeader header = env.getHeaderByName(SESSION_NS,
                                                       SESSION_LOCALPART);
               Long id;
  @@ -271,9 +271,9 @@
       
       /**
        * Generate a new session, register it, and return its ID.
  -     * 
  +     *
        * @return the new session's ID for later lookup.
  -     */ 
  +     */
       private synchronized Long getNewSession()
       {
           Long id = new Long(curSessionID++);
  
  
  
  1.32      +13 -13    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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- SOAPService.java	2001/10/30 16:46:38	1.31
  +++ SOAPService.java	2001/11/02 03:07:41	1.32
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -9,7 +9,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    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
  @@ -17,7 +17,7 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    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,
  @@ -25,7 +25,7 @@
    *
    * 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 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -78,8 +78,8 @@
   /** A <code>SOAPService</code> is a Handler which encapsulates a SOAP
    * invocation.  It has an request chain, an response chain, and a pivot-point,
    * and handles the SOAP semantics when invoke()d.
  - * 
  - * @author Glen Daniels (gdaniels@macromedia.com) 
  + *
  + * @author Glen Daniels (gdaniels@macromedia.com)
    * @author Doug Davis (dug@us.ibm.com)
    */
   public class SOAPService extends SimpleTargetedChain
  @@ -89,7 +89,7 @@
   
       /** Valid transports for this service
        * (server side only!)
  -     * 
  +     *
        * !!! For now, if this is null, we assume all
        * transports are valid.
        */
  @@ -127,7 +127,7 @@
       }
       
       /** Tell this service which engine it's deployed to.
  -     * 
  +     *
        * The main result of this right now is to set up type mapping
        * relationships.
        */
  @@ -174,7 +174,7 @@
           category.debug( "Doing SOAP semantic checks...");
           
           // 1. Check mustUnderstands
  -        SOAPEnvelope env = msgContext.getRequestMessage().getAsSOAPEnvelope();
  +        SOAPEnvelope env = msgContext.getRequestMessage().getSOAPPart().getAsSOAPEnvelope();
           Vector headers = env.getHeaders();
           Vector misunderstoodHeaders = null;
           Enumeration enum = headers.elements();
  @@ -199,7 +199,7 @@
                       respMsg = new Message(new SOAPEnvelope());
                       msgContext.setResponseMessage(respMsg);
                   }
  -                env = respMsg.getAsSOAPEnvelope();
  +                env = respMsg.getSOAPPart().getAsSOAPEnvelope();
                   enum = misunderstoodHeaders.elements();
                   while (enum.hasMoreElements()) {
                       SOAPHeader badHeader = (SOAPHeader)enum.nextElement();
  @@ -243,7 +243,7 @@
           category.debug("Exit : SOAPService::invoke" );
       }
   
  -    public void undo(MessageContext msgContext) 
  +    public void undo(MessageContext msgContext)
       {
           category.debug("Enter: SOAPService::undo" );
           category.debug("Exit: SOAPService::undo" );
  @@ -268,10 +268,10 @@
   
       /*********************************************************************
        * Administration and management APIs
  -     * 
  +     *
        * These can get called by various admin adapters, such as JMX MBeans,
        * our own Admin client, web applications, etc...
  -     * 
  +     *
        *********************************************************************
        */
       
  
  
  
  1.57      +1 -1      xml-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- MessageElement.java	2001/10/31 23:50:21	1.56
  +++ MessageElement.java	2001/11/02 03:07:41	1.57
  @@ -140,7 +140,7 @@
                      Attributes attributes, DeserializationContext context)
       {
           if (category.isDebugEnabled()) {
  -            category.debug("New MessageElement (" + this + ") named " + qName);
  +            category.debug("New MessageElement (" + super.toString() + ") named " + qName);
               for (int i = 0; attributes != null && i < attributes.getLength(); i++) {
                   category.debug("  " + attributes.getQName(i) + " = '" + attributes.getValue(i) + "'");
               }
  
  
  
  1.25      +2 -2      xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
  
  Index: JavaProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JavaProvider.java	2001/10/30 16:46:38	1.24
  +++ JavaProvider.java	2001/11/02 03:07:41	1.25
  @@ -224,11 +224,11 @@
               JavaClass jc	  = JavaClass.find(obj.getClass());
   
               Message        reqMsg  = msgContext.getRequestMessage();
  -            SOAPEnvelope   reqEnv  = (SOAPEnvelope)reqMsg.getAsSOAPEnvelope();
  +            SOAPEnvelope   reqEnv  = (SOAPEnvelope)reqMsg.getSOAPPart().getAsSOAPEnvelope();
               Message        resMsg  = msgContext.getResponseMessage();
               SOAPEnvelope   resEnv  = (resMsg == null) ?
                                        new SOAPEnvelope() :
  -                                     (SOAPEnvelope)resMsg.getAsSOAPEnvelope();
  +                                     (SOAPEnvelope)resMsg.getSOAPPart().getAsSOAPEnvelope();
   
               // get the response message again! It may have been explicitly set!
               // (by, say, a proxy service :-) -- RobJ
  
  
  
  1.44      +2 -2      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.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- AxisServer.java	2001/10/31 23:50:21	1.43
  +++ AxisServer.java	2001/11/02 03:07:41	1.44
  @@ -239,7 +239,7 @@
                       // some kind of declarative "parse point" on the handler
                       // chain instead....
                       Message rm = msgContext.getRequestMessage();
  -                    rm.getAsSOAPEnvelope().getFirstBody();
  +                    rm.getSOAPPart().getAsSOAPEnvelope().getFirstBody();
                       h = msgContext.getServiceHandler();
                       if (h == null)
                           throw new AxisFault("Server.NoService",
  @@ -380,7 +380,7 @@
                       // chain instead....
                       Message rm = msgContext.getRequestMessage();
                       if (rm != null) {
  -                        rm.getAsSOAPEnvelope().getFirstBody();
  +                        rm.getSOAPPart().getAsSOAPEnvelope().getFirstBody();
                           h = msgContext.getServiceHandler();
                       }
                       if (h == null)
  
  
  
  1.58      +4 -3      xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- AxisServlet.java	2001/10/31 23:50:21	1.57
  +++ AxisServlet.java	2001/11/02 03:07:41	1.58
  @@ -248,7 +248,7 @@
                       Message respMsg = msgContext.getResponseMessage();
                       if (respMsg != null) {
                           writer.println("<p>Got response message:</p>");
  -                        writer.println(respMsg.getAsString());
  +                        writer.println(respMsg.getSOAPPart().getAsString());
                       } else {
                           writer.println("<p>No response message!</p>");
                       }
  @@ -406,7 +406,7 @@
                   msgContext.setResponseMessage(msg);
               } else {
                   try {
  -                    SOAPEnvelope env = msg.getAsSOAPEnvelope();
  +                    SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
                       env.clearBody();
                       env.addBodyElement(new SOAPFaultElement((AxisFault)e));
                   } catch (AxisFault af) {
  @@ -417,13 +417,14 @@
   
           /* Send it back along the wire...  */
           /***********************************/
  +        // ROBJDO this must change for MIME outgoing content
           msg = msgContext.getResponseMessage();
           res.setContentType( "text/xml; charset=utf-8" );
           String response;
           if (msg == null) {
               response="No data";
           } else {
  -            response = (String)msg.getAsString();
  +            response = (String)msg.getSOAPPart().getAsString();
           }
           res.setContentLength( response.getBytes().length );
           res.getWriter().print( response );
  
  
  
  1.29      +6 -4      xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java
  
  Index: HTTPSender.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- HTTPSender.java	2001/10/30 16:46:40	1.28
  +++ HTTPSender.java	2001/11/02 03:07:41	1.29
  @@ -107,7 +107,7 @@
               String   action = msgContext.getStrProp(HTTPConstants.MC_HTTP_SOAPACTION);
               if (action == null) {
                   Message rm = msgContext.getRequestMessage();
  -                MessageElement body = rm.getAsSOAPEnvelope().getFirstBody();
  +                MessageElement body = rm.getSOAPPart().getAsSOAPEnvelope().getFirstBody();
                   action = body.getNamespaceURI();
                   if (action == null) action = "";
                   if (!action.endsWith("/")) action += "/";
  @@ -205,7 +205,8 @@
                   sock.setSoTimeout(msgContext.getTimeout());
               }
   
  -            reqEnv  = (String) msgContext.getRequestMessage().getAsString();
  +            // ROBJDO must be stream-oriented here
  +            reqEnv  = (String) msgContext.getRequestMessage().getSOAPPart().getAsString();
   
               //System.out.println("Msg: " + reqEnv);
   
  @@ -251,6 +252,7 @@
               }
   
               StringBuffer header = new StringBuffer();
  +            // ROBJDO envelope API needs to change???  to avoid getting all the bytes
               byte[] request = reqEnv.getBytes();
   
               header.append( HTTPConstants.HEADER_POST )
  @@ -354,7 +356,7 @@
                                                   statusMessage,
                                                   null,
                                                   null);
  -                fault.setFaultDetailsString("return code:" + returnCode + "\n"+ 
  +                fault.setFaultDetailsString("return code:" + returnCode + "\n"+
                                               new String(buf, 0, len));
                   throw fault;
               }
  @@ -380,7 +382,7 @@
                           category.debug( "\nNo Content-Length" );
                           category.debug( "\nXML received:" );
                           category.debug( "-----------------------------------------------");
  -                        category.debug( (String) outMsg.getAsString() );
  +                        category.debug( (String) outMsg.getSOAPPart().getAsString() );
                       }
                   } else {
                       outMsg = new Message( inp );
  
  
  
  1.37      +5 -4      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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- SimpleAxisServer.java	2001/10/31 23:50:21	1.36
  +++ SimpleAxisServer.java	2001/11/02 03:07:41	1.37
  @@ -172,6 +172,7 @@
        * Axis engine for processing.
        */
       public void run() {
  +        category.debug("SimpleAxisServer starting up.");
   
           // create an Axis server
           AxisServer engine = getAxisServer();
  @@ -236,8 +237,8 @@
                       // read headers
                       is.setInputStream(socket.getInputStream());
                       // parse all headers into hashtable
  -                    int contentLength = parseHeaders(is, soapAction, 
  -                                                     httpRequest, fileName, 
  +                    int contentLength = parseHeaders(is, soapAction,
  +                                                     httpRequest, fileName,
                                                        cookie, cookie2, authInfo);
                       is.setContentLength(contentLength);
   
  @@ -389,7 +390,7 @@
                           msgContext.setResponseMessage(msg);
                       } else {
                           try {
  -                            SOAPEnvelope env = msg.getAsSOAPEnvelope();
  +                            SOAPEnvelope env = msg.getSOAPPart().getAsSOAPEnvelope();
                               env.clearBody();
                               env.addBodyElement(new SOAPFaultElement((AxisFault)e));
                           } catch (AxisFault fault) {
  @@ -400,7 +401,7 @@
   
                   // Retrieve the response from Axis
                   Message responseMsg = msgContext.getResponseMessage();
  -                byte[] response = (byte[]) responseMsg.getAsBytes();
  +                byte[] response = (byte[]) responseMsg.getSOAPPart().getAsBytes();
   
                   // Send it on its way...
                   OutputStream out = socket.getOutputStream();
  
  
  
  1.8       +1 -1      xml-axis/java/src/org/apache/axis/transport/local/LocalResponder.java
  
  Index: LocalResponder.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/local/LocalResponder.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LocalResponder.java	2001/10/30 16:46:41	1.7
  +++ LocalResponder.java	2001/11/02 03:07:42	1.8
  @@ -72,7 +72,7 @@
   
       public void invoke(MessageContext msgContext) throws AxisFault {
           category.debug("Enter: LocalResponder::invoke" );
  -        msgContext.getResponseMessage().getAsString();
  +        msgContext.getResponseMessage().getSOAPPart().getAsString();
           category.debug("Enter: LocalResponder::invoke" );
       }
   
  
  
  
  1.17      +2 -2      xml-axis/java/src/org/apache/axis/transport/local/LocalSender.java
  
  Index: LocalSender.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/local/LocalSender.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- LocalSender.java	2001/10/31 23:50:21	1.16
  +++ LocalSender.java	2001/11/02 03:07:42	1.17
  @@ -106,7 +106,7 @@
   
           // copy the request, and force its format to String in order to
           // exercise the serializers.
  -        String msgStr = clientContext.getRequestMessage().getAsString();
  +        String msgStr = clientContext.getRequestMessage().getSOAPPart().getAsString();
   
           category.debug( "LocalSender sending XML:");
           category.debug( msgStr);
  @@ -147,7 +147,7 @@
                   serverContext.setResponseMessage(respMsg);
               } else {
                   SOAPFaultElement faultEl = new SOAPFaultElement(fault);
  -                SOAPEnvelope env = respMsg.getAsSOAPEnvelope();
  +                SOAPEnvelope env = respMsg.getSOAPPart().getAsSOAPEnvelope();
                   env.clearBody();
                   env.addBodyElement(faultEl);
               }
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/attachments/AttachmentPart.java
  
  Index: AttachmentPart.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.attachments;
  
  import org.apache.axis.Part;
  import org.apache.axis.Message;
  import org.apache.log4j.Category;
  
  import javax.activation.DataHandler;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.io.IOException;
  
  /**
   * An AttachmentPart contains attachment data along with MIME
   * headers, and implements the standard Part API.
   * <p>
   * It provides access to attachment content via
   * javax.activation.DataHandlers, so it will not be built if Axis
   * is built without activation.jar, and core Axis code must not
   * import it (lest it also become dependent on axis.jar).
   * Attachment-aware code, of course, is no problem.
   * 
   * @author Rob Jellinghaus (robj@unrealities.com)
   * @author Rick Rineholt (rineholt@us.ibm.com)
   */
  public class AttachmentPart extends Part {
      static Category category = Category.getInstance(Message.class.getName());
      
      /**
       * Do not call this directly!  This should only be called by the
       * AttachmentsImpl object.
       */ 
      public AttachmentPart (Message parent) {
          super(parent);
      }
  
      /**
       * TODO: everything!
       */ 
      public int getContentLength() {
          return 0;
      }
  
      /**
       * TODO: everything!
       */ 
      public String getContentType() {
          return null;
      }
  
      /**
       * TODO: everything!
       */ 
      public int getSize() {
          return 0;
      }
  
      /**
       * TODO: everything!
       */ 
      public void writeTo(OutputStream out) throws IOException {
      }
  }
  
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/attachments/Attachments.java
  
  Index: Attachments.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.attachments;
  
  import org.apache.axis.Part;
  
  /**
   * Access the Attachments of a Message.  This interface essentially
   * firewalls the rest of Axis from any dependencies on javax.activation.
   * <p>
   * If javax.activation is not available, this is the *only* class that
   * will be compiled in org.apache.axis.attachments.
   *
   * @author Rob Jellinghaus (robj@unrealities.com)
   */
  
  public interface Attachments {
      /**
       * Get a given attachment Part, by content id. 
       * Will actually, and always, return an AttachmentPart.
       */ 
      public Part getAttachmentById (String contentId);
      
      /**
       * Get a given attachment Part, by content location.
       * Will actually, and always, return an AttachmentPart.
       */ 
      public Part getAttachmentByLocation (String contentLocation);
      
      /**
       * Create a new attachment Part in this Message.
       * Will actually, and always, return an AttachmentPart.
       */ 
      public Part createAttachmentPart ();
      
      /**
       * Coming soon: attachment enumeration!
       */ 
  }
  
  
  
  1.1                  xml-axis/java/src/org/apache/axis/attachments/AttachmentsImpl.java
  
  Index: AttachmentsImpl.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.attachments;
  
  import org.apache.axis.Message;
  import org.apache.axis.Part;
  
  import java.util.Hashtable;
  
  /**
   * Implements the Attachment interface, via an actual Hashtable of actual
   * AttachmentParts.
   *
   * @author Rob Jellinghaus (robj@unrealities.com)
   */
  
  public class AttachmentsImpl implements Attachments {
      private Message msg;
      
      private Hashtable attachments = new Hashtable();
      
      /**
       * Construct one of these on a parent Message.
       * Should only ever be called by Message constructor!
       */ 
      public AttachmentsImpl (Message parent) {
          msg = parent;
      }
  
      public Part createAttachmentPart() {
          return new AttachmentPart(msg);
      }
  
      /**
       * TODO: everything!
       */ 
      public Part getAttachmentById(String contentId) {
          return null;
      }
  
      /**
       * TODO: everything!
       */ 
      public Part getAttachmentByLocation(String contentLocation) {
          return null;
      }
  }
  
  
  
  1.8       +2 -2      xml-axis/java/test/put.java
  
  Index: put.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/put.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- put.java	2001/10/26 18:19:01	1.7
  +++ put.java	2001/11/02 03:07:42	1.8
  @@ -11,7 +11,7 @@
   
   /**
    * A convenient little test program which will send a message as is to
  - * the server.  Useful for debugging interoperability problems or 
  + * the server.  Useful for debugging interoperability problems or
    * handling of ill-formed messages that are hard to reproduce programmatically.
    *
    * Accepts the standard options, followed by a list of files containing
  @@ -36,7 +36,7 @@
       
               call.invoke();
           
  -            System.out.println(call.getResponseMessage().getAsString());
  +            System.out.println(call.getResponseMessage().getSOAPPart().getAsString());
           }
       }
   }
  
  
  
  1.7       +1 -1      xml-axis/java/test/RPCDispatch/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/RPCDispatch/Service.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Service.java	2001/10/18 13:28:37	1.6
  +++ Service.java	2001/11/02 03:07:42	1.7
  @@ -46,7 +46,7 @@
   
          // get the first parameter
          Message message = mc.getRequestMessage();
  -       RPCElement body = (RPCElement)message.getAsSOAPEnvelope().getFirstBody();
  +       RPCElement body = (RPCElement)message.getSOAPPart().getAsSOAPEnvelope().getFirstBody();
          NodeList parms = body.getAsDOM().getChildNodes();
          Node parm1 = null;
          for (int i=0; i<parms.getLength(); i++) {
  
  
  
  1.25      +1 -1      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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- TestRPC.java	2001/10/31 23:50:22	1.24
  +++ TestRPC.java	2001/11/02 03:07:42	1.25
  @@ -82,7 +82,7 @@
   
           // Extract the response Envelope
           Message message = msgContext.getResponseMessage();
  -        envelope = (SOAPEnvelope)message.getAsSOAPEnvelope();
  +        envelope = (SOAPEnvelope)message.getSOAPPart().getAsSOAPEnvelope();
           assertNotNull("SOAP envelope was null", envelope);
   
           // Extract the body from the envelope
  
  
  
  1.17      +1 -1      xml-axis/java/test/RPCDispatch/TestSerializedRPC.java
  
  Index: TestSerializedRPC.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/RPCDispatch/TestSerializedRPC.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- TestSerializedRPC.java	2001/10/31 23:50:22	1.16
  +++ TestSerializedRPC.java	2001/11/02 03:07:42	1.17
  @@ -95,7 +95,7 @@
           // Extract the response Envelope
           Message message = msgContext.getResponseMessage();
           assertNotNull("Response message was null!", message);
  -        SOAPEnvelope envelope = (SOAPEnvelope)message.getAsSOAPEnvelope();
  +        SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPPart().getAsSOAPEnvelope();
           assertNotNull("SOAP envelope was null", envelope);
   
           // Extract the body from the envelope
  
  
  
  1.7       +4 -4      xml-axis/java/test/encoding/TestBody.java
  
  Index: TestBody.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestBody.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestBody.java	2001/10/31 23:50:22	1.6
  +++ TestBody.java	2001/11/02 03:07:42	1.7
  @@ -10,7 +10,7 @@
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.server.AxisServer;
   
  -/** 
  +/**
    * Verify that deserialization actually can cause the soap service
    * to be set...
    */
  @@ -22,14 +22,14 @@
   
       private String namespace = "http://xml.apache.org/axis/TestBody";
   
  -    private String request = 
  +    private String request =
           "<?xml version=\"1.0\"?>\n" +
           "<soap:Envelope " +
             "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
             "xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">" +
             "<soap:Body>\n" +
               "<method xmlns=\"" + namespace + "\">\n" +
  -              "<arg>5</arg>" + 
  +              "<arg>5</arg>" +
               "</method>\n" +
             "</soap:Body>\n" +
           "</soap:Envelope>\n";
  @@ -51,7 +51,7 @@
          message.setMessageContext(msgContext);
   
          // ensure that the message is parsed
  -       SOAPEnvelope envelope = message.getAsSOAPEnvelope();
  +       SOAPEnvelope envelope = message.getSOAPPart().getAsSOAPEnvelope();
          RPCElement body = (RPCElement)envelope.getFirstBody();
   
          // verify the service is set
  
  
  
  1.6       +108 -54   xml-axis/java/test/encoding/TestDOM.java
  
  Index: TestDOM.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestDOM.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestDOM.java	2001/10/18 13:28:38	1.5
  +++ TestDOM.java	2001/11/02 03:07:42	1.6
  @@ -1,63 +1,117 @@
  -package test.encoding;
  -
  +package test.encoding;
  +
  +
  +
   import junit.framework.TestCase;
   import org.apache.axis.AxisEngine;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
   import org.apache.axis.message.SOAPEnvelope;
  -import org.apache.axis.server.AxisServer;
  -
  -/** 
  - * Verify that deserialization actually can cause the soap service
  - * to be set...
  - */
  -public class TestDOM extends TestCase {
  -
  -    public TestDOM(String name) {
  -        super(name);
  -    }
  -
  -    private String request =
  -        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
  -        "<SOAP-ENV:Envelope" +
  -        " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"" +
  -        " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
  -        " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" +
  -        " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" +
  -        "  <SOAP-ENV:Header>\n" +
  -        "    <SOAP-SEC:signature SOAP-ENV:actor=\"null\" SOAP-ENV:mustUnderstand=\"1\"" +
  -        " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
  -        " xmlns:SOAP-SEC=\"http://schemas.xmlsoap.org/soap/security/\">\n" +
  -        "       <Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">\n" +
  -        "       </Signature>\n" +
  -        "    </SOAP-SEC:signature>\n" +
  -        "  </SOAP-ENV:Header>\n" +
  -        "  <SOAP-ENV:Body id=\"body\">\n" +
  -        "    <ns1:getQuote xmlns:ns1=\"urn:xmltoday-delayed-quotes\">\n" +
  -        "      <symbol xsi:type=\"xsd:string\">IBM</symbol>\n" +
  -        "    </ns1:getQuote>\n" +
  -        "  </SOAP-ENV:Body>\n" +
  -        "</SOAP-ENV:Envelope>";
  -
  -    public void testDOM() throws Exception {
  -
  -       // setup
  -       AxisEngine engine = new AxisServer();
  -       engine.init();
  -       MessageContext msgContext = new MessageContext(engine);
  -       Message message = new Message(request);
  -       message.setMessageContext(msgContext);
  -
  -       // Now completely round trip it
  -       SOAPEnvelope envelope = message.getAsSOAPEnvelope();
  +import org.apache.axis.server.AxisServer;
  +
  +
  +
  +/**
  +
  + * Verify that deserialization actually can cause the soap service
  +
  + * to be set...
  +
  + */
  +
  +public class TestDOM extends TestCase {
  +
  +
  +
  +    public TestDOM(String name) {
  +
  +        super(name);
  +
  +    }
  +
  +
  +
  +    private String request =
  +
  +        "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
  +
  +        "<SOAP-ENV:Envelope" +
  +
  +        " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"" +
  +
  +        " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
  +
  +        " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" +
  +
  +        " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" +
  +
  +        "  <SOAP-ENV:Header>\n" +
  +
  +        "    <SOAP-SEC:signature SOAP-ENV:actor=\"null\" SOAP-ENV:mustUnderstand=\"1\"" +
  +
  +        " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
  +
  +        " xmlns:SOAP-SEC=\"http://schemas.xmlsoap.org/soap/security/\">\n" +
  +
  +        "       <Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">\n" +
  +
  +        "       </Signature>\n" +
  +
  +        "    </SOAP-SEC:signature>\n" +
  +
  +        "  </SOAP-ENV:Header>\n" +
  +
  +        "  <SOAP-ENV:Body id=\"body\">\n" +
  +
  +        "    <ns1:getQuote xmlns:ns1=\"urn:xmltoday-delayed-quotes\">\n" +
  +
  +        "      <symbol xsi:type=\"xsd:string\">IBM</symbol>\n" +
  +
  +        "    </ns1:getQuote>\n" +
  +
  +        "  </SOAP-ENV:Body>\n" +
  +
  +        "</SOAP-ENV:Envelope>";
  +
  +
  +
  +    public void testDOM() throws Exception {
  +
  +
  +
  +       // setup
  +
  +       AxisEngine engine = new AxisServer();
  +
  +       engine.init();
  +
  +       MessageContext msgContext = new MessageContext(engine);
  +
  +       Message message = new Message(request);
  +
  +       message.setMessageContext(msgContext);
  +
  +
  +
  +       // Now completely round trip it
  +
  +       SOAPEnvelope envelope = message.getSOAPPart().getAsSOAPEnvelope();
          
  -       // Element dom = message.getAsDOM();
  -       String result = message.getAsString();
  -
  -       assertEquals("Request is not the same as the result.", request, result);
  +       // Element dom = message.getAsDOM();
  +
  +       String result = message.getSOAPPart().getAsString();
  +
  +
  +
  +       assertEquals("Request is not the same as the result.", request, result);
  +
       }
       
       public static void main(String [] args) throws Exception
  -    {
        TestDOM tester = new TestDOM("TestDOM");
        tester.testDOM();
  -    }
  -}
  +    {
  +        TestDOM tester = new TestDOM("TestDOM");
  +        tester.testDOM();
  +    }
  +
  +}
  +
  
  
  
  1.19      +9 -9      xml-axis/java/test/encoding/TestDeser.java
  
  Index: TestDeser.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestDeser.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- TestDeser.java	2001/10/18 13:28:38	1.18
  +++ TestDeser.java	2001/11/02 03:07:42	1.19
  @@ -18,7 +18,7 @@
   import java.util.Set;
   import java.util.Vector;
   
  -/** 
  +/**
    * Test deserialization of SOAP responses
    */
   public class TestDeser extends TestCase {
  @@ -28,7 +28,7 @@
       private AxisServer server = new AxisServer();
   
       public TestDeser(String name) {
  -        this(name, Constants.URI_CURRENT_SCHEMA_XSI, 
  +        this(name, Constants.URI_CURRENT_SCHEMA_XSI,
                      Constants.URI_CURRENT_SCHEMA_XSD);
       }
   
  @@ -99,7 +99,7 @@
          Message message = new Message(header + data + footer);
          message.setMessageContext(new MessageContext(server));
   
  -       SOAPEnvelope envelope = (SOAPEnvelope)message.getAsSOAPEnvelope();
  +       SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPPart().getAsSOAPEnvelope();
          assertNotNull("SOAP envelope should not be null", envelope);
   
          RPCElement body = (RPCElement)envelope.getFirstBody();
  @@ -157,7 +157,7 @@
           v.addElement("def");
           deserialize("<result xsi:type=\"soapenc:Array\" " +
                               "soapenc:arrayType=\"xsd:string[2]\"> " +
  -                       "<item xsi:type=\"xsd:string\">abc</item>" + 
  +                       "<item xsi:type=\"xsd:string\">abc</item>" +
                          "<item xsi:type=\"xsd:string\">def</item>" +
                       "</result>",
                       v);
  @@ -172,7 +172,7 @@
           deserialize("<result xsi:type=\"soapenc:Array\" " +
                               "soapenc:arrayType=\"xsd:string[4]\" " +
                               "soapenc:offset=\"[2]\"> " +
  -                       "<item xsi:type=\"xsd:string\">abc</item>" + 
  +                       "<item xsi:type=\"xsd:string\">abc</item>" +
                          "<item xsi:type=\"xsd:string\">def</item>" +
                       "</result>",
                       list);
  @@ -186,8 +186,8 @@
           list.add(null);
           deserialize("<result xsi:type=\"soapenc:Array\" " +
                               "soapenc:arrayType=\"xsd:string[4]\"> " +
  -      "<item soapenc:position=\"[0]\" xsi:type=\"xsd:string\">abc</item>" + 
  -      "<item soapenc:position=\"[2]\" xsi:type=\"xsd:string\">def</item>" + 
  +      "<item soapenc:position=\"[0]\" xsi:type=\"xsd:string\">abc</item>" +
  +      "<item soapenc:position=\"[2]\" xsi:type=\"xsd:string\">def</item>" +
                       "</result>",
                       list);
       }
  @@ -199,8 +199,8 @@
           deserialize("<result xsi:type=\"xmlsoap:Map\" " +
                       "xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " +
                         "<item>" +
  -                       "<key xsi:type=\"xsd:string\">abcKey</key>" + 
  -                       "<value xsi:type=\"xsd:string\">abcVal</value>" + 
  +                       "<key xsi:type=\"xsd:string\">abcKey</key>" +
  +                       "<value xsi:type=\"xsd:string\">abcVal</value>" +
                         "</item><item>" +
                          "<key xsi:type=\"xsd:string\">defKey</key>" +
                          "<value xsi:type=\"xsd:string\">defVal</value>" +
  
  
  
  1.14      +8 -8      xml-axis/java/test/encoding/TestHrefs.java
  
  Index: TestHrefs.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestHrefs.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TestHrefs.java	2001/10/18 13:28:38	1.13
  +++ TestHrefs.java	2001/11/02 03:07:42	1.14
  @@ -11,10 +11,10 @@
   
   import java.util.Vector;
   
  -/** 
  +/**
    * Test deserialization of SOAP messages with references, by putting the
    * actual value in various places in the message.
  - * 
  + *
    * @author Glen Daniels (gdaniels@macromedia.com)
    */
   public class TestHrefs extends TestCase {
  @@ -23,7 +23,7 @@
       private String [] messageParts;
       
       public TestHrefs(String name) {
  -        this(name, Constants.URI_CURRENT_SCHEMA_XSI, 
  +        this(name, Constants.URI_CURRENT_SCHEMA_XSI,
                      Constants.URI_CURRENT_SCHEMA_XSD);
       }
   
  @@ -40,7 +40,7 @@
       public TestHrefs(String name, String NS_XSI, String NS_XSD) {
           super(name);
   
  -        header = 
  +        header =
               "<?xml version=\"1.0\"?>\n" +
               "<soap:Envelope " +
                 "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
  @@ -58,7 +58,7 @@
                "</soap:Envelope>\n" };
       }
   
  -    private void deserialize(String data, Object expected, int pos) 
  +    private void deserialize(String data, Object expected, int pos)
          throws Exception
       {
          String msgString = header;
  @@ -72,7 +72,7 @@
          Message message = new Message(msgString);
          message.setMessageContext(new MessageContext(new AxisServer()));
   
  -       SOAPEnvelope envelope = (SOAPEnvelope)message.getAsSOAPEnvelope();
  +       SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPPart().getAsSOAPEnvelope();
          assertNotNull("SOAP envelope should not be null", envelope);
   
          RPCElement body = (RPCElement)envelope.getFirstBody();
  @@ -90,13 +90,13 @@
       }
   
       public void testStringReference1() throws Exception {
  -        String result = 
  +        String result =
               "<result root=\"0\" id=\"1\" xsi:type=\"xsd:string\">abc</result>";
           deserialize(result, "abc", 0);
       }
   
       public void testStringReference2() throws Exception {
  -        String result = 
  +        String result =
               "<result root=\"0\" id=\"1\" xsi:type=\"xsd:string\">abc</result>";
           deserialize(result, "abc", 1);
       }
  
  
  
  1.17      +12 -2     xml-axis/java/test/encoding/TestSer.java
  
  Index: TestSer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestSer.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- TestSer.java	2001/10/26 18:19:01	1.16
  +++ TestSer.java	2001/11/02 03:07:42	1.17
  @@ -28,14 +28,23 @@
       public static void main(String [] args) throws Exception
       {
           TestSer tester = new TestSer("TestSer");
  -        tester.testData();
  +        tester.testDataNoHrefs();
  +        tester.testDataWithHrefs();
       }
       
       public TestSer(String name) {
           super(name);
       }
  +    
  +    public void testDataNoHrefs () throws Exception {
  +        doTestData(false);
  +    }
  +        
  +    public void testDataWithHrefs () throws Exception {
  +        doTestData(true);
  +    }        
   
  -    public void testData() throws Exception {
  +    public void doTestData (boolean multiref) throws Exception {
           MessageContext msgContext = new MessageContext(new AxisServer());
           SOAPEnvelope msg = new SOAPEnvelope();
           RPCParam arg1 = new RPCParam("urn:myNamespace", "testParam", "this is a string");
  @@ -50,6 +59,7 @@
           
           Writer stringWriter = new StringWriter();
           SerializationContext context = new SerializationContext(stringWriter, msgContext);
  +        context.setDoMultiRefs(multiref);
           
           TypeMappingRegistry reg = context.getTypeMappingRegistry();
           QName dataQName = new QName("typeNS", "Data");
  
  
  
  1.5       +1 -1      xml-axis/java/test/faults/FaultDecode.java
  
  Index: FaultDecode.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/faults/FaultDecode.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FaultDecode.java	2001/10/30 16:46:42	1.4
  +++ FaultDecode.java	2001/11/02 03:07:42	1.5
  @@ -93,7 +93,7 @@
           Message message = new Message(messageText);
           message.setMessageContext(new MessageContext(server));
   
  -        SOAPEnvelope envelope = (SOAPEnvelope) message.getAsSOAPEnvelope();
  +        SOAPEnvelope envelope = (SOAPEnvelope) message.getSOAPPart().getAsSOAPEnvelope();
           this.assertNotNull("envelope", envelope);
   
           SOAPBodyElement respBody = envelope.getFirstBody();
  
  
  

Mime
View raw message