# soap-req-json

> Does a SOAP request and returns JSON string.

Latest version **1.0.2** (published 2021-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install soap-req-json
pnpm add soap-req-json
yarn add soap-req-json
bun add soap-req-json
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-09-23 |
| First published | 2021-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.0.0 |
| Dependencies | 1 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Stubbies |
| Maintainers | mountainaper |
| Keywords | soap, soap-client, node, json |

## Links

- npm: https://www.npmjs.com/package/soap-req-json
- Repository: https://github.com/stubbies/soap-req-json
- Homepage: https://github.com/stubbies/soap-req-json#readme
- Issues: https://github.com/stubbies/soap-req-json/issues
- npm.io page: https://npm.io/package/soap-req-json

## Dependencies (1)

- [xml-js](https://npm.io/package/xml-js.md) ^1.6.11

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-09-23
- 1.0.1 — 2021-09-23
- 1.0.0 — 2021-09-23

## 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 = `
  <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
    <SOAP-ENV:Header>
        <t:Transaction :t="some-URI" SOAP-ENV:mustUnderstand="1">5</t:Transaction>
    </SOAP-ENV:Header>
  </SOAP-ENV:Envelope>`;

// 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 |

---
_Source: https://npm.io/package/soap-req-json · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
