https://github.com/front/soap-x509-http
https://github.com/front/soap-x509-http
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/front/soap-x509-http
- Owner: front
- Created: 2015-07-08T11:01:45.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-11-30T23:46:56.000Z (over 7 years ago)
- Last Synced: 2025-09-20T23:25:33.620Z (9 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 3
- Watchers: 13
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# soap-x509-http
> An X.509 http client for [node-soap](https://github.com/vpulim/node-soap)
This module provides an HTTP client for accessing web services that require X.509 certificates.
It's based on [node-soap](https://github.com/vpulim/node-soap)'s default HTTP client and relies on [ws.js](https://github.com/yaronn/ws.js) for the signing process.
## Install
Install with [npm](http://github.com/isaacs/npm):
```
npm install soap
npm install soap-x509-http
```
## Usage
**new X509HttpClient(requestOptions, singingCredentials);** creates a new http client to be used on node-soap.
This example assumes that the web service requires a TLS client certificate. If this is not needed then the first parameter can be left empty.
```
var fs = require('fs');
var soap = require('soap');
var X509HttpClient = require('soap-x509-http');
var myX509Client = new X509HttpClient({
pfx: fs.readFileSync(''),
passphrase: '',
ca: fs.readFileSync(''),
rejectUnauthorized: false
}, {
key: fs.readFileSync('')
});
var wsdl = './WebService.wsdl';
var args = {name: 'value'};
soap.createClient(wsdl, {
httpClient: myX509Client
},
function(err, client) {
client.setEndpoint('');
client.MyFunction(args, function(err, result) {
console.log(result);
});
});
```
## More info
For more references and examples on how to use **node-soap**, please check:
- [node-soap](https://github.com/vpulim/node-soap) - A SOAP client and server for node.js.
- [ws.js](https://github.com/yaronn/ws.js) - A WS-* client stack for node.js. Written in pure javascript!