diff --git a/__tests__/XMLMarshaller.js b/__tests__/XMLMarshaller.js index 3261650..b4bfd3b 100644 --- a/__tests__/XMLMarshaller.js +++ b/__tests__/XMLMarshaller.js @@ -272,7 +272,7 @@ test ('20319', async () => { MessageData: { AppData: { data: { - [Symbol.for ('type')]: 'getOrganizationsByEasRequest', + [Symbol.for ('type')]: 'GetOrganizationsByEasRequest', eas: 123456, countRecord: 1, page: 1 @@ -282,6 +282,8 @@ test ('20319', async () => { } } + expect (xs.stringify (data)).toMatch (/xsi:type="ns\d*:GetOrganizationsByEasRequest"/) + expect (xs.stringify (data)).toMatch ('eas>123456<') }) diff --git a/lib/XMLMarshaller.js b/lib/XMLMarshaller.js index 1591d35..5486f84 100644 --- a/lib/XMLMarshaller.js +++ b/lib/XMLMarshaller.js @@ -111,7 +111,7 @@ const XMLMarshaller = class { if (data [XSI_TYPE]) { let d = {}; for (let k in data) d [k] = data [k] - this.appendElementBody (this.schema.get (data [XSI_TYPE]), d) + this.appendContent (this.schema.getType (data [XSI_TYPE]), d) } if (type) return this.appendContent (this.xs.getType (type), data)