Java Reference
In-Depth Information
Table2-3.Default XML schema mapping to Java data types
XML schema type
Java data type
xs:string
java.lang.String
xs:integer
java.math.BigInteger
xs:int
int
xs:long
long
xs:short
short
xs:decimal
java.math.BigDecimal
xs:float
float
xs:double
double
xs:boolean
boolean
xs:byte
byte
xs:QName and xs:NOTATION
javax.xml.namespace.QName
xs:base64Binary
byte[]
xs:hexBinary
byte[]
xs:unsignedInt
long
xs:unsignedShort
int
xs:unsignedByte
short
xs:time, xs:date, xs:dateTime,xs:gDay, xs:gMonth,
xs:gMonthDay, xs:gYear, xs:gYearMonth
javax.xml.datatype.XMLGregorianCalendar
xs:anySimpleType
java.lang.String
xs:duration
javax.xml.datatype.Duration
If you want to have the binding compiler generate a different Java type than the default, you
can do this one of two ways: write the desired types in an external file you pass to the binding
compiler, or annotate your XML schema.
In general, you may not have to do this. Remember that you are building an SOA, not just a
Java application. You need to keep in mind that clients of your web service will need to be
able to do everything that your contract specifies. Working with polymorphic types or getting
far into the outer reaches of what schema can do may not serve you well in an SOA.
There are four scopes for binding customizations, each of which specifies the range of schema
components to which it applies. They are listed in Table 2-4 .
Search WWH ::




Custom Search