Date, Time and DateTime
gquintana Apr 4, 2008 5:50 AMHello,
I applied the wsconsume tool from JBoss 4.2.2 successfully on a WSDL. But when I deploy my WS implementation in JBoss, I get the following errors:
2008-04-04 11:35:02,490 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_datex2.eu_schema_1_0_1_048914.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=cos-st-restricts.1.1]::Message=cos-st-restricts.1.1: The type 'DateTime' is atomic, so its {base type definition}, 'xs:anySimpleType', must be an atomic simple type definition or a built-in primitive datatype.
2008-04-04 11:35:02,493 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_datex2.eu_schema_1_0_1_048914.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=cos-st-restricts.1.1]::Message=cos-st-restricts.1.1: The type 'Time' is atomic, so its {base type definition}, 'xs:anySimpleType', must be an atomic simple type definition or a built-in primitive datatype.
2008-04-04 11:35:02,497 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_datex2.eu_schema_1_0_1_048914.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=cos-st-restricts.1.1]::Message=cos-st-restricts.1.1: The type 'Date' is atomic, so its {base type definition}, 'xs:anySimpleType', must be an atomic simple type definition or a built-in primitive datatype.
I don't understand what this error message says, but when I call the WS, I get the following error :
2008-04-04 11:44:52,143 ERROR [org.jboss.wsf.stack.jbws.RequestHandlerImpl] Cannot close output stream
The Date/Time/DateTime type are defined like this:
<xs:complexType name="Date"> <xs:simpleContent> <xs:extension base="xs:date" /> </xs:simpleContent> </xs:complexType> <xs:complexType name="DateTime"> <xs:simpleContent> <xs:extension base="xs:dateTime" /> </xs:simpleContent> </xs:complexType> <xs:complexType name="Time"> <xs:simpleContent> <xs:extension base="xs:time" /> </xs:simpleContent> </xs:complexType>
In the WS impl, to instanciate the DateTime, I wrote:
DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar));
Could someone tell me where I am wrong?