Web services typically take a series of arguments and return a value. Because arguments and return values must always be converted from XML to Java (arguments) and back to XML (return values), respectively, only a subset of data
types is allowed. The following data types can be sent as parameters and received as results:
Note
You can also use arrays based on these data types.
The following table lists the primitive data types. See the Axis User's Guide for details on data type mapping.
Primitive Data Types:
Java Type | WSDL Type |
---|---|
boolean | xsd:boolean |
byte | xsd:byte |
short | xsd:short |
int | xsd:int |
long | xsd:long |
float | xsd:float |
double | xsd:double |
char | xsd:string |
The following table lists the Java Object types. See the Axis User Guide for details on data type mapping.
Java Object Types:
Java Type | WSDL Type |
---|---|
java.lang.Boolean | soapenc:boolean |
java.lang.Byte | soapenc:byte |
java.lang.Short | soapenc:short |
java.lang.Integer | soapenc:int |
java.lang.Long | soapenc:long |
java.lang.Float | soapenc:float |
java.lang.Double | soapenc:double |
java.lang.String | xsd:string |
java.math.BigDecimal | xsd:decimal |
java.math.BigInteger | xsd:integer |
java.util.Calendar | xsd:dateTime |
javax.xml.namespace.QName | xsd:QName |
Java Beans are data containers used to wrap data types not covered by default. JavaBeans implement the java.io.Serializable interface, have get and set methods for each attribute, and a public constructor. JavaBeans can be modeled in a Rational Rose model and generated automatically using jGen. The possible combination of data types allows you to model complex data structures.
Note
Do not use any Java-specific collection type that SOAP cannot map to XML (e.g., java.util.Hashtable
). Use arrays instead.
A client retrieves all necessary information about data types from the WSDL file. This is why it is not possible to implement additional functionality (e.g., parameter checking, content validation, etc.) in a JavaBean.