Deserializing dates in attributes
---------------------------------
Key: AXIS-2541
URL: http://issues.apache.org/jira/browse/AXIS-2541
Project: Apache Axis
Issue Type: Bug
Affects Versions: 1.2.1, 1.4
Environment: JDK1.5, Windows, Axis 1.2.1 and 1.4
Reporter: Michael Becke
Dates are not correctly deserialized when used as in the following WSDL:
<?xml version="1.0"?>
<definitions name="TestDates"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://ws.apache.org/test"
xmlns:tns="http://ws.apache.org/test"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<types>
<xs:schema
targetNamespace="http://ws.apache.org/test"
xmlns:tns="http://ws.apache.org/test"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="DateRequest">
<xs:complexType>
<xs:all>
<xs:element name="DateValue"
type="tns:DateValueType" minOccurs="1" maxOccurs="1" />
</xs:all>
</xs:complexType>
</xs:element>
<xs:complexType name="DateValueType">
<xs:attribute name="date" type="xs:date" />
<xs:attribute name="value" type="xs:decimal" />
</xs:complexType>
<xs:element name="DateResponse">
<xs:complexType>
<xs:all>
<xs:element name="Date" type="xs:date"
minOccurs="1" maxOccurs="1" />
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
</types>
<message name="TestRequestMsg">
<part name="body" element="tns:DateRequest"/>
</message>
<message name="TestResponseMsg">
<part name="body" element="tns:DateResponse"/>
</message>
<portType name="TestPortType">
<operation name="TestDates">
<input message="tns:TestRequestMsg"/>
<output message="tns:TestResponseMsg"/>
</operation>
</portType>
<binding name="TestSoapBinding" type="tns:TestPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="TestDates">
<soap:operation soapAction="http://ws.apache.org"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TestService">
<documentation></documentation>
<port name="TestService" binding="tns:TestSoapBinding">
<soap:address location="http://localhost/axis/ws/TestService"/>
</port>
</service>
</definitions>
I am using WSDL2Java to gerate the client/server for this service. Once
generated and installed, calling the service produces the following exception:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NumberFormatException: For input string:
"2006-08-16"
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:mbecke
java.lang.NumberFormatException: For input string: "2006-08-16"
at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at axis.test.TestSoapBindingStub.testDates(TestSoapBindingStub.java:171)
at info.ppr.compass.AxisTest.testSendDates(AxisTest.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Please let me know if I can provide any more information.
Thanks,
Mike
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]