antelder    2003/01/07 04:18:37

  Modified:    java/test/util WSIFTestRunner.java
  Added:       java/test/docStyle MessagingRcvAttTest.java
               java/test/docStyle/wsifservice Mime.wsdl
  Log:
  New testcase for message style receiving an attachment
  
  Revision  Changes    Path
  1.1                  xml-axis-wsif/java/test/docStyle/MessagingRcvAttTest.java
  
  Index: MessagingRcvAttTest.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2002 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 "WSIF" 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 [EMAIL PROTECTED]
   *
   * 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 and was
   * originally based on software copyright (c) 2001, 2002, International
   * Business Machines, Inc., http://www.apache.org.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package docStyle;
  
  import java.io.BufferedInputStream;
  import java.io.ByteArrayInputStream;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.StringReader;
  import java.io.StringWriter;
  import java.util.Arrays;
  
  import javax.activation.DataHandler;
  import javax.activation.FileDataSource;
  import junit.framework.Test;
  import junit.framework.TestCase;
  import junit.framework.TestSuite;
  
  import org.apache.wsif.WSIFMessage;
  import org.apache.wsif.WSIFOperation;
  import org.apache.wsif.WSIFPort;
  import org.apache.wsif.WSIFService;
  import org.apache.wsif.WSIFServiceFactory;
  import org.apache.xerces.parsers.DOMParser;
  import org.apache.xml.serialize.OutputFormat;
  import org.apache.xml.serialize.XMLSerializer;
  import org.w3c.dom.Element;
  import org.w3c.dom.Node;
  import org.w3c.dom.NodeList;
  import org.xml.sax.InputSource;
  import util.TestUtilities;
  
  /**
   * Junit test to test out the AXIS provider docstyle support
   */
  public class MessagingRcvAttTest extends TestCase {
        String wsdlLocation =
                TestUtilities.getWsdlPath("java\\test\\docStyle\\wsifservice")
              + "mime.wsdl";
  
        public MessagingRcvAttTest(String name) {
                super(name);
        }
  
      public static void main(String[] args) {
  //        TestUtilities.startListeners(
  //            TestUtilities.ADDRESSBOOK_LISTENER
  //                | TestUtilities.ASYNC_LISTENER
  //                | TestUtilities.NATIVEJMS_LISTENER);
          junit.textui.TestRunner.run(suite());
  //        TestUtilities.stopListeners();
      }
  
        public static Test suite() {
                return new TestSuite(MessagingRcvAttTest.class);
        }
  
        public void setUp() {
                TestUtilities.setUpExtensionsAndProviders();
        }
  
        public void testMsgAxisRcvAtt() {
                doitMsgRcvAtt("SOAPPort", "axis");
        }
  
        private void doitMsgRcvAtt(String portName, String protocol) {
                if (portName.toUpperCase().indexOf("JMS") != -1
                        && !TestUtilities.areWeTesting("jms"))
                        return;
  
                TestUtilities.setProviderForProtocol(protocol);
  
                try {
                        WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
                        WSIFService service =
                                factory.getService(
                                        wsdlLocation,
                                        null,
                                        null,
                      "http://mime/";,
                      "Mime");
  
                        WSIFPort port = service.getPort(portName);
                        WSIFOperation operation = 
port.createOperation("stringToDataHandler");
                        WSIFMessage inMsg = operation.createInputMessage();
                        WSIFMessage outMsg = operation.createOutputMessage();
                        WSIFMessage faultMsg = operation.createFaultMessage();
  
              String content = "The owl and the pussy cat went to sea in a beautiful 
pea-green boat,";
  
              String inputDoc = 
                  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
                  "<soapenv:Envelope 
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"; 
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"; 
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\";>" +
                  " <soapenv:Body>" +
                  "    <ns1:stringToDataHandler 
soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"; 
xmlns:ns1=\"http://mime/\";>" +
                  "       <ns1:buff xsi:type=\"xsd:string\">" + 
                  content + 
                  "</ns1:buff>" +
                  "    </ns1:stringToDataHandler>" +
                  " </soapenv:Body>" +
                  "</soapenv:Envelope>";            
  
                        DOMParser parser = new DOMParser();
  
                        parser.parse(new InputSource(new StringReader(inputDoc)));
                        Element element = parser.getDocument().getDocumentElement();
                        NodeList l = element.getChildNodes();
                        Element e1 = (Element)l.item(1);
                        l = e1.getChildNodes();
                        element = (Element)l.item(1);
                        Node n = e1.getFirstChild();
                        n = n.getNextSibling();
              element = (Element) n;
  //                    printElement(element);
                                
                        inMsg.setObjectPart("buff", element);
  
                        boolean ok =
                                operation.executeRequestResponseOperation(
                                        inMsg,
                                        outMsg,
                                        faultMsg);
                        assertTrue("operation returned false!!", ok);
                        
                        Object o = outMsg.getObjectPart("return");
              assertTrue(
                  "return part not a DataHandler!!",
                  (o instanceof DataHandler));
                  
              DataHandler dh = (DataHandler) o;
              assertTrue("response Datahandler content wrong!!", compareFiles(dh, 
content));
  
                } catch (Exception ex) {
                        ex.printStackTrace();
                        assertTrue(
                                "AddressBookTest("
                                        + portName
                                        + ") caught exception "
                                        + ex.getLocalizedMessage(),
                                false);
                }
        }
  
        private void printElement(Element e) throws Exception {
                OutputFormat of = new OutputFormat(e.getOwnerDocument(), "UTF-8", 
true);
                XMLSerializer xmls = new XMLSerializer(of);
                StringWriter sw = new StringWriter();
                xmls.setOutputCharStream(sw);
                xmls.serialize(e);
                System.err.println("element=" + sw.toString());
        }
  
      private boolean compareFiles(DataHandler dh1, DataHandler dh2)
          throws FileNotFoundException, IOException {
          InputStream is1 = dh1.getInputStream();
          InputStream is2 = dh2.getInputStream();
          boolean success = false;
          try {
              success = compareFiles(is1, is2);
          } finally {
              if (null != is1)
                  is1.close();
              if (null != is2)
                  is2.close();
          }
          return success;
      }
  
      private boolean compareFiles(DataHandler dh, String buff)
          throws FileNotFoundException, IOException {
          InputStream is = dh.getInputStream();
          boolean success = false;
          try {
              success = compareFiles(is, buff);
          } finally {
              if (null != is)
                  is.close();
          }
          return success;
      }
  
      private boolean compareFiles(String one, String buff)
          throws FileNotFoundException, IOException {
          BufferedInputStream oneStream = null;
          File f1 = new File(one);
  
          boolean success = false;
          try {
              oneStream =
                  new BufferedInputStream(
                      new FileInputStream(one),
                      buff.length());
              success = compareFiles(oneStream, buff);
          } finally {
              if (null != oneStream)
                  oneStream.close();
          }
          return success;
      }
  
      private boolean compareFiles(InputStream is, String buff)
          throws FileNotFoundException, IOException {
          return compareFiles(is, new ByteArrayInputStream(buff.getBytes()));
      }
      
      private boolean compareFiles(InputStream is1, InputStream is2) 
          throws FileNotFoundException, IOException {
  
          int avail1 = is1.available();
          int avail2 = is2.available();
          if (avail1 != avail2) return false;
          if (avail1==0) return true;
  
          byte[] buff1 = new byte[avail1];
          byte[] buff2 = new byte[avail2];
  
          Arrays.fill(buff1, (byte) 0);
          Arrays.fill(buff2, (byte) 0);
  
          int bread1 = -1;
          int bread2 = -1;
          bread1 = is1.read(buff1, 0, avail1);
          bread2 = is2.read(buff2, 0, avail2);
          String s1 = new String(buff1);
          String s2 = new String(buff2);
          if (!s1.equals(s2))
              return false;
          return true;
      }
      
      private String concat(String one, String two)
          throws FileNotFoundException, IOException {
          InputStream is1 = null;
          InputStream is2 = null;
          try {
              is1 = (new DataHandler(new FileDataSource(one))).getInputStream();
              is2 = (new DataHandler(new FileDataSource(two))).getInputStream();
              int avail1 = is1.available();
              int avail2 = is2.available();
  
              byte[] buff1 = new byte[avail1];
              byte[] buff2 = new byte[avail2];
  
              Arrays.fill(buff1, (byte) 0);
              Arrays.fill(buff2, (byte) 0);
  
              int bread1 = -1;
              int bread2 = -1;
              bread1 = is1.read(buff1, 0, avail1);
              bread2 = is2.read(buff2, 0, avail2);
              String s1 = new String(buff1);
              String s2 = new String(buff2);
              return s1 + s2;
  
          } finally {
              if (null != is1)
                  is1.close();
              if (null != is2)
                  is2.close();
          }
      }
  
  }
  
  
  
  1.28      +2 -0      xml-axis-wsif/java/test/util/WSIFTestRunner.java
  
  Index: WSIFTestRunner.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/util/WSIFTestRunner.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- WSIFTestRunner.java       3 Jan 2003 14:41:34 -0000       1.27
  +++ WSIFTestRunner.java       7 Jan 2003 12:18:37 -0000       1.28
  @@ -84,6 +84,7 @@
   
   import addressbook.AddressBookTest;
   import async.AsyncTests;
  +import docStyle.MessagingRcvAttTest;
   import docStyle.NWBankTest;
   import docStyle.ZipCodeAxisTest;
   
  @@ -137,6 +138,7 @@
           suite.addTest(new TestSuite(NWBankTest.class));
           suite.addTest(new TestSuite(InteropDocTest.class));
           suite.addTest(new TestSuite(InteropDocWrappedTest.class));
  +        suite.addTest(new TestSuite(MessagingRcvAttTest.class));
   
           if (TestUtilities.areWeTesting("mime"))
               suite.addTest(new TestSuite(MimeTest.class));
  
  
  
  1.1                  xml-axis-wsif/java/test/docStyle/wsifservice/Mime.wsdl
  
  Index: Mime.wsdl
  ===================================================================
  <?xml version="1.0" ?>
  
  <definitions targetNamespace="http://mime/";
               xmlns:tns="http://mime/";
               xmlns:xsd="http://www.w3.org/1999/XMLSchema";
               xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
               xmlns:jms="http://schemas.xmlsoap.org/wsdl/jms/";
               xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/";
               xmlns:java="http://schemas.xmlsoap.org/wsdl/java/";
               xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
               xmlns="http://schemas.xmlsoap.org/wsdl/";>
  
    <!-- type defs -->
    <types>
      <xsd:schema
        targetNamespace="http://mime/";
                  xmlns:xsd="http://www.w3.org/1999/XMLSchema";>
        <xsd:complexType name="ArrayOfBinary">
          <complexContent>
            <restriction base="soapenc:Array">
              <attribute ref="soapenc:arrayType" arrayType="xsd:binary[]"/>
            </restriction>
          </complexContent>
        </xsd:complexType>
      </xsd:schema>
    </types>
  
    <message name="DataHandlerMessage">
      <part name="file" type="tns:datahandler"/>
    </message>
  
    <message name="DataHandlerResponse">
      <part name="return" type="tns:datahandler"/>
    </message>
  
    <message name="DataHandler2Message">
      <part name="file2" type="tns:datahandler"/>
    </message>
  
    <message name="PlainTextMessage">
      <part name="plaintext" type="tns:plaintext"/>
    </message>
  
    <message name="Image1Message">
      <part name="image1" type="tns:image"/>
    </message>
  
    <message name="Image2Message">
      <part name="image2" type="tns:image"/>
    </message>
  
    <message name="StringMessage">
      <part name="buff" type="xsd:string"/>
    </message>
  
    <message name="String2Message">
      <part name="buff2" type="xsd:string"/>
    </message>
  
    <message name="BounceImage4Message">
      <part name="file" type="tns:datahandler"/>
      <part name="shouldBounce" type="xsd:boolean"/>
    </message>
  
    <message name="MultiMimePartsMessage">
      <part name="file" type="tns:datahandler"/>
      <part name="file2" type="tns:datahandler"/>
    </message>
  
    <message name="NullMessage">
    </message>
  
    <message name="ArrayOfBinaryMessage">
      <part name="file" type="tns:ArrayOfBinary"/>
    </message>
  
    <!-- port type declns -->
    <portType name="Mime">
      <operation name="dataHandlerToString">
        <input message="tns:DataHandlerMessage"/>
        <output message="tns:StringMessage"/>
      </operation>
      <operation name="stringToDataHandler">
        <input message="tns:StringMessage"/>
        <output message="tns:DataHandlerResponse"/>
      </operation>
      <operation name="plainTextToString">
        <input message="tns:PlainTextMessage"/>
        <output message="tns:StringMessage"/>
      </operation>
      <operation name="stringToPlainText">
        <input message="tns:StringMessage"/>
        <output message="tns:PlainTextMessage"/>
      </operation>
      <operation name="bounceImage">
        <input message="tns:Image1Message"/>
        <output message="tns:Image2Message"/>
      </operation>
      <operation name="bounceImage2">
        <input message="tns:DataHandlerMessage"/>
        <output message="tns:DataHandler2Message"/>
      </operation>
      <operation name="bounceImage4">
        <input message="tns:BounceImage4Message"/>
        <output message="tns:DataHandler2Message"/>
      </operation>
      <operation name="orMultiMimeParts">
        <input message="tns:DataHandlerMessage"/>
        <output message="tns:StringMessage"/>
      </operation>
      <operation name="andMultiMimeParts">
        <input message="tns:MultiMimePartsMessage"/>
        <output message="tns:StringMessage"/>
      </operation>
      <operation name="multiOutMimeParts">
        <input message="tns:StringMessage"/>
        <output message="tns:MultiMimePartsMessage"/>
      </operation>
      <operation name="multiInoutMimeParts">
        <input message="tns:MultiMimePartsMessage"/>
        <output message="tns:MultiMimePartsMessage"/>
      </operation>
      <operation name="noContent">
        <input message="tns:StringMessage"/>
        <output message="tns:String2Message"/>
      </operation>
      <operation name="typeStar">
        <input message="tns:DataHandlerMessage"/>
        <output message="tns:StringMessage"/>
      </operation>
      <operation name="soapBodyParts1">
        <input message="tns:BounceImage4Message"/>
        <output message="tns:StringMessage"/>
      </operation>
      <operation name="soapBodyParts2">
        <input message="tns:BounceImage4Message"/>
        <output message="tns:StringMessage"/>
      </operation>
      <operation name="soapBodyParts3">
        <input message="tns:BounceImage4Message"/>
        <output message="tns:StringMessage"/>
      </operation>
      <operation name="soapBodyParts4">
        <input message="tns:BounceImage4Message"/>
        <output message="tns:StringMessage"/>
      </operation>
      <operation name="arrayOfBinary">
        <input message="tns:ArrayOfBinaryMessage"/>
        <output message="tns:StringMessage"/>
      </operation>
    </portType>
  
    <!-- binding declns -->
    <binding name="SOAPHttpBinding" type="tns:Mime">
      <soap:binding style="document"
                    transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="dataHandlerToString">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file" type="text/html"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <operation name="stringToDataHandler">
        <soap:operation soapAction=""/>
        <input>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </input>
        <output>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="return" type="text/html"/>
            </mime:part>
          </mime:multipartRelated> 
        </output>
      </operation>
  
      <operation name="plainTextToString">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="plaintext" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <operation name="stringToPlainText">
        <soap:operation soapAction=""/>
        <input>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </input>
        <output>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="plaintext" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </output>
      </operation>
  
      <operation name="bounceImage">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="image1" type="image/jpeg"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="image2" type="image/jpeg"/>
            </mime:part>
          </mime:multipartRelated> 
        </output>
      </operation>
  
      <operation name="bounceImage2">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file" type="image/jpeg"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file2" type="image/jpeg"/>
            </mime:part>
          </mime:multipartRelated> 
        </output>
      </operation>
      
      <!-- bounceImage4 takes a boolean as well as an image. The boolean says
           whether the image should be returned. This allows us to test mixing
           soap and mime parts, and passing and returning null attachments -->
      <operation name="bounceImage4">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file" type="image/jpeg"/>
            </mime:part>
            <mime:part>
              <soap:body use="encoded" parts="shouldBounce"
                         namespace="http://mime/";
                         encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file2" type="image/jpeg"/>
            </mime:part>
          </mime:multipartRelated> 
        </output>
      </operation>
      
      <!-- orMultiMimeParts tests passing in one of two different mime parts -->
      <operation name="orMultiMimeParts">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file" type="text/html"/>
              <mime:content part="file" type="image/jpeg"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <!-- andMultiMimeParts tests passing in two different mime parts -->
      <operation name="andMultiMimeParts">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file" type="text/plain"/>
            </mime:part>
            <mime:part>
              <mime:content part="file2" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <!-- multiOutMimeParts tests returning multiple output mime parts -->
      <operation name="multiOutMimeParts">
        <soap:operation soapAction=""/>
        <input>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </input>
        <output>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file" type="text/plain"/>
            </mime:part>
            <mime:part>
              <mime:content part="file2" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </output>
      </operation>
  
      <!-- multiInoutMimeParts tests multiple inout mime parts -->
      <operation name="multiInoutMimeParts">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file" type="text/plain"/>
            </mime:part>
            <mime:part>
              <mime:content part="file2" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file" type="text/plain"/>
            </mime:part>
            <mime:part>
              <mime:content part="file2" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </output>
      </operation>
  
      <!-- Defining a mime message that doesn't contain any attachments is 
           probably valid. Anyway we allow it -->
      <operation name="noContent">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <soap:body use="encoded"
                         namespace="http://mime/";
                         encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <!-- Test out type="text/*" -->
      <operation name="typeStar">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
               <mime:content part="file" type="text/*"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <!-- Test out soap:body parts="a b c" -->
      <operation name="soapBodyParts1">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <soap:body use="encoded"
                         namespace="http://mime/";
                         encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
                         parts="shouldBounce" />
            </mime:part>
            <mime:part>
               <mime:content part="file" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <operation name="soapBodyParts2">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
               <mime:content part="file" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <operation name="soapBodyParts3">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <soap:body use="encoded"
                         namespace="http://mime/";
                         encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
                         parts="shouldBounce" />
            </mime:part>
            <mime:part>
               <mime:content part="file" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <operation name="soapBodyParts4">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
               <mime:content part="file" type="text/plain"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
  
      <operation name="arrayOfBinary">
        <soap:operation soapAction=""/>
        <input>
          <mime:multipartRelated>
            <mime:part>
              <mime:content part="file" type="text/html"/>
            </mime:part>
          </mime:multipartRelated> 
        </input>
        <output>
          <soap:body use="encoded"
                     namespace="http://mime/";
                     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        </output>
      </operation>
    </binding>
  
    <!-- Mime/Axis/Jms is not supported at present
       binding name="SOAPJmsBinding" type="tns:Mime">
      <soap:binding style="rpc"
                    transport="http://schemas.xmlsoap.org/soap/jms"/>
    </binding -->
  
    <!-- service decln -->
    <service name="MimeService">
      <port name="SOAPPort" binding="tns:SOAPHttpBinding">
        <soap:address location="http://localhost:8080/soap/servlet/rpcrouter"/>
      </port>
      <!-- port name="SOAPJMSPort" binding="tns:SOAPJmsBinding">
        <jms:address jndiDestinationName="SoapJmsAddressBookQueue"
                     destinationStyle="queue"
                     jndiConnectionFactoryName="WSIFSampleQCF"
                     
initialContextFactory="com.sun.jndi.fscontext.RefFSContextFactory"
                     jndiProviderURL="file:///JNDI-Directory"/>
      </port -->
    </service>
  
  </definitions>
  
  


Reply via email to