You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/01/17 17:18:28 UTC
cvs commit: xml-axis/java/test/wsdl/types ComprehensiveTypes.wsdl VerifyTestCase.java
butek 02/01/17 08:18:28
Modified: java/src/org/apache/axis/wsdl/toJava JavaImplWriter.java
JavaTestCaseWriter.java
java/test/wsdl/types ComprehensiveTypes.wsdl
VerifyTestCase.java
Added: java/src/javax/xml/rpc/holders ObjectClassHolder.java
Log:
Generated code now handles anyType. Note that anyType maps to java.lang.Object.
This is only a limited mapping - primitive xml types can be sent as anyType, but
primitive Java types can't be converted to java.lang.Object - so we may want to
revisit this in the future.
Revision Changes Path
1.1 xml-axis/java/src/javax/xml/rpc/holders/ObjectClassHolder.java
Index: ObjectClassHolder.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 javax.xml.rpc.holders;
/**
* Class IntegerClassHolder
*
* @version 0.1
*/
public final class ObjectClassHolder implements java.io.Serializable {
/** Field _value */
public Object value;
/**
* Constructor IntegerClassHolder
*/
public ObjectClassHolder() {}
/**
* Constructor IntegerClassHolder
*
* @param value
*/
public ObjectClassHolder(Object value) {
this.value = value;
}
}
1.6 +2 -0 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaImplWriter.java
Index: JavaImplWriter.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaImplWriter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JavaImplWriter.java 15 Jan 2002 16:00:45 -0000 1.5
+++ JavaImplWriter.java 17 Jan 2002 16:18:28 -0000 1.6
@@ -206,6 +206,8 @@
} else {
pw.println("-3;");
}
+ } else if (parms.returnType.getName().equals("java.lang.Object")) {
+ pw.println("(java.lang.String) null;");
} else {
pw.println("null;");
}
1.9 +2 -0 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaTestCaseWriter.java
Index: JavaTestCaseWriter.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaTestCaseWriter.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- JavaTestCaseWriter.java 15 Jan 2002 16:00:45 -0000 1.8
+++ JavaTestCaseWriter.java 17 Jan 2002 16:18:28 -0000 1.9
@@ -260,6 +260,8 @@
pw.print("new java.math.BigDecimal(0)");
} else if (paramType.equals("java.math.BigInteger")) {
pw.print("new java.math.BigInteger(\"0\")");
+ } else if (paramType.equals("java.lang.Object")) {
+ pw.print("new java.lang.String()");
} else if (paramType.equals("byte[]")) {
pw.print("new byte[0]");
} else if (paramType.endsWith("[]")) {
1.10 +61 -0 xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl
Index: ComprehensiveTypes.wsdl
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ComprehensiveTypes.wsdl 14 Jan 2002 14:36:34 -0000 1.9
+++ ComprehensiveTypes.wsdl 17 Jan 2002 16:18:28 -0000 1.10
@@ -251,6 +251,10 @@
<part name="complexWComplex" type="typens:complexWComplex"/>
</message>
+ <message name="any">
+ <part name="any" type="xsd:anyType"/>
+ </message>
+
<!-- port type declns -->
<portType name="TypeTest">
<operation name="allPrimitivesIn">
@@ -351,6 +355,18 @@
<input message="tns:empty"/>
<output message="tns:complexWComplex"/>
</operation>
+ <operation name="anyIn">
+ <input message="tns:any"/>
+ <output message="tns:empty"/>
+ </operation>
+ <operation name="anyInout">
+ <input message="tns:any"/>
+ <output message="tns:any"/>
+ </operation>
+ <operation name="anyOut">
+ <input message="tns:empty"/>
+ <output message="tns:any"/>
+ </operation>
</portType>
<!-- binding declns -->
@@ -706,6 +722,51 @@
</output>
</operation>
<operation name="complexWComplexOut">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="anyIn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="anyInout">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </input>
+ <output>
+ <soap:body
+ use="encoded"
+ namespace=""
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
+ </output>
+ </operation>
+ <operation name="anyOut">
<soap:operation soapAction=""/>
<input>
<soap:body
1.2 +15 -0 xml-axis/java/test/wsdl/types/VerifyTestCase.java
Index: VerifyTestCase.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/types/VerifyTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- VerifyTestCase.java 15 Jan 2002 21:38:33 -0000 1.1
+++ VerifyTestCase.java 17 Jan 2002 16:18:28 -0000 1.2
@@ -248,6 +248,21 @@
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
+ try {
+ binding.anyIn(new java.lang.String("hi ho"));
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
+ }
+ try {
+ binding.anyInout(new javax.xml.rpc.holders.ObjectClassHolder(new java.lang.String("yo ho ho")));
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
+ }
+ try {
+ java.lang.Object value = binding.anyOut();
+ } catch (java.rmi.RemoteException re) {
+ throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
+ }
}
}