What This Adds In Cloud Code
- Savon-backed SOAP client from Cloud Code.
- Async call pattern via
Nimbu.Futurebridge. - Useful for legacy ERP/CRM integrations that still expose SOAP.
Quick Start
js
const Soap = require('soap');
const client = Soap.client('https://example.com/service?wsdl');API
| Function | Params | Returns | Notes |
|---|---|---|---|
client(wsdl, options) | WSDL URL + client options | SoapClient | Client instances are cached by WSDL+options. |
SoapClient.call(operation, message, options?) | operation name + payload | Promise-like | Uses Nimbu.Future; returns parsed body by default. |
call options usually include operation-specific fields; set raw: true to get raw XML.
Practical Example
js
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 });Failure Modes & Gotchas
- Invalid SSL options/certs can fail client initialization.
- Keep operation payload shape aligned with WSDL contract.