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 TypeEquivalent Java Data Type

(lower case is primitive data type)

booleanboolean
bytebyte
shortshort
intint
longlong
floatfloat
doubledouble
integerjava.math.BigInteger
decimaljava.math.BigDecimal
stringjava.lang.String
dateTimejava.util.Calendar
base64Binarybyte[]
hexBinarybyte[]
durationjava.lang.String
timejava.util.Calendar
datejava.util.Calendar
gYearMonthjava.lang.String
gYearjava.lang.String
gMonthDayjava.lang.String
gDayjava.lang.String
gMonthjava.lang.String
anyURIjava.net.URI
NOTATIONjava.lang.String
tokenjava.lang.String
normalizedStringjava.lang.String
languagejava.lang.String
Namejava.lang.String
NMTOKENjava.lang.String
NCNamejava.lang.String
NMTOKENSjava.lang.String[]
IDjava.lang.String
IDREFjava.lang.String
ENTITYjava.lang.String
IDREFSjava.lang.String[]
ENTITIESjava.lang.String[]
nonPositiveIntegerjava.math.BigInteger
nonNegativeIntegerjava.math.BigInteger
negativeIntegerjava.math.BigInteger
unsignedLongjava.math.BigInteger
positiveIntegerjava.math.BigInteger
unsignedIntlong
unsignedShortint
unsignedByteshort
Qnamejavax.xml.namespace.QName
  • Java to XML Mapping Data Types:
Java Data Type (lower case is primitive data type)Equivalent XML Schema Data Type
intint
shortshort
longlong
floatfloat
doubledouble
bytebyte
booleanboolean
charstring (with facet of length=1)
java.lang.Integerint
java.lang.Shortshort
java.lang.Longlong
java.lang.Floatfloat
java.lang.Doubledouble
java.lang.Bytebyte
java.lang.Booleanboolean
java.lang.Characterstring (with facet of length=1)
java.lang.Stringstring
java.math.BigIntegerinteger
java.math.BigDecimaldecimal
java.util.CalendardateTime
java.util.DatedateTime
byte[]base64Binary
javax.xml.namespace.QNameQname
java.net.URIanyURI

Reference:

Leave a Reply

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