An open API service indexing awesome lists of open source software.

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.

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 |