Note that there are some explanatory texts on larger screens.

plurals
  1. PO.NET web service reference generated classes not working with dateTime type
    primarykey
    data
    text
    <p>I've written a JAX-WS webservice in Java by generating a WSDL and classes from an XML schema.</p> <p>I am adding the service as a web reference in visual studio, to use with a C#.NET client application.</p> <p>The original XML schema uses a couple of date/time types: xs:date and xs:dateTime for some of the elements.</p> <p>My problem is that my 'dateTime' type is not working correctly. It is converted to a .NET DateTime object (correctly) in the generated classes (produced by XMLSerializer in Visual Studio 2010), and then I can create my own DateTime object and set the DateTime on one of these classes. However when sending the request back to the server, the client application is sending a null value instead of the DateTime object I set it to. So I guess it is not serializing correctly.</p> <p>I do not have the same problem with the 'date' type, which serializes/deserializes fine.</p> <p>I noticed something which could be the problem, but not sure:</p> <p>The dateTime object in the generated class looks like this: [System.Xml.Serialization.XmlElementAttribute(Order=10)] public System.DateTime MyDateTime { ... }</p> <p>whereas the date object in the generated class looks like this: [System.Xml.Serialization.XmlElementAttribute(DataType="date", Order=12)] public System.DateTime MyDate { ... }</p> <p>So, there is some additional info in the date object - DataType="date", but there is no DateType for the dateTime object. Could this be the problem? If so, why is it not generating the classes correctly?</p> <p>Thanks for any help</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload