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/04/30 23:38:32 UTC
cvs commit: ws-axis/java/test/wsdl/echo ComplexEchoServiceSoapBindingImpl.java ComplexEchoServiceTestCase.java echo.wsdl
dims 2005/04/30 14:38:32
Modified: java/test/wsdl/echo ComplexEchoServiceSoapBindingImpl.java
ComplexEchoServiceTestCase.java echo.wsdl
Log:
Test case (in progress) for AXIS-1926 - wrapped document/literal generates wrong SOAP message for arrays within arrays
URL: http://issues.apache.org/jira/browse/AXIS-1926
Revision Changes Path
1.2 +4 -0 ws-axis/java/test/wsdl/echo/ComplexEchoServiceSoapBindingImpl.java
Index: ComplexEchoServiceSoapBindingImpl.java
===================================================================
RCS file: /home/cvs/ws-axis/java/test/wsdl/echo/ComplexEchoServiceSoapBindingImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ComplexEchoServiceSoapBindingImpl.java 26 Jun 2002 21:44:22 -0000 1.1
+++ ComplexEchoServiceSoapBindingImpl.java 30 Apr 2005 21:38:32 -0000 1.2
@@ -12,4 +12,8 @@
myElement.value.setSimpleItem("MY_SIMPLE_ITEM");
}
+ public test.wsdl.echo.NamedValue[] echo2(test.wsdl.echo.MyComplexType2 options) throws java.rmi.RemoteException {
+ return options.getOptions();
+ }
+
}
1.5 +60 -0 ws-axis/java/test/wsdl/echo/ComplexEchoServiceTestCase.java
Index: ComplexEchoServiceTestCase.java
===================================================================
RCS file: /home/cvs/ws-axis/java/test/wsdl/echo/ComplexEchoServiceTestCase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ComplexEchoServiceTestCase.java 15 Dec 2003 20:10:29 -0000 1.4
+++ ComplexEchoServiceTestCase.java 30 Apr 2005 21:38:32 -0000 1.5
@@ -41,4 +41,64 @@
}
}
+ public void test2ComplexEchoServiceEcho2() throws Exception {
+ test.wsdl.echo.ComplexEchoServiceSoapBindingStub binding;
+ try {
+ binding = (test.wsdl.echo.ComplexEchoServiceSoapBindingStub)
+ new test.wsdl.echo.ComplexEchoServiceLocator().getComplexEchoService();
+ }
+ 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.wsdl.echo.MyComplexType2 request = new test.wsdl.echo.MyComplexType2();
+ request.setUsername("xxx");
+ request.setPassword("yyy");
+ request.setOptions(new NamedValue[]{
+ new NamedValue("dummy1", "dummy_val1"),
+ new NamedValue("dummy2",
+ new NamedValueSet (new NamedValue[]{
+ new NamedValue("dummy2-1", "val2-1"),
+ new NamedValue("dummy2-2", new Integer(314))
+ }))
+ });
+ // Test operation
+ test.wsdl.echo.NamedValue[] value = null;
+ value = binding.echo2(request);
+ // TBD - validate results
+ }
+
+ public void test2ComplexEchoServiceEcho21() throws Exception {
+ test.wsdl.echo.ComplexEchoServiceSoapBindingStub binding;
+ try {
+ binding = (test.wsdl.echo.ComplexEchoServiceSoapBindingStub)
+ new test.wsdl.echo.ComplexEchoServiceLocator().getComplexEchoService();
+ }
+ 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.wsdl.echo.MyComplexType2 request = new test.wsdl.echo.MyComplexType2();
+ request.setUsername("xxx");
+ request.setPassword("yyy");
+ request.setOptions(new NamedValue[]{
+ new NamedValue("dummy1", "dummy_val1"),
+ new NamedValue("dummy2", new NamedValue[]{
+ new NamedValue("dummy2-1", "val2-1"),
+ new NamedValue("dummy2-2", new Integer(314))
+ })
+ });
+ // Test operation
+ test.wsdl.echo.NamedValue[] value = null;
+ value = binding.echo2(request);
+ // TBD - validate results
+ }
}
1.2 +104 -54 ws-axis/java/test/wsdl/echo/echo.wsdl
Index: echo.wsdl
===================================================================
RCS file: /home/cvs/ws-axis/java/test/wsdl/echo/echo.wsdl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- echo.wsdl 26 Jun 2002 21:23:52 -0000 1.1
+++ echo.wsdl 30 Apr 2005 21:38:32 -0000 1.2
@@ -1,55 +1,105 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<wsdl:definitions targetNamespace="http://echo.services"
-xmlns="http://schemas.xmlsoap.org/wsdl/"
-xmlns:impl="http://echo.services-impl"
-xmlns:intf="http://echo.services"
-xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
-xmlns:tns1="http://types.echo.services"
-xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
-xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-<wsdl:types>
-<schema targetNamespace="http://types.echo.services"
-xmlns="http://www.w3.org/2001/XMLSchema">
-<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
-<complexType name="MyComplexType">
-<sequence>
-<element name="simpleItem" nillable="true" type="xsd:string" />
-</sequence>
-</complexType>
-<element name="MyElement" nillable="true" type="tns1:MyComplexType" />
-</schema>
-</wsdl:types>
-<wsdl:message name="echoRequest">
-<wsdl:part element="tns1:MyElement" name="MyElement" />
-</wsdl:message>
-<wsdl:message name="echoResponse">
-<wsdl:part element="tns1:MyElement" name="MyElement" />
-</wsdl:message>
-<wsdl:portType name="Echo">
-<wsdl:operation name="echo" parameterOrder="MyElement">
-<wsdl:input message="intf:echoRequest" name="echoRequest" />
-<wsdl:output message="intf:echoResponse" name="echoResponse" />
-</wsdl:operation>
-</wsdl:portType>
-<wsdl:binding name="ComplexEchoServiceSoapBinding" type="intf:Echo">
-<wsdlsoap:binding style="document"
-transport="http://schemas.xmlsoap.org/soap/http" />
-<wsdl:operation name="echo">
-<wsdlsoap:operation soapAction="" />
-<wsdl:input name="echoRequest">
-<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
-namespace="http://types.echo.services" use="literal" />
-</wsdl:input>
-<wsdl:output name="echoResponse">
-<wsdlsoap:body namespace="http://types.echo.services" use="literal" />
-</wsdl:output>
-</wsdl:operation>
-</wsdl:binding>
-<wsdl:service name="ComplexEchoService">
-<wsdl:port binding="intf:ComplexEchoServiceSoapBinding" name="ComplexEchoService">
-<wsdlsoap:address
-location="http://localhost:8080/axis/services/ComplexEchoService" />
-</wsdl:port>
-</wsdl:service>
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:impl="http://echo.services-impl" xmlns:intf="http://echo.services" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://types.echo.services" 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://echo.services">
+ <wsdl:types>
+ <schema targetNamespace="http://types.echo.services" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="MyComplexType">
+ <sequence>
+ <element name="simpleItem" nillable="true" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <element name="MyElement" nillable="true" type="tns1:MyComplexType"/>
+ <complexType name="NamedValue">
+ <sequence>
+ <element name="name" nillable="true" type="xsd:string"/>
+ <element name="value" nillable="true" type="xsd:anyType"/>
+ </sequence>
+ </complexType>
+ <complexType name="ArrayOfNamedValue">
+ <sequence>
+ <element name="item" type="tns1:NamedValue" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="NamedValueSet">
+ <sequence>
+ <element name="namedValues" nillable="true" type="tns1:ArrayOfNamedValue"/>
+ </sequence>
+ </complexType>
+ <complexType name="AttributeRequest">
+ <sequence>
+ <element name="attributeName" nillable="true" type="xsd:string"/>
+ <element name="requestedAttributes" nillable="true" type="tns1:ArrayOfAttributeRequest"/>
+ </sequence>
+ </complexType>
+ <complexType name="ArrayOfAttributeRequest">
+ <sequence>
+ <element name="item" type="tns1:AttributeRequest" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <complexType name="MyComplexType2">
+ <sequence>
+ <element name="username" type="xsd:string"/>
+ <element name="password" type="xsd:string"/>
+ <element name="options" type="tns1:NamedValue" maxOccurs="unbounded"/>
+ <element name="userAttributes" type="tns1:AttributeRequest" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ <element name="MyElement2" nillable="true" type="tns1:MyComplexType2"/>
+ <element name="MyElement2Response">
+ <complexType>
+ <sequence>
+ <element name="loginReturn" type="tns1:NamedValue" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="echoRequest">
+ <wsdl:part name="MyElement" element="tns1:MyElement"/>
+ </wsdl:message>
+ <wsdl:message name="echoResponse">
+ <wsdl:part name="MyElement" element="tns1:MyElement"/>
+ </wsdl:message>
+ <wsdl:message name="echo2Request">
+ <wsdl:part name="options" element="tns1:MyElement2"/>
+ </wsdl:message>
+ <wsdl:message name="echo2Response">
+ <wsdl:part name="options" element="tns1:MyElement2Response"/>
+ </wsdl:message>
+ <wsdl:portType name="Echo">
+ <wsdl:operation name="echo">
+ <wsdl:input name="echoRequest" message="intf:echoRequest"/>
+ <wsdl:output name="echoResponse" message="intf:echoResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="echo2">
+ <wsdl:input name="echo2Request" message="intf:echo2Request"/>
+ <wsdl:output name="echo2Response" message="intf:echo2Response"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="ComplexEchoServiceSoapBinding" type="intf:Echo">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="echo">
+ <wsdlsoap:operation/>
+ <wsdl:input>
+ <wsdlsoap:body use="literal" namespace="http://types.echo.services"/>
+ </wsdl:input>
+ <wsdl:output>
+ <wsdlsoap:body use="literal" namespace="http://types.echo.services"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="echo2">
+ <wsdlsoap:operation/>
+ <wsdl:input>
+ <wsdlsoap:body use="literal" namespace="http://types.echo.services"/>
+ </wsdl:input>
+ <wsdl:output>
+ <wsdlsoap:body use="literal" namespace="http://types.echo.services"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="ComplexEchoService">
+ <wsdl:port name="ComplexEchoService" binding="intf:ComplexEchoServiceSoapBinding">
+ <wsdlsoap:address location="http://localhost:8080/axis/services/ComplexEchoService"/>
+ </wsdl:port>
+ </wsdl:service>
</wsdl:definitions>