Nimbu Developer Docs
Module Reference

soap

SOAP client helper for Cloud Code integrations.

What This Adds In Cloud Code

  • Savon-backed SOAP client from Cloud Code.
  • Async call pattern via promises and await.
  • Useful for legacy ERP/CRM integrations that still expose SOAP.

Quick Start

const Soap = require('soap');
const client = Soap.client('https://example.com/service?wsdl');

API

FunctionParamsReturnsNotes
client(wsdl, options)WSDL URL + client optionsSoapClientClient instances are cached by WSDL+options.
SoapClient.call(operation, message, options?)operation name + payloadPromiseReturns parsed body by default.

call options usually include operation-specific fields; set raw: true to get raw XML.

Practical Example

const Soap = require('soap');

const client = Soap.client('https://partner.example.com/ws/users?wsdl', {
  open_timeout: 15,
  read_timeout: 15
});

const result = await client.call('GetUserByEmail', { email: request.params.email });

Limits And Network Policy

SOAP requests (the WSDL fetch and every operation call) use the same pinned connection as the http module: http/https on ports 80 and 443 only, private and reserved addresses blocked, redirects not followed, and a 10 MB response cap (can differ per plan). Gzip or deflate responses are decompressed under that cap.

  • Timeouts: open_timeout and read_timeout default to 15 seconds each. Their sum is the total deadline of one request, clamped to 30 seconds (120 seconds inside a background job).
  • Auth: credentials in the WSDL or endpoint URL are sent as HTTP Basic auth. An Authorization header in headers wins. Digest and NTLM are not supported.
  • User-Agent: requests send User-Agent: Nimbu-CloudCode unless you set your own in headers.
  • WSDL source: pass an http(s):// URL or inline XML starting with <. Anything else throws invalid wsdl.

Failure Modes & Gotchas

  • A blocked WSDL or endpoint URL throws invalid uri.
  • A timeout or oversized response throws the same kind of message as http, for example timed out after 30.0s.
  • Invalid SSL options/certs can fail client initialization.
  • Keep operation payload shape aligned with WSDL contract.

On this page