views:

6

answers:

0

I'm trying to create a new Service Reference from a WSDL and all of the properties I expect to be DateTimes are instead strings.

For example, this xsd definition for Contact:

<s:complexType name="Contact">
    <s:sequence>
        <s:element minOccurs="0" maxOccurs="1" name="Address" type="tns:Address" />
        <s:element minOccurs="0" maxOccurs="1" name="Email" type="s:string" />
        ...
        <s:element minOccurs="1" maxOccurs="1" name="BirthDate" type="s:date" />
</s:sequence>

The type of BirthDate is s:date, but the generated type (in Reference.cs) is a string.

    internal partial class Contact : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {

    [System.Runtime.Serialization.OptionalFieldAttribute()]
    private MembershipMgmtMediator.Address AddressField;

    [System.Runtime.Serialization.OptionalFieldAttribute()]
    private string EmailField;

    ...

    private string BirthDateField;

If i create a web project and add it as a Web Reference instead of a Service Reference, it correctly becomes a DateTime. I assume that has something to do with the way wsdl.exe and svcutil.exe work behind the scenes, but regardless, I'm stuck on trying to figure out how to correctly get Visual Studio to recognize that this property should be a DateTime.