snippets_js
Integration
New integration from credential
const soapClient = await yepcode.integration.soap("credential-slug");
New integration from plain data
const soap = require('soap');
const soapClient = await soap.createClientAsync("http://example.com/wsdl?wsdl", {});
Security and Credentials
If your server includes some security protocol, you may find information here to set your credentials with an already initialized client, for example:
New integration from credential with authentication data (username and password)
const soapClient = await yepcode.integration.soap("credential-slug");
soapClient.setSecurity(new soap.BasicAuthSecurity("username", "password"));
Calling Methods
Call a method on the SOAP service
soapClient.MyFunctionNameAsync({ name: 'value' }).then((result) => {
// result is a javascript array containing result, rawResponse, soapheader, and rawRequest
// result is a javascript object
// rawResponse is the raw xml response string
// soapHeader is the response soap header as a javascript object
// rawRequest is the raw xml request string
})
Call a method using a specific service and port
soapClient.MyService.MyPort.MyFunctionName({name: 'value'}, function(err, result) {
// result is a javascript object
})