本页内容
Sommatic 文档
打开控制台

SOAP Client

调用 SOAP Web 服务。

以 Markdown 查看
在以下应用中打开
输入与输出 可用 io.soap 版本 1.0.0 执行方式: async

从凭据加载 WSDL,使用 args 调用一个 SOAP 操作,并返回解析后的结果对象。

工作原理

  1. 解析配置。connection_id、method 和 args(默认 {})缺失时回退到输入 payload 中的同名键;connection_id 和 method 为必填。
  2. 解析凭据:WSDL URL 为 config.wsdl(或 config.url);username、password 和 token 取自密钥。
  3. 下载 WSDL 并构建客户端。存在 username 和 password 时设置 HTTP Basic 安全;否则若存在 token,则设置 Bearer 安全。
  4. 以 args 调用 method 操作,并以 { result } 从 out 返回响应的第一个元素(解析后的结果对象)。

在工作流中

节点在工作流文件(draft_nodes[])中的写法,以及一次成功运行的 envelope。

{
  "node_id": "node-get-quote",
  "label": "Get quote",
  "operator_slug": "io.soap",
  "operator_version": "1.0.0",
  "config": {
    "connection_id": "pi-credential-xxxx",
    "method": "GetQuote",
    "args": {
      "Symbol": "{{ $json.symbol }}"
    }
  }
}

配置

connection_id string 必填

SOAP 端点/WSDL 的凭据。接受 `basic-auth`(用户名 + 密码)或 `object`(WSDL URL + 高级配置)类型的凭据。

method string 必填
args object 可选

代码中的行为

除 schema 描述之外,实现代码对这些键的实际处理。

connection_id
接受配置中含 wsdl(或 url)的 basic-auth 或 object 凭据。以 http://、https:// 或 localhost 开头的值会直接用作 WSDL URL,不带认证。
args
一个对象,其键为该操作输入消息中的元素名称。

输出端口

out 默认

操作返回且没有 SOAP fault。result 为转换为 JavaScript 对象的响应正文。

数据
{
  "result": {
    "GetQuoteResult": {
      "Symbol": "ACME",
      "Price": "42.17"
    }
  }
}
error

缺少必填字段、无法加载 WSDL、操作不存在,或服务器返回 SOAP fault 或 HTTP 错误。

数据
{
  "error": "Method \"GetQuote\" not found in WSDL"
}

在表达式中

后续节点可通过 $("SOAP Client").item.json.<路径> 读取此节点输出中的内容(请把 SOAP Client 换成你的节点标签)。Editor 标记工作流编辑器在 Previous Nodes 中提示的路径(输出契约);Worker 标记 worker 实际通过 out 返回的路径,依据“端口”一节所示的输出。

表达式EditorWorker
$("SOAP Client").item.json.resultobject= {…}SOAP 结果
$("SOAP Client").item.json.result.GetQuoteResultobject编辑器不提示= {…}—

— Worker: worker 会返回它,但编辑器不会提示:请手动输入。对象内部的键可能取决于你的数据或配置(例如每个标签一个键)。

错误

消息 端口 原因与处理
WSDL URL not found in connection config error 凭据配置中既没有 wsdl 也没有 url。
Method "<method>" not found in WSDL error WSDL 中没有该名称的操作。请使用 WSDL 中声明的原始操作名。
<SOAP fault or HTTP error message> error 服务器拒绝了调用。请检查 args 是否与该操作的输入消息一致。
method is required error 配置和输入 payload 中都没有操作名(凭据缺失时对应 connection_id is required)。

输入契约

connection_id string 必填
method string 必填
args object 可选

输出契约

result object 可选

SOAP 结果

契约(JSON Schema)

与编排器声明完全一致的定义。All 是完整的 *.definition.js;可与上方各节对照,找出文档与 schema 之间的差异。发布前可用它校验节点。

{
  "slug": "io.soap",
  "name": "SOAP Client",
  "category": "io",
  "version": "1.0.0",
  "description": "Make SOAP Web Service calls.",
  "capabilities": [
    "soap",
    "api",
    "xml",
    "legacy"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "connection_id": {
        "type": "string",
        "title": "SOAP Credential",
        "description": "Credential for the SOAP endpoint / WSDL. Accepts credentials of type `basic-auth` (username + password) or `object` (WSDL URL + advanced config).",
        "ui_widget": "connection_picker",
        "ui_options": {
          "credential_types": [
            "basic-auth",
            "object"
          ],
          "types": [
            "soap"
          ]
        }
      },
      "method": {
        "type": "string"
      },
      "args": {
        "type": "object"
      }
    },
    "required": [
      "connection_id",
      "method"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "connection_id": {
        "type": "string"
      },
      "method": {
        "type": "string"
      },
      "args": {
        "type": "object"
      }
    },
    "required": [
      "connection_id",
      "method"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "result": {
        "type": "object",
        "description": "SOAP Result"
      }
    }
  },
  "ports": [
    {
      "port_id": "out",
      "label": "Response",
      "description": "Soap response",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "description": "Soap fault or error",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "standard-io",
    "legacy-io"
  ],
  "tags": [
    "api",
    "legacy"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_link_loom",
    "profile": {
      "name": "Link Loom",
      "verified": true,
      "url": "https://me.veripass.com/link-loom",
      "logo_url": null
    }
  }
}

执行

执行方式
async
有状态
否
凭据
在服务器端根据 connection_id 解析,密钥不会进入工作流。
能力
soapapixmllegacy
标签
apilegacy

说明与限制

  • 每次运行都会下载并解析 WSDL。无超时,也不重试。
  • 仅返回解析后的结果,不提供响应的原始 XML 和 SOAP 头。

已对照编排器代码核实 · 31e874b · 2026-11-26

安装智能体工具

为你的编程智能体接入 Sommatic AI 官方文档:技能包、文档 MCP 服务器与 Markdown 页面,无需再抓取网页。

安装 Sommatic AI CLI,并为检测到的智能体配置合适的插件。

npx @sommatic/cli agent setup
智能体如何读取本文档