JAXB binding customizations do not work for wrapped style parameters
--------------------------------------------------------------------
Key: XFIRE-1013
URL: http://jira.codehaus.org/browse/XFIRE-1013
Project: XFire
Issue Type: Bug
Components: JAXB 2.0
Affects Versions: 1.2.6
Reporter: Matthias Germann
Assignee: Dan Diephouse
JAXB binding customizations are not correctly applied for wrapped style
parameters.
I have a wrapped style Web Service which is generated from a WSDL file.
The follwing extract from the xml schema shows the type which holds the
parameters for the operation:
<xs:complexType name="GetBund">
<xs:sequence>
<xs:element name="Stichtag" type="xs:date"/>
</xs:sequence>
</xs:complexType>
The follwing extract from the jaxb bindings customization file (bindings.xjb)
shows the mapping of the date type:
<bindings node="/xsd:schema" schemaLocation="myschema.xsd">
<globalBindings>
<serializable uid="1"/>
<javaType name="java.util.Calendar" xmlType="xs:date"
parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
printMethod="javax.xml.bind.DatatypeConverter.printDate"
/>
</globalBindings>
</bindings>
Wsgen generates the following method. The "stichtag" parameter is mapped to a
java.util.Calendar (as specified in the bindings.xjb file)
@WebMethod(operationName = "GetBund", action = "")
@WebResult(name = "DirekteBundesteuerDaten", targetNamespace =
"http://mynamespace.org")
public DirekteBundesSteuerDaten getBund(
@WebParam(name = "Stichtag", targetNamespace = "http://mynamespace.org")
Calendar Stichtag)
throws BusinessFault, InfrastructureFault, InvalidArgumentsFault,
PermissionDeniedFault
;
When i invoke the web service with the follwing request, i get an exception.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:leit="http://mynamespace.org">
<soapenv:Header/>
<soapenv:Body>
<leit:GetBund>
<leit:Stichtag>2002-10-10</leit:Stichtag>
</leit:GetBund>
</soapenv:Body>
</soapenv:Envelope>
17:38:49,292 INFO [DefaultFaultHandler] Fault occurred!
java.text.ParseException: Format.parseObject(String) failed
at java.text.Format.parseObject(Format.java:221)
at
org.codehaus.xfire.aegis.type.basic.CalendarType.readObject(CalendarType.java:30)
at
org.codehaus.xfire.aegis.AegisBindingProvider.readParameter(AegisBindingProvider.java:169)
at
org.codehaus.xfire.service.binding.AbstractBinding.read(AbstractBinding.java:206)
at
org.codehaus.xfire.service.binding.WrappedBinding.readMessage(WrappedBinding.java:51)
at
org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42)
at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at
org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
at
org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
at
org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:304)
at
org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:129)
at
org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
IMHO, the JAXB binding customization for the xs:date type is not correctly
applied. The conversion from String to Calendar should be done with the Adapter
which is generated by JAXB and not with the ageis CalendarType.
Everything works fine if i remove the binding customzation for xs:date (which
leads to a XMLGregorianCalendar as input) or if i pass the date parameter as a
dateTime (i.e. "2002-10-10T12:00:00-05:00")
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email