I'm currently writing a C# webservice that has to match an existing wsdl, and my webservice is called by a third party webservice (My webservice acts as a callback).
However I'm being passed invalid values, and the third party webservice is unwilling to change their webservice.
I'm getting: '2010-10-24 12:12:13' type strings in the xml as a DateTime, (which doesn't meet the spec as it has to be '2010-10-24T12:12:13') Is there any way to override the XML Serialization so that it still matches the wsdl but accepts "anything"?
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public DateTime createdAt {
get {
return this.createdAt;
}
set {
this.createdAtField = value;
}
}
You could make a SoapExtension which modifies the soap xml before it's being deserialized by the framework. If you use wcf and service reference you would need to do it differently. Here's some code I created to clean up a message some time ago.
In your app/web.config (this is for cleaning incoming data from a soap service)
and the code which in my case removes illegal SOAP characters