dims 2002/06/26 14:23:52 Modified: java/src/org/apache/axis/wsdl/toJava JavaGeneratorFactory.java java/test/wsdl Wsdl2javaTestSuite.xml Added: java/test/wsdl/echo echo.wsdl Log: - Fix for 10247 : holders not generated even though they are referenced. - Added Testcase. Revision Changes Path 1.11 +9 -1 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java Index: JavaGeneratorFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- JavaGeneratorFactory.java 20 Jun 2002 20:35:47 -0000 1.10 +++ JavaGeneratorFactory.java 26 Jun 2002 21:23:52 -0000 1.11 @@ -910,9 +910,17 @@ // If the given parameter is an inout or out parameter, then // set a HOLDER_IS_NEEDED flag using the dynamicVar design. if (p.getMode() != Parameter.IN) { - p.getType().setDynamicVar( + TypeEntry typeEntry = p.getType(); + typeEntry.setDynamicVar( JavaTypeWriter.HOLDER_IS_NEEDED, new Boolean(true)); + //If this is a complex then set the HOLDER_IS_NEEDED + //for the reftype too. + if(!typeEntry.isSimpleType() && typeEntry.getRefType()!=null){ + typeEntry.getRefType().setDynamicVar( + JavaTypeWriter.HOLDER_IS_NEEDED, + new Boolean(true)); + } // If the type is a DefinedElement, need to // set HOLDER_IS_NEEDED on the anonymous type. 1.108 +9 -0 xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml Index: Wsdl2javaTestSuite.xml =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml,v retrieving revision 1.107 retrieving revision 1.108 diff -u -r1.107 -r1.108 --- Wsdl2javaTestSuite.xml 21 Jun 2002 22:25:38 -0000 1.107 +++ Wsdl2javaTestSuite.xml 26 Jun 2002 21:23:52 -0000 1.108 @@ -897,6 +897,15 @@ <mapping namespace="http://ram.uspto.gov" package="test.wsdl.ram"/> </wsdl2java> + <!-- This tests holders for complextype Bug:10247 --> + <wsdl2java url="test/wsdl/echo/echo.wsdl" + output="build/work" + serverSide="yes" + testcase="yes"> + <mapping namespace="http://echo.services" package="test.wsdl.echo"/> + <mapping namespace="http://types.echo.services" package="test.wsdl.echo"/> + </wsdl2java> + <!-- The following WSDL are BAD. We're keeping them here so we can --> <!-- check periodically to see whether the owner has fixed them. --> 1.1 xml-axis/java/test/wsdl/echo/echo.wsdl Index: echo.wsdl =================================================================== <?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> </wsdl:definitions>