scheu 2002/06/18 08:33:21
Modified: java/src/org/apache/axis/encoding
DefaultTypeMappingImpl.java
java/src/org/apache/axis/wsdl/fromJava Types.java
java/test/wsdl/roundtrip RoundtripPortType.java
RoundtripTestServiceTestCase.java
RoundtripTestSoapBindingImpl.java
Log:
Version 1.0 of JSR 101 indicates that byte[] and Byte[] are both
mapped to xsd:base64Binary. If we implement this mapping
it breaks roundtripping...specifically the roundtrip testcase.
So I put the code in as comments...we can enable the code later
if necessary for compliance.
Also removed some code from the the roundtrip testcase associated
with testing Byte[] to soapenc:base64. This mapping was changed
several JSR versions ago to byte[] <->soapenc:base64, so this test
is not valid.
Revision Changes Path
1.31 +31 -0
xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java
Index: DefaultTypeMappingImpl.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- DefaultTypeMappingImpl.java 11 Jun 2002 14:53:54 -0000 1.30
+++ DefaultTypeMappingImpl.java 18 Jun 2002 15:33:21 -0000 1.31
@@ -167,6 +167,37 @@
Constants.XSD_BASE64 ),
new Base64DeserializerFactory(byte[].class,
Constants.XSD_BASE64),true);
+ /*
+ // This JSR 101 change occurred right before v1.0.
+ // This mapping is not roundtrippable, and breaks the roundtrip
+ // testcase, so it is commented out for now.
+ // SOAP 1.1
+ // byte[] -ser-> XSD_BASE64
+ // Byte[] -ser-> XSD_BASE64
+ // XSD_BASE64 -deser-> byte[]
+ // SOAP_BASE64 -deser->byte[]
+ //
+ // NOTE: If the following code is enabled, the
+ // commented out code "//type == Byte[].class ||"
+ // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.
+
+ myRegister(Constants.SOAP_BASE64, byte[].class,
+ new Base64SerializerFactory(byte[].class,
+ Constants.SOAP_BASE64 ),
+ new Base64DeserializerFactory(byte[].class,
+ Constants.SOAP_BASE64),
+ true);
+ myRegister(Constants.XSD_BASE64, Byte[].class,
+ new Base64SerializerFactory(Byte[].class,
+ Constants.XSD_BASE64 ),
+ new Base64DeserializerFactory(Byte[].class,
+ Constants.XSD_BASE64),true);
+ myRegister(Constants.XSD_BASE64, byte[].class,
+ new Base64SerializerFactory(byte[].class,
+ Constants.XSD_BASE64 ),
+ new Base64DeserializerFactory(byte[].class,
+ Constants.XSD_BASE64),true);
+ */
// If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
myRegister(Constants.XSD_STRING, java.lang.String.class,
1.34 +1 -0 xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java
Index: Types.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Types.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- Types.java 11 Jun 2002 14:54:00 -0000 1.33
+++ Types.java 18 Jun 2002 15:33:21 -0000 1.34
@@ -627,6 +627,7 @@
type == java.math.BigDecimal.class ||
type == javax.xml.namespace.QName.class ||
type == java.util.Calendar.class ||
+ //type == Byte[].class ||
type == byte[].class);
}
1.6 +0 -2 xml-axis/java/test/wsdl/roundtrip/RoundtripPortType.java
Index: RoundtripPortType.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripPortType.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RoundtripPortType.java 28 May 2002 17:57:01 -0000 1.5
+++ RoundtripPortType.java 18 Jun 2002 15:33:21 -0000 1.6
@@ -97,8 +97,6 @@
throws java.rmi.RemoteException;
public byte[] methodByteArray(byte[] inByteArray)
throws java.rmi.RemoteException;
- public Byte[] methodSoapByteArray(Byte[] inSoapByteArray)
- throws java.rmi.RemoteException;
public void methodAllTypesIn(java.lang.String string,
java.math.BigInteger integer,
java.math.BigDecimal decimal,
1.12 +0 -22
xml-axis/java/test/wsdl/roundtrip/RoundtripTestServiceTestCase.java
Index: RoundtripTestServiceTestCase.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripTestServiceTestCase.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- RoundtripTestServiceTestCase.java 30 May 2002 15:47:13 -0000 1.11
+++ RoundtripTestServiceTestCase.java 18 Jun 2002 15:33:21 -0000 1.12
@@ -779,28 +779,6 @@
} // testMethodAllTypesIn
/**
- * Test to insure that a wrapper Byte array contains the expected values
- * on both the client and server.
- */
- public void testMethodSoapByteArray() {
-
- try {
- Byte[] sendByte = {new Byte((byte) 17), new Byte((byte) 11)};
- Byte[] expected = {new Byte((byte) 3), new Byte((byte) 7)};
- Byte[] actual = binding.methodSoapByteArray(sendByte);
- assertEquals("The expected and actual values did not match.",
- expected[0],
- actual[0]);
- assertEquals("The expected and actual values did not match.",
- expected[1],
- actual[1]);
- } catch (RemoteException re) {
- fail("Remote Exception caught: " + re);
- }
-
- } // testMethodSoapByteArray
-
- /**
* Test to insure that a primitive byte array matches the expected values on
* both the client and server.
*/
1.11 +0 -13
xml-axis/java/test/wsdl/roundtrip/RoundtripTestSoapBindingImpl.java
Index: RoundtripTestSoapBindingImpl.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/test/wsdl/roundtrip/RoundtripTestSoapBindingImpl.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- RoundtripTestSoapBindingImpl.java 30 May 2002 23:46:04 -0000 1.10
+++ RoundtripTestSoapBindingImpl.java 18 Jun 2002 15:33:21 -0000 1.11
@@ -440,19 +440,6 @@
} // methodAllTypesIn
- public Byte[] methodSoapByteArray(Byte[] in0) throws RemoteException {
-
- Byte[] expected = {new Byte((byte) 17), new Byte((byte) 11)};
- Byte[] returnByte = {new Byte((byte) 3), new Byte((byte) 7)};
-
- if ((in0[0].equals(expected[0])) && (in0[1].equals(expected[1]))) {
- return returnByte;
- } else {
- throw new RemoteException("Expecting a Byte array with 17 and 11.");
- }
-
- } // methodSoapByteArray
-
public byte[] methodByteArray(byte[] in0) throws RemoteException {
byte[] returnByte = {(byte) 5, (byte) 4};