Skip to content

ferrybrouwer/bigregister-soap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BIG Register SOAP wrapper

npm version GitHub release npm

A node wrapper for the SOAP webservice on http://webservices.cibg.nl/Ribiz

Install

npm install bigregister-soap --save

Usage

With promises

// import package
const bigRegister = require('bigregister-soap')

// connect to SOAP server
bigRegister.connect()

	// find user data by BIG-number
	.then(() => bigRegister.findByRegistrationNumber('xxx'))
	.then((data) => {
        // do something with data...
	})

	// catch errors
	.catch((err) => {
        // an error occurred
	})

Using async / await and ES6 imports

// import package
import bigRegister from 'bigregister-soap'

const example = async() => {
    try {

    	// connect to SOAP server
    	await bigRegister.connect()

    	// find user data by BIG-number
        const data = await bigRegisterApi.findByRegistrationNumber('xxx')

        // do something with data

    } catch(err) {

        // an error occurred

    }
}

Documentation

  • Connect to SOAP server:

    Method structure (pseudo code):
    BigRegister.connect(wsdl:String):Promise.<void>

    @note: it's not necessary to wait for resolving the promise, since each API method waits for this promise to be resolved.

     const BigRegister = require('bigregister-soap')
    
     BigRegister.connect()
     	.then(() => console.log('connected'))
    
     	.catch((err) => console.error(`An error occurred: ${err}`))
  • Find user by BIG-number:

    Method structure (pseudo code):
    BigRegister.findByRegistrationNumber(bigNumber:String|Number): Promise.<Object>

     const BigRegister = require('bigregister-soap')
    
     BigRegister.connect()
     	.then(() => BigRegister.findByRegistrationNumber('xxx'))
     	.then((data) => console.log(data))
    
     	.catch((err) => console.error(`An error occurred: ${err}`))