Can JAX-WS map XML ( xs:dateTime) schema date , including its timezone, to Java Calendar?
xs:dateTime
Calendar
Yes it is possible.
The first approach to the contractyou need to use the element jaxb:javaType. There is general information here and an example of what you need to do here .
jaxb:javaType
Last contract approach
@WebMethod(operationName = "getTest") public Calendar getTest(@WebParam(name = "input") Calendar input) { input.roll(Calendar.DAY_OF_YEAR, 1); return input }
The following is displayed:
<xs:complexType name="getTest"> <xs:sequence> <xs:element name="input" type="xs:dateTime" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="getTestResponse"> <xs:sequence> <xs:element name="return" type="xs:dateTime" minOccurs="0"/> </xs:sequence> </xs:complexType>
, ; JAXB ( , JAX-WS) , XML java.util.Calendar.
, / , XML, - javax.xml.datatype.XMLGregorianCalendar, toGregorianCalendar() ( java.util.GregorianCalendar, java.util. ). , - , XMLGregorianCalendar, / . XMLJavaTypeAdapter.
Source: https://habr.com/ru/post/1775297/More articles:Sql server 2008 connection string error - sql-server-2008Карта внутри Panorama перемещает панораму при панорамировании карты - windows-phone-7How to check only some elements on a web page and not on others? - validationOpen Source CMS Recommendation (Windows, .NET) - windowsGeneral methods for optimizing a program for speed - javaGetting all subgroups with regex - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1775299/setting-fullscreen-exclusive-mode-for-javafx-desktop-application&usg=ALkJrhhYmZXCSaZ3qWZD7WmQG7sumElLVAjava.lang.NoClassDefFoundError: javax / servlet / jsp / el / ELException - javajsp includes a page parameter using a HashMap in the request attribute - jspHow can I parse large XML files in PHP? - xmlAll Articles