[jboss-user] [JBossWS] - Re: Date, Time and DateTime

gquintana do-not-reply at jboss.com
Fri Apr 4 09:03:53 EDT 2008


JBoss WS has a problem the XMLGregorianCalendar, when it generates back the WSDL from Java objects, I get xsd:anySimpleType instead of xsd:dateTime.

I found a workaround (maybe not the best solution), I customized the JAXB binding to avoid the XMLGregorianCalendar:
<?xml version="1.0" encoding="utf-8"?>
  | <bindings  
  | 	xmlns="http://java.sun.com/xml/ns/jaxb" 
  | 	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  | 	version="2.0">
  | 	<globalBindings>
  | 		<javaType name="java.util.Calendar" xmlType="xsd:dateTime"
  | 			parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
  | 			printMethod="javax.xml.bind.DatatypeConverter.printDateTime"/>			
  | 		<javaType name="java.util.Calendar" xmlType="xsd:date"
  | 			parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
  | 			printMethod="javax.xml.bind.DatatypeConverter.printDate"/>			
  | 		<javaType name="java.util.Calendar" xmlType="xsd:time"
  | 			parseMethod="javax.xml.bind.DatatypeConverter.parseTime"
  | 			printMethod="javax.xml.bind.DatatypeConverter.printTime"/>			
  | 	</globalBindings>
  | </binding>
  | 
With this, I get Calendar instead of an XMLGregorianCalendar.

However I still have the "Cannot close output stream" error from the RequestHandlerImpl. This is not related to the date/time problem.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141640#4141640

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4141640



More information about the jboss-user mailing list