468,310 Members | 1,446 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,310 developers. It's quick & easy.

string not recognized as valid datetime

I'm connecting to a java web service that defines the following complex type
in the wsdl

<xs:complexType name="employee">
<xs:sequence>
<xs:element minOccurs="0" name="firstName" type="xs:string" />
<xs:element minOccurs="0" name="hireDate" type="xs:date" />
<xs:element minOccurs="0" name="lastName" type="xs:string" />
<xs:element minOccurs="0" name="terminationDate" type="xs:date" />
</xs:sequence>
</xs:complexType>

When the type is marshalled to my VS2005 generated proxy the java web
service will omit the terminationDate in the soap message. The proxy then
throws the "string not recognized as valid datetime" error. The proxy code
for the field is copied below. How can I get the proxy to marshal this
type? Shouldn't it set the terminationDateField to 0 and set
terminationDateSpecified=false?
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified,
DataType="date")]
public System.DateTime terminationDate {
get {return this.terminationDateField;}
set {this.terminationDateField = value;}
}

[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool terminationDateSpecified {
get {
return this.terminationDateFieldSpecified;
}
set {
this.terminationDateFieldSpecified = value;
}
}
Jul 12 '07 #1
1 5579
Found the issue. The termination dates where passed as
'2007-001-01T00:00:00-3:00' in the response message and the xsd and proxy
are typed as 'date' and not 'dateTime'.

"Scott Holman" <sh*****@micros.comwrote in message
news:OW*************@TK2MSFTNGP05.phx.gbl...
I'm connecting to a java web service that defines the following complex
type in the wsdl

<xs:complexType name="employee">
<xs:sequence>
<xs:element minOccurs="0" name="firstName" type="xs:string" />
<xs:element minOccurs="0" name="hireDate" type="xs:date" />
<xs:element minOccurs="0" name="lastName" type="xs:string" />
<xs:element minOccurs="0" name="terminationDate" type="xs:date" />
</xs:sequence>
</xs:complexType>

When the type is marshalled to my VS2005 generated proxy the java web
service will omit the terminationDate in the soap message. The proxy then
throws the "string not recognized as valid datetime" error. The proxy
code for the field is copied below. How can I get the proxy to marshal
this type? Shouldn't it set the terminationDateField to 0 and set
terminationDateSpecified=false?
[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified,
DataType="date")]
public System.DateTime terminationDate {
get {return this.terminationDateField;}
set {this.terminationDateField = value;}
}

[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool terminationDateSpecified {
get {
return this.terminationDateFieldSpecified;
}
set {
this.terminationDateFieldSpecified = value;
}
}

Jul 13 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Bob Day | last post: by
reply views Thread by Andres Bohren | last post: by
1 post views Thread by Magnus.Moraberg | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.