Open mtgto opened 7 years ago
Affects me too.
The problem is the toString
method on a Date
object. The Date
object is used for xsd:datetime
: https://github.com/strongloop/strong-soap/blob/09b1cfdd9582a592874c09fa47f5f301d2ed2ae2/src/parser/helper.js#L11-L13
Overriding the toString
on Date
should work. Investigating now.
We ended up forking Strong-SOAP and changing from Date
to a String
. This ended up being the desired behaviour for us.
However, the following could be useful for someone else:
function ISODate(value) {
ISODate.toString = function() {
return new Date(value).toISOString();
};
}
- dateTime: Date,
- time: Date,
- date: Date,
+ dateTime: ISODate,
+ time: ISODate,
+ date: ISODate,
Please create a patch to use your technique or fix https://github.com/strongloop/strong-soap/blob/master/src/parser/xmlHandler.js#L164.
I found strong-soap's XMLHandler use
toString
, nottoISOString
for serializingxsd:dateTime
value in request arguments. I think string format forxsd:dateTime
is ISO8601. (format:[-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]
) http://books.xmlschemata.org/relaxng/ch19-77049.htmlHere is my sample code:
Expect:
Actual: