xml-toolkit 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/SOAP11.js CHANGED
@@ -8,6 +8,8 @@ const SOAPFault = require ('./SOAPFault.js')
8
8
 
9
9
  const WSDL = {namespaceURI: 'http://schemas.xmlsoap.org/wsdl/'}
10
10
 
11
+ const _contentType = 'text/xml'
12
+
11
13
  let _xs = null
12
14
 
13
15
  const get_xs = () => {
@@ -127,7 +129,7 @@ const SOAP11 = class {
127
129
 
128
130
  const encoding = 'UTF-8'
129
131
 
130
- let headers = {'Content-Type': 'text/xml; charset=' + encoding.toLowerCase ()}
132
+ let headers = {'Content-Type': _contentType + '; charset=' + encoding.toLowerCase ()}
131
133
 
132
134
  for (const elementLocalName in body [0]) {
133
135
 
@@ -150,6 +152,7 @@ const SOAP11 = class {
150
152
  }
151
153
 
152
154
  SOAP11.namespaceURI = 'http://schemas.xmlsoap.org/wsdl/soap/'
155
+ SOAP11.contentType = _contentType
153
156
 
154
157
  SOAP11.fromFile = async function (fn, options = {}) {
155
158
 
package/lib/SOAP12.js CHANGED
@@ -4,6 +4,8 @@ const SOAPFault = require ('./SOAPFault.js')
4
4
 
5
5
  let _xs = null
6
6
 
7
+ const _contentType = 'application/soap+xml'
8
+
7
9
  const get_xs = () => {
8
10
 
9
11
  if (_xs === null) _xs = new XMLSchemata (path.join (path.dirname (module.filename), 'soap-1.2.xsd'))
@@ -61,7 +63,7 @@ const SOAP12 = class {
61
63
 
62
64
  return {
63
65
  method: 'POST',
64
- headers: {'Content-Type': 'application/soap+xml; charset=' + encoding.toLowerCase ()},
66
+ headers: {'Content-Type': _contentType +'; charset=' + encoding.toLowerCase ()},
65
67
  body: _message (body, header, {declaration: {encoding}})
66
68
  }
67
69
 
@@ -69,6 +71,8 @@ const SOAP12 = class {
69
71
 
70
72
  }
71
73
 
74
+ SOAP12.contentType = _contentType
75
+
72
76
  SOAP12.message = _message
73
77
 
74
78
  module.exports = SOAP12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-toolkit",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Collection of classes for dealing with XML",
5
5
  "main": "index.js",
6
6
  "scripts": {