https://github.com/stubbies/soap-req-json
Does a SOAP request and returns JSON string.
https://github.com/stubbies/soap-req-json
json node soap soap-client
Last synced: 6 months ago
JSON representation
Does a SOAP request and returns JSON string.
- Host: GitHub
- URL: https://github.com/stubbies/soap-req-json
- Owner: stubbies
- License: mit
- Created: 2021-09-23T20:12:06.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-23T20:36:48.000Z (almost 5 years ago)
- Last Synced: 2024-08-10T23:12:40.000Z (almost 2 years ago)
- Topics: json, node, soap, soap-client
- Language: TypeScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Soap Request To Json
Does a SOAP request and returns JSON string.
# Usage
## `Installation`
```
npm install soap-req-json
// or
yarn add soap-req-json
```
## `Quick Start`
```
const srj = require('soap-req-json');
// SOAP Envelope
const envelope = `
5
`;
// URL
const url = 'https://electrocommerce.org/abc/service';
// The SOAPAction HTTP Header Field
const SOAPAction = 'https://electrocommerce.org/abc#MyMessage';
const jsonString = await srj({ envelope, url, SOAPAction })
```
## `Options`
| Option | Type | Required |
|--------------|--------------------------------------------|----------|
| `envelope` | `string` SOAP Envelope | `true` |
| `url` | `url` | `true` |
| `SOAPAction` | `string` The SOAPAction HTTP Header Field. | `true` |
| `timeout` | `number` Timeout request. Default `0` | `false` |
## `Error messages`
| Message | Description |
|-------------------|------------------------------|
| `INVALID_URL` | URL could not be parsed. |
| `REQUEST_TIMEOUT` | Request timeout. |
| `SERVER_ERROR` | Server responded with error. |
# Dependencies
## `dependencies`
| Package | Description |
|---------|---------------------------------------------------------------------|
| xml-js | Convert XML text to Javascript object / JSON text (and vice versa). |
## `devDependencies`
| Package | Description |
|-------------|----------------------------------------------------------------------|
| @types/node | This package contains type definitions for Node.js |
| typescript | JavaScript compiler/type checker that boosts JavaScript productivity |