Web Service Data Types Data Binding

Web Service Data Types Data Binding

When you are writing the web service it all depends on what you have defined in your XML schema. Types and formatting of data transmitted in SOAP message defined XML schema which should follow the specification of data types which can be use:

  • XML to Java Mapping Data Types:
XML Schema Data Type Equivalent Java Data Type

(lower case is primitive data type)

boolean boolean
byte byte
short short
int int
long long
float float
double double
integer java.math.BigInteger
decimal java.math.BigDecimal
string java.lang.String
dateTime java.util.Calendar
base64Binary byte[]
hexBinary byte[]
duration java.lang.String
time java.util.Calendar
date java.util.Calendar
gYearMonth java.lang.String
gYear java.lang.String
gMonthDay java.lang.String
gDay java.lang.String
gMonth java.lang.String
anyURI java.net.URI
NOTATION java.lang.String
token java.lang.String
normalizedString java.lang.String
language java.lang.String
Name java.lang.String
NMTOKEN java.lang.String
NCName java.lang.String
NMTOKENS java.lang.String[]
ID java.lang.String
IDREF java.lang.String
ENTITY java.lang.String
IDREFS java.lang.String[]
ENTITIES java.lang.String[]
nonPositiveInteger java.math.BigInteger
nonNegativeInteger java.math.BigInteger
negativeInteger java.math.BigInteger
unsignedLong java.math.BigInteger
positiveInteger java.math.BigInteger
unsignedInt long
unsignedShort int
unsignedByte short
Qname javax.xml.namespace.QName
  • Java to XML Mapping Data Types:
Java Data Type (lower case is primitive data type) Equivalent XML Schema Data Type
int int
short short
long long
float float
double double
byte byte
boolean boolean
char string (with facet of length=1)
java.lang.Integer int
java.lang.Short short
java.lang.Long long
java.lang.Float float
java.lang.Double double
java.lang.Byte byte
java.lang.Boolean boolean
java.lang.Character string (with facet of length=1)
java.lang.String string
java.math.BigInteger integer
java.math.BigDecimal decimal
java.util.Calendar dateTime
java.util.Date dateTime
byte[] base64Binary
javax.xml.namespace.QName Qname
java.net.URI anyURI


Leave a Reply

Your email address will not be published. Required fields are marked *