You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/05/03 17:24:51 UTC

cvs commit: ws-axis/java/test/wsdl/marshall MarshallBindingImpl.java MarshallTestCase.java marshall.wsdl

dims        2005/05/03 08:24:51

  Modified:    java/test/wsdl/marshall MarshallBindingImpl.java
                        MarshallTestCase.java marshall.wsdl
  Log:
  test case from Guillaume with one more failure
  
  Revision  Changes    Path
  1.2       +7 -0      ws-axis/java/test/wsdl/marshall/MarshallBindingImpl.java
  
  Index: MarshallBindingImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/marshall/MarshallBindingImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MarshallBindingImpl.java	6 Feb 2005 17:12:26 -0000	1.1
  +++ MarshallBindingImpl.java	3 May 2005 15:24:51 -0000	1.2
  @@ -20,4 +20,11 @@
           return null;
       }
   
  +    public String[] arrayOfSoapEncString(String[] parameter) throws java.rmi.RemoteException {
  +        return parameter;
  +    }
  +
  +    public String[] arrayOfXsdString(String[] parameter) throws java.rmi.RemoteException {
  +        return parameter;
  +    }
   }
  
  
  
  1.2       +70 -0     ws-axis/java/test/wsdl/marshall/MarshallTestCase.java
  
  Index: MarshallTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/marshall/MarshallTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MarshallTestCase.java	6 Feb 2005 17:12:26 -0000	1.1
  +++ MarshallTestCase.java	3 May 2005 15:24:51 -0000	1.2
  @@ -7,6 +7,11 @@
   
   package test.wsdl.marshall;
   
  +import javax.xml.namespace.QName;
  +import org.apache.axis.Message;
  +import org.apache.axis.message.MessageElement;
  +import org.apache.axis.message.SOAPBody;
  +
   public class MarshallTestCase extends junit.framework.TestCase {
       public MarshallTestCase(java.lang.String name) {
           super(name);
  @@ -85,4 +90,69 @@
           // TBD - validate results
       }
   
  +    public void test4MarshallPortArrayOfSoapEncString() throws Exception {
  +        test.wsdl.marshall.MarshallBindingStub binding;
  +        try {
  +            binding = (test.wsdl.marshall.MarshallBindingStub)
  +                    new test.wsdl.marshall.MarshallLocator().getMarshallPort();
  +        }
  +        catch (javax.xml.rpc.ServiceException jre) {
  +            if (jre.getLinkedCause() != null)
  +                jre.getLinkedCause().printStackTrace();
  +            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
  +        }
  +
  +        assertNotNull("binding is null", binding);
  +
  +        // Time out after a minute
  +        binding.setTimeout(60000);
  +
  +        // Test operation
  +        String[] value = new String[]{"1", "2", "", null, "5"};
  +        String[] ret = null;
  +        ret = binding.arrayOfSoapEncString(value);
  +
  +        QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfSoapEncStringResponse");
  +        QName returnQName = new QName("return");
  +        Message m = binding._getCall().getResponseMessage();
  +        SOAPBody body = (SOAPBody) m.getSOAPBody();
  +        MessageElement response = body.getChildElement(responseQName);
  +        MessageElement returnE = response.getChildElement(returnQName);
  +        String arrayType = returnE.getAttributeNS("http://schemas.xmlsoap.org/soap/encoding/", "arrayType");
  +        assertEquals("wrong array type", "soapenc:string[5]", arrayType);
  +        // TBD - validate results
  +    }
  +
  +    public void test5MarshallPortArrayOfXsdString() throws Exception {
  +        test.wsdl.marshall.MarshallBindingStub binding;
  +        try {
  +            binding = (test.wsdl.marshall.MarshallBindingStub)
  +                    new test.wsdl.marshall.MarshallLocator().getMarshallPort();
  +        }
  +        catch (javax.xml.rpc.ServiceException jre) {
  +            if (jre.getLinkedCause() != null)
  +                jre.getLinkedCause().printStackTrace();
  +            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
  +        }
  +
  +        assertNotNull("binding is null", binding);
  +
  +        // Time out after a minute
  +        binding.setTimeout(60000);
  +
  +        // Test operation
  +        String[] value = new String[]{"1", "2", "", null, "5"};
  +        String[] ret = null;
  +        ret = binding.arrayOfXsdString(value);
  +
  +        // TBD - validate results
  +        QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfXsdStringResponse");
  +        QName returnQName = new QName("return");
  +        Message m = binding._getCall().getResponseMessage();
  +        SOAPBody body = (SOAPBody) m.getSOAPBody();
  +        MessageElement response = body.getChildElement(responseQName);
  +        MessageElement returnE = response.getChildElement(returnQName);
  +        String arrayType = returnE.getAttributeNS("http://schemas.xmlsoap.org/soap/encoding/", "arrayType");
  +        assertEquals("wrong array type", "xsd:string[5]", arrayType);
  +    }
   }
  
  
  
  1.2       +60 -8     ws-axis/java/test/wsdl/marshall/marshall.wsdl
  
  Index: marshall.wsdl
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/marshall/marshall.wsdl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- marshall.wsdl	6 Feb 2005 17:12:26 -0000	1.1
  +++ marshall.wsdl	3 May 2005 15:24:51 -0000	1.2
  @@ -1,11 +1,11 @@
  -<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" 
  -                  xmlns:impl="http://marshall.wsdl.test" 
  -                  xmlns:intf="http://marshall.wsdl.test" 
  -                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
  -                  xmlns:tns1="http://marshall.wsdl.test/types" 
  -                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
  -                  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
  -                  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  +<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap"
  +                  xmlns:impl="http://marshall.wsdl.test"
  +                  xmlns:intf="http://marshall.wsdl.test"
  +                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  +                  xmlns:tns1="http://marshall.wsdl.test/types"
  +                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  +                  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
  +                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     targetNamespace="http://marshall.wsdl.test">
       <wsdl:types>
           <schema targetNamespace="http://marshall.wsdl.test/types" xmlns="http://www.w3.org/2001/XMLSchema">
  @@ -32,6 +32,20 @@
                       </restriction>
                   </complexContent>
               </complexType>
  +            <complexType name="ArrayOfSoapEncString">
  +                <complexContent>
  +                    <restriction base="soapenc:Array">
  +                        <attribute ref="soapenc:arrayType" wsdl:arrayType="soapenc:string[]"/>
  +                    </restriction>
  +                </complexContent>
  +            </complexType>
  +            <complexType name="ArrayOfXsdString">
  +                <complexContent>
  +                    <restriction base="soapenc:Array">
  +                        <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
  +                    </restriction>
  +                </complexContent>
  +            </complexType>
           </schema>
       </wsdl:types>
       <wsdl:message name="MyBeanMultiArrayRequest">
  @@ -52,6 +66,18 @@
       <wsdl:message name="MyBeanArrayRequest">
           <wsdl:part name="arrayOfMyBean_1" type="tns1:ArrayOfMyBean"/>
       </wsdl:message>
  +    <wsdl:message name="ArrayOfSoapEncStringRequest">
  +        <wsdl:part name="parameter" type="tns1:ArrayOfSoapEncString"/>
  +    </wsdl:message>
  +    <wsdl:message name="ArrayOfSoapEncStringResponse">
  +        <wsdl:part name="return" type="tns1:ArrayOfSoapEncString"/>
  +    </wsdl:message>
  +    <wsdl:message name="ArrayOfXsdStringRequest">
  +        <wsdl:part name="parameter" type="tns1:ArrayOfXsdString"/>
  +    </wsdl:message>
  +    <wsdl:message name="ArrayOfXsdStringResponse">
  +        <wsdl:part name="return" type="tns1:ArrayOfXsdString"/>
  +    </wsdl:message>
       <wsdl:portType name="MarshallPortType">
           <wsdl:operation name="MyBeanArray" parameterOrder="arrayOfMyBean_1">
               <wsdl:input name="MyBeanArrayRequest" message="impl:MyBeanArrayRequest"/>
  @@ -65,6 +91,14 @@
               <wsdl:input name="MyBeanRequest" message="impl:MyBeanRequest"/>
               <wsdl:output name="MyBeanResponse" message="impl:MyBeanResponse"/>
           </wsdl:operation>
  +        <wsdl:operation name="ArrayOfSoapEncString" parameterOrder="parameter">
  +            <wsdl:input name="ArrayOfSoapEncStringRequest" message="impl:ArrayOfSoapEncStringRequest"/>
  +            <wsdl:output name="ArrayOfSoapEncStringResponse" message="impl:ArrayOfSoapEncStringResponse"/>
  +        </wsdl:operation>
  +        <wsdl:operation name="ArrayOfXsdString" parameterOrder="parameter">
  +            <wsdl:input name="ArrayOfXsdStringRequest" message="impl:ArrayOfXsdStringRequest"/>
  +            <wsdl:output name="ArrayOfXsdStringResponse" message="impl:ArrayOfXsdStringResponse"/>
  +        </wsdl:operation>
       </wsdl:portType>
       <wsdl:binding name="MarshallBinding" type="impl:MarshallPortType">
           <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  @@ -95,6 +129,24 @@
                   <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://marshall.wsdl.test"/>
               </wsdl:output>
           </wsdl:operation>
  +        <wsdl:operation name="ArrayOfSoapEncString">
  +            <wsdlsoap:operation/>
  +            <wsdl:input>
  +                <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://marshall.wsdl.test"/>
  +            </wsdl:input>
  +            <wsdl:output>
  +                <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://marshall.wsdl.test"/>
  +            </wsdl:output>
  +        </wsdl:operation>
  +        <wsdl:operation name="ArrayOfXsdString">
  +            <wsdlsoap:operation/>
  +            <wsdl:input>
  +                <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://marshall.wsdl.test"/>
  +            </wsdl:input>
  +            <wsdl:output>
  +                <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://marshall.wsdl.test"/>
  +            </wsdl:output>
  +        </wsdl:operation>
       </wsdl:binding>
       <wsdl:service name="Marshall">
           <wsdl:port name="MarshallPort" binding="impl:MarshallBinding">