loopbackio / loopbackio/strong-soap

jsonToXml don't serialize Date value as ISO8601 format.

Open
#94 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
410
Forks
162
Avg merge
4h 36m
Merged PRs (30d)
7

Description

I found strong-soap's XMLHandler use `toString`, not `toISOString` for serializing `xsd:dateTime` value in request arguments.
I think string format for `xsd:dateTime` is ISO8601. (format: `[-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]`)
http://books.xmlschemata.org/relaxng/ch19-77049.html

Here is my sample code:
```javascript
var handler = new soap.XMLHandler();
var node = handler.jsonToXml(null, null, soap.XMLHandler.createSOAPEnvelopeDescriptor("soap"), {"date": new Date()});
var xml = node.end({pretty: true});
console.log(xml);
```

Expect:
```
2017-04-18T15:24:26.871Z
```

Actual:
```
Wed Apr 19 2017 00:24:26 GMT+0900 (JST)
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in XMLHandler.jsonToXml and reproduce the provided sample with a Date value. Compare the generated XML with the expected ISO8601 xsd:dateTime format; the issue is done when Date values serialize with that format instead of the shown Date.toString output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.