xml-toolkit 1.0.27 → 1.0.28

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.
Files changed (2) hide show
  1. package/README.md +26 -0
  2. package/package.json +4 -3
package/README.md CHANGED
@@ -107,4 +107,30 @@ const rq = http.request (endpointURL, {method, headers})
107
107
  rq.write (body)
108
108
  ```
109
109
 
110
+ * [Implementing](https://github.com/do-/node-xml-toolkit/wiki/Use-Case:-Implement-a-SOAP-Web-Service) a SOAP service
111
+
112
+ ```js
113
+ const {XMLSchemata, SOAP11, SOAP12, SOAPFault} = require ('xml-toolkit')
114
+
115
+ const SOAP = SOAP11 // or SOAP12
116
+
117
+ const xs = new XMLSchemata (`myService.wsdl`)
118
+
119
+ let body, statusCode; try {
120
+ body = xs.stringify (myMethod (/*...*/))
121
+ statusCode = 200
122
+ }
123
+ catch (x) {
124
+ body = new SOAPFault (x)
125
+ statusCode = 500
126
+ }
127
+
128
+ rp.writeHead (statusCode, {
129
+ 'Content-Type': SOAP.contentType,
130
+ })
131
+
132
+ const xml = SOAP.message (body)
133
+ rp.end (xml)
134
+ ```
135
+
110
136
  For more information, see [wiki docs](https://github.com/do-/node-xml-toolkit/wiki).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-toolkit",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Collection of classes for dealing with XML",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,8 +12,9 @@
12
12
  },
13
13
  "keywords": [
14
14
  "xml",
15
- "sax",
16
- "stax"
15
+ "soap",
16
+ "xsd",
17
+ "sax"
17
18
  ],
18
19
  "author": "Dmitry Ovsyanko",
19
20
  "license": "MIT",