Consuming Java Webservice with nullable Date and Time elements in WCF generates invalid DataType Attributes - by Thomas Schreiner1

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 534453 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 2/18/2010 12:55:03 AM
Access Restriction Public


When consuming a Java Webservice which has nullable elements of type Date or Time the generated code contains the following attributes for these elements:

[System.Xml.Serialization.SoapElementAttribute(DataType="date", IsNullable=true)]
public System.Nullable<System.DateTime> fromTime { ... }

[System.Xml.Serialization.SoapElementAttribute(DataType="time", IsNullable=true)]
public System.Nullable<System.DateTime> dateOfClearance { ... }

When calling the service this results in an Reflection error with the innerException:

'time' is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types.

Example from the wsdl:

<xsd:element name="fromTime" nillable="true" type="xsd:time" />
<xsd:element name="dateOfClearance" nillable="true" type="xsd:date" />

Sign in to post a comment.
Posted by Microsoft on 2/22/2010 at 1:53 PM

This is a bug in the .NET Framework 2.0. This bug only occurs when using SOAP encoding. nfortantely, because SOAP encoding is not Basic Profile compliant (see The Basic Profile defines a set of guidelines and constraints for web services that improve interoperability across platforms. Because this bug only applies to legacy services that are not Basic Profile compliant it is unlikely that this bug will get fixed.
Posted by Microsoft on 2/18/2010 at 7:02 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(